Advertisement
Reisyukaku

ARM11 Pkmn injection [ORAS]

Jan 24th, 2015
1,272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.02 KB | None | 0 0
  1. #include "spider.h"
  2.  
  3. int payload (){
  4.     unsigned int addr = 0x17990000;
  5.     void *this = 0x08F10000;
  6.     int *read_len = 0x08F10020;
  7.     int *buf = 0x18410000;
  8.     int pkData[0x3A];
  9.     unsigned int offset = 0;
  10.     int i;
  11.    
  12.     IFopen(this, L"dmc:/pokemon.bin", 0x1);
  13.     IFseek(this, 0);
  14.     IFread(this, read_len, buf, 0xE8);
  15.     svcSleepThread(0x400000LL);
  16.    
  17.     memcpy(pkData, buf, 0xE8);
  18.    
  19.     GSPGPU_FlushDataCache(addr, 0x10000);
  20.     GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
  21.     GSPGPU_FlushDataCache(buf, 0x10000);
  22.  
  23.     for (i = 0; i < 0x4000; i++){
  24.         if ((buf[i] == 0x00720071) && (buf[i + 1] == 0x0065006D)) offset = i+0x540;
  25.     }
  26.    
  27.     if (offset != 0){
  28.         svcSleepThread(0x400000LL);
  29.         memcpy(buf + offset, pkData, 0xE8);
  30.     }
  31.    
  32.     svcSleepThread(0x400000LL);
  33.     GSPGPU_FlushDataCache(buf, 0x10000);
  34.     GX_SetTextureCopy(buf, addr, 0x10000, 0, 0, 0, 0, 8);
  35.     GSPGPU_FlushDataCache(addr, 0x10000);
  36.     svcSleepThread(0x400000LL);
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement