Advertisement
sv_iridescence

basic stuff

Jun 6th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #include <stdint.h>
  2. #include <stdarg.h>
  3.  
  4. #include "../include/types.h"
  5. #include "../include/imports.h"
  6. #include "../include/syscall.h"
  7. #include "../include/detour.h"
  8.  
  9. void RenderHook(uint64_t a1)
  10. {
  11.     {
  12.         if (Key_IsDown(key->R3))
  13.         {
  14.             //do stuff
  15.         }
  16.     }
  17.     DrawStub(a1);
  18. }
  19.  
  20.  
  21. extern "C" void _main(void) {
  22.     initImports();
  23.  
  24.     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
  25.     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
  26.  
  27.     DrawStub = (DrawStub_t)DetourFunction(0xADDRESS, (void *)RenderHook, 20);
  28.  
  29.     sceSysUtilSendSystemNotificationWithText(222, "Injected elf");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement