MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / Shellcode

Method Shellcode

core/src/hook.h:27–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 uint8_t opcodes[16];
26#endif
27 Shellcode(intptr_t addr)
28 {
29 memset(opcodes, 0, sizeof(opcodes));
30#if OS_WIN
31 // movabs rax [addr]
32 opcodes[0] = 0x48;
33 opcodes[1] = 0xB8;
34 memcpy(&opcodes[2], &addr, sizeof(intptr_t));
35 // push rax
36 opcodes[10] = 0x50;
37 // ret
38 opcodes[11] = 0xC3;
39#elif OS_MAC
40 // jmp qword ptr [rip + offset] ; pad 2
41 opcodes[0] = 0xFF;
42 opcodes[1] = 0x25;
43 memset(&opcodes[2], 0, sizeof(int32_t));
44 memcpy(&opcodes[6], &addr, sizeof(intptr_t));
45#endif
46 }
47 };
48
49 struct Restorable

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected