VBA:是否可以对别名函数名称进行编码/解码(别名“ CreateFileW”-> Alias Enc(182893))

时间:2019-03-18 09:49:00

标签: vba ms-office obfuscation declare

是否可以在声明行上更改加载函数名称?

'CreateFileA = CreateFileB
'HANDLE CreateFileA(
'  LPCSTR                lpFileName,
'  DWORD                 dwDesiredAccess,
'  DWORD                 dwShareMode,
'  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
'  DWORD                 dwCreationDisposition,
'  DWORD                 dwFlagsAndAttributes,
'  HANDLE                hTemplateFile
');

Private Declare PtrSafe Function HP_CRT Lib "KERNEL32" Alias "CreateFileW"(ByVal name As String, ByVal aces As Long, ByVal shar As Long, ByVal satr As LongPtr, ByVal cdep As Long, ByVal fatr As Long, ByVal hand As Long) As LongPtr

Function LoadFunction(mode)
    return Decrypt(mode)
End Function
Private Declare PtrSafe Function HP_CRT Lib "KERNEL32" Alias LoadFunction("W")(ByVal name As String, ByVal aces As Long, ByVal shar As Long, ByVal satr As LongPtr, ByVal cdep As Long, ByVal fatr As Long, ByVal hand As Long) As LongPtr  

Private Declare PtrSafe Function HP_CRT Lib "KERNEL32" Alias "---"(ByVal name As String, ByVal aces As Long, ByVal shar As Long, ByVal satr As LongPtr, ByVal cdep As Long, ByVal fatr As Long, ByVal hand As Long) As LongPtr
Sub CreateCase
    HP_CRT = GetProcAddress(LoadLibrary("Kernel32"), "CreateFileW")
End Sub

有没有可能?或不可能? 我在Windows 10 RS5上使用MS-Office 2013 x64

0 个答案:

没有答案