Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "spider.h"
- int(*IFile_Open)(void *this, const short *path, int flags) = 0x0022FE08;
- int(*IFile_Read)(void *this, unsigned int *read, unsigned int *buffer, unsigned int len) = 0x001686DC;
- int(*IFile_Write)(void *this, unsigned int *written, void *src, unsigned int len) = 0x00168764;
- int (*GX_SetTextureCopy)(void *input_buffer, void *output_buffer, unsigned int size, int in_x, int in_y, int out_x, int out_y, int flags) = 0x0011DD48;
- int (*GSPGPU_FlushDataCache)(void *addr, unsigned int len) = 0x00191504;
- int uvl_entry ()
- {
- unsigned int addr;
- void *this = 0x08F10000;
- int *read_len = 0x08F10020;
- int *buf = 0x18410000;
- int *written = 0x08F01000;
- int boxData[0x3A*30];
- int *HID = 0x10146000;
- unsigned int keyPresses = HID[0];
- int i;
- unsigned int EBUS;
- unsigned int constblock;
- unsigned int offset;
- int j;
- int ADJ;
- addr = 0x17900000; //Way lower than necessary, but we're going to hunt for the relative offsets of box data.
- EBUS = 0;
- constblock = 0;
- offset = 0;
- ADJ = 0;
- for (j=0; j<0x10 && offset == 0;j++)
- {
- GSPGPU_FlushDataCache(addr, 0x10000);
- GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
- GSPGPU_FlushDataCache(buf, 0x10000);
- svcSleepThread(0x400000LL);
- for (i = 0; i < 0x4000; i++)
- {
- if ((buf[i] == 0x53554245 && buf[i-1] == 0 && buf[i-2] == 0 && buf[i-3] == 0) && EBUS == 0)
- {
- EBUS = addr+4*i;
- }
- if ((buf[i] == 0x53554245 && buf[i+1] == 0 && buf[i+2] == 0 && buf[i+3] == 0) && EBUS == 0)
- {
- EBUS = addr+4*i;
- }
- if ((buf[i] == 0x00000126) && (buf[i+1] == 0x00000000) && (buf[i+2] == 0x22018230) && (buf[i+3] == 0x09060D30)) //Static data in save files.
- {
- constblock = addr+4*i;
- }
- }
- if (constblock != 0 && EBUS != 0)
- {
- unsigned int diff = constblock-EBUS;
- if (diff == 0x38A0 || diff == 0x383C || diff == 0x3750 || diff == 0x3664 || diff == 0x3608) // ORAS
- {
- offset = constblock+0xFFE8;
- ADJ = 1;
- }
- else if (diff == 0x37DC|| diff == 0x3778 || diff == 0x368C || diff == 0x35A0) //XY
- {
- offset = constblock+0x848;
- ADJ = 2;
- }
- else //wtf
- {
- offset = 0;
- ADJ=0;
- }
- }
- addr += 0x10000;
- }
- if (offset != 0)
- {
- addr = offset;
- GSPGPU_FlushDataCache(addr, 0x10000);
- GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
- GSPGPU_FlushDataCache(buf, 0x10000);
- svcSleepThread(0x400000LL);
- svcSleepThread(0x400000LL);
- IFile_Open(this, L"dmc:/boxdata.bin", 0x1);
- *((int *)this + 1) = 0x00000000; //Fseek to 0
- IFile_Read(this, read_len, (buf+ADJ), 0xE8*30);
- GSPGPU_FlushDataCache(buf, 0x10000);
- GX_SetTextureCopy(buf, addr, 0x10000, 0, 0, 0, 0, 8);
- GSPGPU_FlushDataCache(addr, 0x10000);
- svcSleepThread(0x400000LL);
- IFile_Open(this, L"dmc:/box2dump.bin", 0x6);
- *((int *)this + 1) = 0x00000000; //Fseek to 0
- IFile_Write(this, written, (buf+ADJ+0x3A*30), 0xE8*30);
- svcSleepThread(0x400000LL);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement