3 #include "../Include/Winheaders.h"
4 #include "../Include/NativeStructures.h"
5 #include "../Include/Macro.h"
6 #include "../Include/Types.h"
25 #pragma warning(disable : 4409 4100)
33 template<
typename... Args >
34 DWORD64
X64Call( ptr_t func, Args... args )
39 int argC =
sizeof...(Args);
41 std::vector<DWORD64> vargs{ ((DWORD64)args)... };
43 DWORD64 _rcx = (i < argC) ? vargs[i++] : 0;
44 DWORD64 _rdx = (i < argC) ? vargs[i++] : 0;
45 DWORD64 _r8 = (i < argC) ? vargs[i++] : 0;
46 DWORD64 _r9 = (i < argC) ? vargs[i++] : 0;
50 DWORD64 restArgs = (i < argC) ? (DWORD64)&vargs[i] : 0;
53 DWORD64 _argC = argC - i;
88 lea edi, dword ptr[edi + 8 * eax - 8]
106 lea esp, dword ptr[esp + 8 * ecx + 0x20]
121 return (DWORD64)STATUS_NOT_SUPPORTED;
131 template<
typename ...Args>
135 int argC =
sizeof...(Args);
137 std::vector<DWORD64> vargs{ ((DWORD64)args)... };
139 DWORD64 _rcx = (i < argC) ? vargs[i++] : 0;
140 DWORD64 _rdx = (i < argC) ? vargs[i++] : 0;
141 DWORD64 _r8 = (i < argC) ? vargs[i++] : 0;
142 DWORD64 _r9 = (i < argC) ? vargs[i++] : 0;
146 DWORD64 restArgs = (i < argC) ? (DWORD64)&vargs[i] : 0;
149 DWORD64 _argC = argC - i;
183 lea edi, dword ptr [edi + 8*eax - 8]
200 EMIT( 0x0F ) EMIT( 0x05 );
205 lea esp, dword ptr [esp + 8*ecx + 0x20]
220 return STATUS_NOT_SUPPORTED;
223 #pragma warning(default : 4409 4100)
231 BLACKBONE_API
void memcpy64( DWORD64 , DWORD64 , DWORD );
246 BLACKBONE_API DWORD64
GetModuleHandle64(
const wchar_t* lpModuleName, DWORD* pSize =
nullptr );
253 BLACKBONE_API DWORD64
getNTDLL64( DWORD* pSize =
nullptr );
267 BLACKBONE_API DWORD64
GetProcAddress64( DWORD64 hModule,
const char* funcName );
277 DWORD64 _ntdll64 = 0;
278 DWORD64 _LdrGetProcedureAddress = 0;
279 DWORD _ntdll64Size = 0;
Definition: NativeStructures.h:71
BLACKBONE_API void memcpy64(DWORD64, DWORD64, DWORD)
Copy memory beyond 4GB limit
BLACKBONE_API DWORD64 LoadLibrary64(const wchar_t *path)
Load 64 bit module into current process
Definition: Wow64Local.cpp:229
DWORD64 X64Call(ptr_t func, Args...args)
Call 64 bit function
Definition: Wow64Local.h:34
BLACKBONE_API DWORD64 getTEB64(_TEB64 &out)
Get native bit TEB
Definition: Wow64Local.cpp:65
BLACKBONE_API DWORD64 GetProcAddress64(DWORD64 hModule, const char *funcName)
64 bit implementation of GetProcAddress
Definition: Wow64Local.cpp:203
BLACKBONE_API DWORD64 getNTDLL64(DWORD *pSize=nullptr)
Get 64 bit ntdll base
Definition: Wow64Local.cpp:140
WOW64-x64 interface
Definition: Wow64Local.h:17
BLACKBONE_API DWORD64 getLdrGetProcedureAddress()
Get 'LdrGetProcedureAddress' address
Definition: Wow64Local.cpp:161
BLACKBONE_API DWORD64 GetModuleHandle64(const wchar_t *lpModuleName, DWORD *pSize=nullptr)
Gets 64 bit module base
Definition: Wow64Local.cpp:99
DWORD64 X64Syscall(int idx, Args...args)
Perform a syscall
Definition: Wow64Local.h:132
Definition: AsmHelper32.cpp:6