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 )
37 int argC =
sizeof...(Args);
39 std::vector<DWORD64> vargs{ ((DWORD64)args)... };
41 DWORD64 _rcx = (i < argC) ? vargs[i++] : 0;
42 DWORD64 _rdx = (i < argC) ? vargs[i++] : 0;
43 DWORD64 _r8 = (i < argC) ? vargs[i++] : 0;
44 DWORD64 _r9 = (i < argC) ? vargs[i++] : 0;
48 DWORD64 restArgs = (i < argC) ? (DWORD64)&vargs[i] : 0;
51 DWORD64 _argC = argC - i;
89 lea edi, dword ptr[edi + 8 * eax - 8]
108 lea esp, dword ptr[esp + 8 * ecx + 0x20]
124 return (DWORD64)STATUS_NOT_SUPPORTED;
134 template<
typename ...Args>
138 int argC =
sizeof...(Args);
140 std::vector<DWORD64> vargs{ ((DWORD64)args)... };
142 DWORD64 _rcx = (i < argC) ? vargs[i++] : 0;
143 DWORD64 _rdx = (i < argC) ? vargs[i++] : 0;
144 DWORD64 _r8 = (i < argC) ? vargs[i++] : 0;
145 DWORD64 _r9 = (i < argC) ? vargs[i++] : 0;
149 DWORD64 restArgs = (i < argC) ? (DWORD64)&vargs[i] : 0;
152 DWORD64 _argC = argC - i;
187 lea edi, dword ptr [edi + 8*eax - 8]
204 EMIT( 0x0F ) EMIT( 0x05 );
209 lea esp, dword ptr [esp + 8*ecx + 0x20]
225 return STATUS_NOT_SUPPORTED;
228 #pragma warning(default : 4409 4100)
236 BLACKBONE_API
void memcpy64( DWORD64 , DWORD64 , DWORD );
251 BLACKBONE_API DWORD64
GetModuleHandle64(
const wchar_t* lpModuleName, DWORD* pSize =
nullptr );
258 BLACKBONE_API DWORD64
getNTDLL64( DWORD* pSize =
nullptr );
272 BLACKBONE_API DWORD64
GetProcAddress64( DWORD64 hModule,
const char* funcName );
282 DWORD64 _ntdll64 = 0;
283 DWORD64 _LdrGetProcedureAddress = 0;
284 DWORD _ntdll64Size = 0;
Definition: NativeStructures.h:82
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:135
Definition: AsmHelper32.cpp:6