Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdint.h>
- #include <stdarg.h>
- #include "../include/types.h"
- #include "../include/imports.h"
- #include "../include/syscall.h"
- #include "../include/detour.h"
- void RenderHook(uint64_t a1)
- {
- {
- if (Key_IsDown(key->R3))
- {
- //do stuff
- }
- }
- DrawStub(a1);
- }
- extern "C" void _main(void) {
- initImports();
- char restoreDrawingHook[20] = { 0x55, 0x48, 0x89, 0xE5, 0x41, 0x57, 0x41, 0x56, 0x41, 0x55, 0x41, 0x54, 0x53, 0x48, 0x81, 0xEC, 0x28, 0x2C, 0x00, 0x00 }; //first bytes of the func, has to be minimum 15 bytes and cant stop mid instruction, typically its 17/20 bytes
- memcpy((void*)0xADDRESS, restoreDrawingHook, 20); //make sure u change "20" to 17 or however many bytes u use for drawing in both this line and the one above
- DrawStub = (DrawStub_t)DetourFunction(0xADDRESS, (void *)RenderHook, 20);
- sceSysUtilSendSystemNotificationWithText(222, "Injected elf");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement