也没什么好说的,既然有人不信
我就贴点东西吧
下面是完整的源码:
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <string.h>
/* Define the module info section */
PSP_MODULE_INFO("AKBTP", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
//文件头
typedef struct HEAD {
unsigned int format; //格式标记
unsigned int files1; //文件数量
unsigned int files2; //文件数量
unsigned int datahead; //数据开始位置
unsigned int datalen; //数据大小
} HEAD, *LPHEAD;
//文件信息
typedef struct INFO {
unsigned int unknown; //未知
unsigned int offset; //数据位置
unsigned int length; //数据大小
unsigned int level; //压缩等级 0不压缩
unsigned int name; //名称
unsigned int namelen; //名称长度
} INFO, *LPINFO;
//高度位转换
#define SWAP32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) >> 24) & 0xff))
//解压函数
typedef unsigned int (*sub_0007C7E8)(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3, unsigned int t0);
unsigned char asm_sub_0007C7E8[] = {0x25, 0x20, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xAD, 0x00, 0x00, 0x89, 0x90, 0x21, 0x28, 0x86, 0x00, 0x12, 0x00, 0x29, 0x29, 0x11, 0x00, 0x20, 0x15, 0x25, 0x30, 0xE0, 0x00, 0x00, 0x00, 0x89, 0x90, 0x01, 0x00, 0x8A, 0x24, 0xEF, 0xFF, 0x29, 0x25, 0x04, 0x00, 0x2B, 0x2D, 0xBE, 0x00, 0x60, 0x15, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x00, 0x00, 0xCB, 0xA0, 0x01, 0x00, 0xCB, 0x24, 0x25, 0x20, 0x40, 0x01, 0xFF, 0xFF, 0x29, 0x25, 0xF9, 0xFF, 0x20, 0x15, 0x25, 0x30, 0x60, 0x01, 0x2C, 0x00, 0x00, 0x10, 0x00, 0x00, 0x49, 0x91, 0x00, 0x00, 0x89, 0x90, 0x01, 0x00, 0x8A, 0x24, 0x10, 0x00, 0x2B, 0x2D, 0x40, 0x00, 0x60, 0x11, 0x25, 0x20, 0x40, 0x01, 0x0F, 0x00, 0x20, 0x55, 0x00, 0x00, 0x4A, 0x91, 0x00, 0x00, 0x8B, 0x90, 0x07, 0x00, 0x60, 0x55, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x8B, 0x90, 0xFC, 0xFF, 0x60, 0x11, 0xFF, 0x00, 0x29, 0x25, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x0F, 0x00, 0x6B, 0x25, 0x25, 0x20, 0x40, 0x01, 0x21, 0x48, 0x2B, 0x01, 0x00, 0x00, 0x4A, 0x91, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x8A, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x82, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x8A, 0x24, 0x01, 0x00, 0xCB, 0x24, 0x00, 0x00, 0xC2, 0xA0, 0x25, 0x20, 0x40, 0x01, 0x25, 0x30, 0x60, 0x01, 0x00, 0x00, 0x42, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x00, 0x00, 0x62, 0xA1, 0x01, 0x00, 0xCB, 0x24, 0x25, 0x20, 0x40, 0x01, 0xFF, 0xFF, 0x29, 0x25, 0xF9, 0xFF, 0x20, 0x15, 0x25, 0x30, 0x60, 0x01, 0x00, 0x00, 0x49, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x10, 0x00, 0x22, 0x2D, 0x16, 0x00, 0x40, 0x10, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x4A, 0x91, 0xFF, 0xF7, 0x62, 0x25, 0x82, 0x48, 0x09, 0x00, 0x23, 0x48, 0x49, 0x00, 0x80, 0x50, 0x0A, 0x00, 0x23, 0x48, 0x2A, 0x01, 0x00, 0x00, 0x2A, 0x91, 0x01, 0x00, 0x29, 0x25, 0x00, 0x00, 0x6A, 0xA1, 0x00, 0x00, 0x2A, 0x91, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x29, 0x25, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x29, 0x91, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xC9, 0xA0, 0xFE, 0xFF, 0x89, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x6E, 0x00, 0x00, 0x10, 0x03, 0x00, 0x29, 0x31, 0x40, 0x00, 0x2B, 0x2D, 0x0C, 0x00, 0x60, 0x15, 0x20, 0x00, 0x2B, 0x2D, 0x82, 0x58, 0x09, 0x00, 0x00, 0x00, 0x4A, 0x91, 0xFF, 0xFF, 0xC2, 0x24, 0x07, 0x00, 0x6B, 0x31, 0x23, 0x58, 0x4B, 0x00, 0xC0, 0x50, 0x0A, 0x00, 0x42, 0x49, 0x09, 0x00, 0x01, 0x00, 0x84, 0x24, 0x23, 0x50, 0x6A, 0x01, 0x4C, 0x00, 0x00, 0x10, 0xFF, 0xFF, 0x29, 0x25, 0x1B, 0x00, 0x60, 0x15, 0x10, 0x00, 0x2B, 0x2D, 0x1F, 0x00, 0x29, 0x31, 0x0F, 0x00, 0x20, 0x55, 0x00, 0x00, 0x8B, 0x90, 0x00, 0x00, 0x8B, 0x90, 0x07, 0x00, 0x60, 0x55, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x8B, 0x90, 0xFC, 0xFF, 0x60, 0x11, 0xFF, 0x00, 0x29, 0x25, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x1F, 0x00, 0x6B, 0x25, 0x25, 0x20, 0x40, 0x01, 0x21, 0x48, 0x2B, 0x01, 0x00, 0x00, 0x8B, 0x90, 0x01, 0x00, 0x84, 0x90, 0x25, 0x10, 0x40, 0x01, 0x83, 0x58, 0x0B, 0x00, 0x80, 0x21, 0x04, 0x00, 0xFF, 0xFF, 0xCA, 0x24, 0x21, 0x20, 0x64, 0x01, 0x23, 0x50, 0x44, 0x01, 0x30, 0x00, 0x00, 0x10, 0x02, 0x00, 0x44, 0x24, 0x1D, 0x00, 0x60, 0x15, 0x08, 0x00, 0x2B, 0x31, 0xC0, 0x5A, 0x0B, 0x00, 0x07, 0x00, 0x29, 0x31, 0x0E, 0x00, 0x20, 0x15, 0x23, 0x58, 0xCB, 0x00, 0x00, 0x00, 0x82, 0x90, 0x07, 0x00, 0x40, 0x54, 0x00, 0x00, 0x42, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x82, 0x90, 0xFC, 0xFF, 0x40, 0x10, 0xFF, 0x00, 0x29, 0x25, 0x00, 0x00, 0x42, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x07, 0x00, 0x42, 0x24, 0x25, 0x20, 0x40, 0x01, 0x21, 0x48, 0x22, 0x01, 0x00, 0x00, 0x82, 0x90, 0x01, 0x00, 0x84, 0x90, 0x25, 0x18, 0x40, 0x01, 0x83, 0x50, 0x02, 0x00, 0x80, 0x21, 0x04, 0x00, 0x21, 0x50, 0x44, 0x01, 0x23, 0x50, 0x6A, 0x01, 0x35, 0x00, 0x46, 0x11, 0x02, 0x00, 0x64, 0x24, 0x12, 0x00, 0x00, 0x10, 0x00, 0xC0, 0x4A, 0x25, 0x00, 0x00, 0x4A, 0x91, 0xFF, 0xFF, 0xCB, 0x24, 0x82, 0x48, 0x09, 0x00, 0x23, 0x48, 0x69, 0x01, 0x80, 0x50, 0x0A, 0x00, 0x23, 0x48, 0x2A, 0x01, 0x00, 0x00, 0x2A, 0x91, 0x01, 0x00, 0x29, 0x25, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x29, 0x91, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xC9, 0xA0, 0xFE, 0xFF, 0x89, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x15, 0x00, 0x00, 0x10, 0x03, 0x00, 0x29, 0x31, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x42, 0x25, 0x00, 0x00, 0xCB, 0xA0, 0x00, 0x00, 0x43, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x42, 0x24, 0x01, 0x00, 0xCB, 0x24, 0x00, 0x00, 0xC3, 0xA0, 0x25, 0x50, 0x40, 0x00, 0x25, 0x30, 0x60, 0x01, 0x00, 0x00, 0x43, 0x90, 0x01, 0x00, 0x42, 0x25, 0x00, 0x00, 0x63, 0xA1, 0x01, 0x00, 0xCB, 0x24, 0x25, 0x50, 0x40, 0x00, 0xFF, 0xFF, 0x29, 0x25, 0xF9, 0xFF, 0x20, 0x15, 0x25, 0x30, 0x60, 0x01, 0xFE, 0xFF, 0x89, 0x90, 0x03, 0x00, 0x29, 0x31, 0x4F, 0xFF, 0x20, 0x51, 0x00, 0x00, 0x89, 0x90, 0x00, 0x00, 0x8B, 0x90, 0x01, 0x00, 0x8A, 0x24, 0x00, 0x00, 0xCB, 0xA0, 0x25, 0x20, 0x40, 0x01, 0xFF, 0xFF, 0x29, 0x25, 0xFA, 0xFF, 0x20, 0x15, 0x01, 0x00, 0xC6, 0x24, 0x00, 0x00, 0x49, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x87, 0xFF, 0x00, 0x10, 0x25, 0x20, 0x40, 0x01, 0x23, 0x30, 0xC7, 0x00, 0x00, 0x00, 0x06, 0xAD, 0x05, 0x00, 0x85, 0x10, 0x00, 0x00, 0x02, 0x34, 0xFC, 0xFF, 0x02, 0x24, 0x2B, 0x20, 0x85, 0x00, 0x01, 0x00, 0x80, 0x54, 0xF8, 0xFF, 0x02, 0x24, 0x08, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, };
typedef unsigned int (*sub_0007C65C)(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3);
unsigned char asm_sub_0007C65C[] = {0xE0, 0xEF, 0xBD, 0x27, 0x25, 0x40, 0x80, 0x00, 0x00, 0x00, 0x0A, 0x34, 0x00, 0x00, 0x09, 0x34, 0x00, 0x00, 0x0B, 0x34, 0x01, 0x00, 0x04, 0x34, 0x21, 0x10, 0xAB, 0x03, 0x01, 0x00, 0x6B, 0x25, 0x00, 0x00, 0x40, 0xA0, 0xEE, 0x0F, 0x62, 0x29, 0xFC, 0xFF, 0x40, 0x14, 0x21, 0x10, 0xAB, 0x03, 0xEE, 0x0F, 0x02, 0x34, 0x00, 0x00, 0x0B, 0x34, 0x00, 0x01, 0x63, 0x31, 0x09, 0x00, 0x60, 0x14, 0x01, 0x00, 0x63, 0x31, 0x21, 0x58, 0x0A, 0x01, 0x25, 0x50, 0x80, 0x00, 0x00, 0x00, 0x64, 0x91, 0x2B, 0x58, 0xAA, 0x00, 0x38, 0x00, 0x60, 0x15, 0x00, 0xFF, 0x8B, 0x34, 0x01, 0x00, 0x44, 0x25, 0x01, 0x00, 0x63, 0x31, 0x11, 0x00, 0x60, 0x10, 0x21, 0x18, 0x0A, 0x01, 0x21, 0x50, 0x0A, 0x01, 0x00, 0x00, 0x43, 0x91, 0x25, 0x50, 0x80, 0x00, 0x25, 0x20, 0x60, 0x00, 0x2B, 0x18, 0xAA, 0x00, 0x2D, 0x00, 0x60, 0x14, 0x21, 0x18, 0xC9, 0x00, 0x00, 0x00, 0x64, 0xA0, 0x21, 0x18, 0xA2, 0x03, 0x01, 0x00, 0x42, 0x24, 0x00, 0x00, 0x64, 0xA0, 0x01, 0x00, 0x29, 0x25, 0xFF, 0x0F, 0x42, 0x30, 0x42, 0x58, 0x0B, 0x00, 0xE4, 0xFF, 0x00, 0x10, 0x01, 0x00, 0x44, 0x25, 0x25, 0x50, 0x80, 0x00, 0x2B, 0x60, 0xAA, 0x00, 0x20, 0x00, 0x80, 0x15, 0x00, 0x00, 0x63, 0x90, 0x21, 0x20, 0x04, 0x01, 0x01, 0x00, 0x4A, 0x25, 0x2B, 0x60, 0xAA, 0x00, 0x1B, 0x00, 0x80, 0x15, 0x00, 0x00, 0x84, 0x90, 0xF0, 0x00, 0x8C, 0x30, 0x00, 0x69, 0x0C, 0x00, 0x0F, 0x00, 0x8C, 0x30, 0x25, 0x68, 0x6D, 0x00, 0x02, 0x00, 0x8C, 0x25, 0x00, 0x00, 0x03, 0x34, 0x00, 0x00, 0x8E, 0x29, 0x42, 0x58, 0x0B, 0x00, 0xD1, 0xFF, 0xC0, 0x15, 0x01, 0x00, 0x44, 0x25, 0x21, 0x70, 0xA3, 0x01, 0xFF, 0x0F, 0xCE, 0x31, 0x21, 0x70, 0xAE, 0x03, 0x00, 0x00, 0xCE, 0x91, 0x21, 0x78, 0xC9, 0x00, 0x00, 0x00, 0xEE, 0xA1, 0x21, 0x78, 0xA2, 0x03, 0x01, 0x00, 0x42, 0x24, 0x00, 0x00, 0xEE, 0xA1, 0x01, 0x00, 0x63, 0x24, 0x01, 0x00, 0x29, 0x25, 0x2A, 0x70, 0x83, 0x01, 0xF3, 0xFF, 0xC0, 0x11, 0xFF, 0x0F, 0x42, 0x30, 0xC2, 0xFF, 0x00, 0x10, 0x00, 0x01, 0x63, 0x31, 0x00, 0x00, 0xE9, 0xAC, 0x08, 0x00, 0xE0, 0x03, 0x20, 0x10, 0xBD, 0x27, };
int main(void)
{
pspDebugScreenInit();
void * lptmp = malloc(1024*1024*8);
SceUID file = sceIoOpen("DATA.DAT", PSP_O_RDONLY, 0777);
if(file >= 0)
{
printf("start...\n");
HEAD head;
sceIoRead(file, &head, sizeof(HEAD));
head.files1 = SWAP32(head.files1);
head.files2 = SWAP32(head.files2);
head.datahead = SWAP32(head.datahead);
head.datalen = SWAP32(head.datalen);
printf("files: %d\n", head.files1);
unsigned int i;
for(i = 0; i < head.files1; i++)
{
INFO info;
sceIoLseek(file, sizeof(HEAD) + i * sizeof(INFO), PSP_SEEK_SET);
sceIoRead(file, &info, sizeof(INFO));
info.offset = SWAP32(info.offset);
info.length = SWAP32(info.length);
info.level = SWAP32(info.level);
info.name = SWAP32(info.name);
info.namelen = SWAP32(info.namelen);
void * lpdata = malloc(info.length);
void * lpname = malloc(info.namelen);
sceIoLseek(file, head.datahead + info.offset, PSP_SEEK_SET);
sceIoRead(file, lpdata, info.length);
sceIoLseek(file, head.datahead + info.name, PSP_SEEK_SET);
sceIoRead(file, lpname, info.namelen);
char * pname = lpname;
while(1)
{
pname = strchr(pname, '\\');
if(!pname) break; *pname++ = '/';
}
printf(lpname); printf("\n");
char dir[260]; memset(dir, 0, 260);
char tmp[260]; memcpy(tmp, lpname, info.namelen);
char * start = tmp; char * end = 0;
while(1)
{
end = strchr(start, '/');
if(!end) break; *end++ = 0;
strcat(dir, start);
sceIoMkdir(dir, 0777);
strcat(dir, "/");
start = end;
}
if(info.level < 2)
{
SceUID wfile = sceIoOpen(lpname, PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
sceIoWrite(wfile, lpdata, info.length);
sceIoClose(wfile);
}
else if(info.level < 4)
{
unsigned int slen = 0;
((sub_0007C7E8)&asm_sub_0007C7E8)(0, (unsigned int)lpdata, (unsigned int)info.length, (unsigned int)lptmp, (unsigned int)&slen);
SceUID wfile = sceIoOpen(lpname, PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
sceIoWrite(wfile, lptmp, slen);
sceIoClose(wfile);
}
else
{
unsigned int slen = 0;
((sub_0007C65C)&asm_sub_0007C65C)((unsigned int)lpdata, (unsigned int)info.length, (unsigned int)lptmp, (unsigned int)&slen);
SceUID wfile = sceIoOpen(lpname, PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
sceIoWrite(wfile, lptmp, slen);
sceIoClose(wfile);
}
free(lpname);
free(lpdata);
}
sceIoClose(file);
printf("ok!\n");
}
free(lptmp);
sceKernelExitGame();
return 0;
}
我就贴点东西吧
下面是完整的源码:
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <string.h>
/* Define the module info section */
PSP_MODULE_INFO("AKBTP", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
//文件头
typedef struct HEAD {
unsigned int format; //格式标记
unsigned int files1; //文件数量
unsigned int files2; //文件数量
unsigned int datahead; //数据开始位置
unsigned int datalen; //数据大小
} HEAD, *LPHEAD;
//文件信息
typedef struct INFO {
unsigned int unknown; //未知
unsigned int offset; //数据位置
unsigned int length; //数据大小
unsigned int level; //压缩等级 0不压缩
unsigned int name; //名称
unsigned int namelen; //名称长度
} INFO, *LPINFO;
//高度位转换
#define SWAP32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) >> 24) & 0xff))
//解压函数
typedef unsigned int (*sub_0007C7E8)(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3, unsigned int t0);
unsigned char asm_sub_0007C7E8[] = {0x25, 0x20, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xAD, 0x00, 0x00, 0x89, 0x90, 0x21, 0x28, 0x86, 0x00, 0x12, 0x00, 0x29, 0x29, 0x11, 0x00, 0x20, 0x15, 0x25, 0x30, 0xE0, 0x00, 0x00, 0x00, 0x89, 0x90, 0x01, 0x00, 0x8A, 0x24, 0xEF, 0xFF, 0x29, 0x25, 0x04, 0x00, 0x2B, 0x2D, 0xBE, 0x00, 0x60, 0x15, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x00, 0x00, 0xCB, 0xA0, 0x01, 0x00, 0xCB, 0x24, 0x25, 0x20, 0x40, 0x01, 0xFF, 0xFF, 0x29, 0x25, 0xF9, 0xFF, 0x20, 0x15, 0x25, 0x30, 0x60, 0x01, 0x2C, 0x00, 0x00, 0x10, 0x00, 0x00, 0x49, 0x91, 0x00, 0x00, 0x89, 0x90, 0x01, 0x00, 0x8A, 0x24, 0x10, 0x00, 0x2B, 0x2D, 0x40, 0x00, 0x60, 0x11, 0x25, 0x20, 0x40, 0x01, 0x0F, 0x00, 0x20, 0x55, 0x00, 0x00, 0x4A, 0x91, 0x00, 0x00, 0x8B, 0x90, 0x07, 0x00, 0x60, 0x55, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x8B, 0x90, 0xFC, 0xFF, 0x60, 0x11, 0xFF, 0x00, 0x29, 0x25, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x0F, 0x00, 0x6B, 0x25, 0x25, 0x20, 0x40, 0x01, 0x21, 0x48, 0x2B, 0x01, 0x00, 0x00, 0x4A, 0x91, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x8A, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x82, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x8A, 0x24, 0x01, 0x00, 0xCB, 0x24, 0x00, 0x00, 0xC2, 0xA0, 0x25, 0x20, 0x40, 0x01, 0x25, 0x30, 0x60, 0x01, 0x00, 0x00, 0x42, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x00, 0x00, 0x62, 0xA1, 0x01, 0x00, 0xCB, 0x24, 0x25, 0x20, 0x40, 0x01, 0xFF, 0xFF, 0x29, 0x25, 0xF9, 0xFF, 0x20, 0x15, 0x25, 0x30, 0x60, 0x01, 0x00, 0x00, 0x49, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x10, 0x00, 0x22, 0x2D, 0x16, 0x00, 0x40, 0x10, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x4A, 0x91, 0xFF, 0xF7, 0x62, 0x25, 0x82, 0x48, 0x09, 0x00, 0x23, 0x48, 0x49, 0x00, 0x80, 0x50, 0x0A, 0x00, 0x23, 0x48, 0x2A, 0x01, 0x00, 0x00, 0x2A, 0x91, 0x01, 0x00, 0x29, 0x25, 0x00, 0x00, 0x6A, 0xA1, 0x00, 0x00, 0x2A, 0x91, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x29, 0x25, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x29, 0x91, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xC9, 0xA0, 0xFE, 0xFF, 0x89, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x6E, 0x00, 0x00, 0x10, 0x03, 0x00, 0x29, 0x31, 0x40, 0x00, 0x2B, 0x2D, 0x0C, 0x00, 0x60, 0x15, 0x20, 0x00, 0x2B, 0x2D, 0x82, 0x58, 0x09, 0x00, 0x00, 0x00, 0x4A, 0x91, 0xFF, 0xFF, 0xC2, 0x24, 0x07, 0x00, 0x6B, 0x31, 0x23, 0x58, 0x4B, 0x00, 0xC0, 0x50, 0x0A, 0x00, 0x42, 0x49, 0x09, 0x00, 0x01, 0x00, 0x84, 0x24, 0x23, 0x50, 0x6A, 0x01, 0x4C, 0x00, 0x00, 0x10, 0xFF, 0xFF, 0x29, 0x25, 0x1B, 0x00, 0x60, 0x15, 0x10, 0x00, 0x2B, 0x2D, 0x1F, 0x00, 0x29, 0x31, 0x0F, 0x00, 0x20, 0x55, 0x00, 0x00, 0x8B, 0x90, 0x00, 0x00, 0x8B, 0x90, 0x07, 0x00, 0x60, 0x55, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x8B, 0x90, 0xFC, 0xFF, 0x60, 0x11, 0xFF, 0x00, 0x29, 0x25, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x1F, 0x00, 0x6B, 0x25, 0x25, 0x20, 0x40, 0x01, 0x21, 0x48, 0x2B, 0x01, 0x00, 0x00, 0x8B, 0x90, 0x01, 0x00, 0x84, 0x90, 0x25, 0x10, 0x40, 0x01, 0x83, 0x58, 0x0B, 0x00, 0x80, 0x21, 0x04, 0x00, 0xFF, 0xFF, 0xCA, 0x24, 0x21, 0x20, 0x64, 0x01, 0x23, 0x50, 0x44, 0x01, 0x30, 0x00, 0x00, 0x10, 0x02, 0x00, 0x44, 0x24, 0x1D, 0x00, 0x60, 0x15, 0x08, 0x00, 0x2B, 0x31, 0xC0, 0x5A, 0x0B, 0x00, 0x07, 0x00, 0x29, 0x31, 0x0E, 0x00, 0x20, 0x15, 0x23, 0x58, 0xCB, 0x00, 0x00, 0x00, 0x82, 0x90, 0x07, 0x00, 0x40, 0x54, 0x00, 0x00, 0x42, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x25, 0x20, 0x40, 0x01, 0x00, 0x00, 0x82, 0x90, 0xFC, 0xFF, 0x40, 0x10, 0xFF, 0x00, 0x29, 0x25, 0x00, 0x00, 0x42, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x07, 0x00, 0x42, 0x24, 0x25, 0x20, 0x40, 0x01, 0x21, 0x48, 0x22, 0x01, 0x00, 0x00, 0x82, 0x90, 0x01, 0x00, 0x84, 0x90, 0x25, 0x18, 0x40, 0x01, 0x83, 0x50, 0x02, 0x00, 0x80, 0x21, 0x04, 0x00, 0x21, 0x50, 0x44, 0x01, 0x23, 0x50, 0x6A, 0x01, 0x35, 0x00, 0x46, 0x11, 0x02, 0x00, 0x64, 0x24, 0x12, 0x00, 0x00, 0x10, 0x00, 0xC0, 0x4A, 0x25, 0x00, 0x00, 0x4A, 0x91, 0xFF, 0xFF, 0xCB, 0x24, 0x82, 0x48, 0x09, 0x00, 0x23, 0x48, 0x69, 0x01, 0x80, 0x50, 0x0A, 0x00, 0x23, 0x48, 0x2A, 0x01, 0x00, 0x00, 0x2A, 0x91, 0x01, 0x00, 0x29, 0x25, 0x00, 0x00, 0xCA, 0xA0, 0x00, 0x00, 0x29, 0x91, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x84, 0x24, 0x00, 0x00, 0xC9, 0xA0, 0xFE, 0xFF, 0x89, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x15, 0x00, 0x00, 0x10, 0x03, 0x00, 0x29, 0x31, 0x00, 0x00, 0x4B, 0x91, 0x01, 0x00, 0x42, 0x25, 0x00, 0x00, 0xCB, 0xA0, 0x00, 0x00, 0x43, 0x90, 0x01, 0x00, 0xC6, 0x24, 0x01, 0x00, 0x42, 0x24, 0x01, 0x00, 0xCB, 0x24, 0x00, 0x00, 0xC3, 0xA0, 0x25, 0x50, 0x40, 0x00, 0x25, 0x30, 0x60, 0x01, 0x00, 0x00, 0x43, 0x90, 0x01, 0x00, 0x42, 0x25, 0x00, 0x00, 0x63, 0xA1, 0x01, 0x00, 0xCB, 0x24, 0x25, 0x50, 0x40, 0x00, 0xFF, 0xFF, 0x29, 0x25, 0xF9, 0xFF, 0x20, 0x15, 0x25, 0x30, 0x60, 0x01, 0xFE, 0xFF, 0x89, 0x90, 0x03, 0x00, 0x29, 0x31, 0x4F, 0xFF, 0x20, 0x51, 0x00, 0x00, 0x89, 0x90, 0x00, 0x00, 0x8B, 0x90, 0x01, 0x00, 0x8A, 0x24, 0x00, 0x00, 0xCB, 0xA0, 0x25, 0x20, 0x40, 0x01, 0xFF, 0xFF, 0x29, 0x25, 0xFA, 0xFF, 0x20, 0x15, 0x01, 0x00, 0xC6, 0x24, 0x00, 0x00, 0x49, 0x91, 0x01, 0x00, 0x8A, 0x24, 0x87, 0xFF, 0x00, 0x10, 0x25, 0x20, 0x40, 0x01, 0x23, 0x30, 0xC7, 0x00, 0x00, 0x00, 0x06, 0xAD, 0x05, 0x00, 0x85, 0x10, 0x00, 0x00, 0x02, 0x34, 0xFC, 0xFF, 0x02, 0x24, 0x2B, 0x20, 0x85, 0x00, 0x01, 0x00, 0x80, 0x54, 0xF8, 0xFF, 0x02, 0x24, 0x08, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, };
typedef unsigned int (*sub_0007C65C)(unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3);
unsigned char asm_sub_0007C65C[] = {0xE0, 0xEF, 0xBD, 0x27, 0x25, 0x40, 0x80, 0x00, 0x00, 0x00, 0x0A, 0x34, 0x00, 0x00, 0x09, 0x34, 0x00, 0x00, 0x0B, 0x34, 0x01, 0x00, 0x04, 0x34, 0x21, 0x10, 0xAB, 0x03, 0x01, 0x00, 0x6B, 0x25, 0x00, 0x00, 0x40, 0xA0, 0xEE, 0x0F, 0x62, 0x29, 0xFC, 0xFF, 0x40, 0x14, 0x21, 0x10, 0xAB, 0x03, 0xEE, 0x0F, 0x02, 0x34, 0x00, 0x00, 0x0B, 0x34, 0x00, 0x01, 0x63, 0x31, 0x09, 0x00, 0x60, 0x14, 0x01, 0x00, 0x63, 0x31, 0x21, 0x58, 0x0A, 0x01, 0x25, 0x50, 0x80, 0x00, 0x00, 0x00, 0x64, 0x91, 0x2B, 0x58, 0xAA, 0x00, 0x38, 0x00, 0x60, 0x15, 0x00, 0xFF, 0x8B, 0x34, 0x01, 0x00, 0x44, 0x25, 0x01, 0x00, 0x63, 0x31, 0x11, 0x00, 0x60, 0x10, 0x21, 0x18, 0x0A, 0x01, 0x21, 0x50, 0x0A, 0x01, 0x00, 0x00, 0x43, 0x91, 0x25, 0x50, 0x80, 0x00, 0x25, 0x20, 0x60, 0x00, 0x2B, 0x18, 0xAA, 0x00, 0x2D, 0x00, 0x60, 0x14, 0x21, 0x18, 0xC9, 0x00, 0x00, 0x00, 0x64, 0xA0, 0x21, 0x18, 0xA2, 0x03, 0x01, 0x00, 0x42, 0x24, 0x00, 0x00, 0x64, 0xA0, 0x01, 0x00, 0x29, 0x25, 0xFF, 0x0F, 0x42, 0x30, 0x42, 0x58, 0x0B, 0x00, 0xE4, 0xFF, 0x00, 0x10, 0x01, 0x00, 0x44, 0x25, 0x25, 0x50, 0x80, 0x00, 0x2B, 0x60, 0xAA, 0x00, 0x20, 0x00, 0x80, 0x15, 0x00, 0x00, 0x63, 0x90, 0x21, 0x20, 0x04, 0x01, 0x01, 0x00, 0x4A, 0x25, 0x2B, 0x60, 0xAA, 0x00, 0x1B, 0x00, 0x80, 0x15, 0x00, 0x00, 0x84, 0x90, 0xF0, 0x00, 0x8C, 0x30, 0x00, 0x69, 0x0C, 0x00, 0x0F, 0x00, 0x8C, 0x30, 0x25, 0x68, 0x6D, 0x00, 0x02, 0x00, 0x8C, 0x25, 0x00, 0x00, 0x03, 0x34, 0x00, 0x00, 0x8E, 0x29, 0x42, 0x58, 0x0B, 0x00, 0xD1, 0xFF, 0xC0, 0x15, 0x01, 0x00, 0x44, 0x25, 0x21, 0x70, 0xA3, 0x01, 0xFF, 0x0F, 0xCE, 0x31, 0x21, 0x70, 0xAE, 0x03, 0x00, 0x00, 0xCE, 0x91, 0x21, 0x78, 0xC9, 0x00, 0x00, 0x00, 0xEE, 0xA1, 0x21, 0x78, 0xA2, 0x03, 0x01, 0x00, 0x42, 0x24, 0x00, 0x00, 0xEE, 0xA1, 0x01, 0x00, 0x63, 0x24, 0x01, 0x00, 0x29, 0x25, 0x2A, 0x70, 0x83, 0x01, 0xF3, 0xFF, 0xC0, 0x11, 0xFF, 0x0F, 0x42, 0x30, 0xC2, 0xFF, 0x00, 0x10, 0x00, 0x01, 0x63, 0x31, 0x00, 0x00, 0xE9, 0xAC, 0x08, 0x00, 0xE0, 0x03, 0x20, 0x10, 0xBD, 0x27, };
int main(void)
{
pspDebugScreenInit();
void * lptmp = malloc(1024*1024*8);
SceUID file = sceIoOpen("DATA.DAT", PSP_O_RDONLY, 0777);
if(file >= 0)
{
printf("start...\n");
HEAD head;
sceIoRead(file, &head, sizeof(HEAD));
head.files1 = SWAP32(head.files1);
head.files2 = SWAP32(head.files2);
head.datahead = SWAP32(head.datahead);
head.datalen = SWAP32(head.datalen);
printf("files: %d\n", head.files1);
unsigned int i;
for(i = 0; i < head.files1; i++)
{
INFO info;
sceIoLseek(file, sizeof(HEAD) + i * sizeof(INFO), PSP_SEEK_SET);
sceIoRead(file, &info, sizeof(INFO));
info.offset = SWAP32(info.offset);
info.length = SWAP32(info.length);
info.level = SWAP32(info.level);
info.name = SWAP32(info.name);
info.namelen = SWAP32(info.namelen);
void * lpdata = malloc(info.length);
void * lpname = malloc(info.namelen);
sceIoLseek(file, head.datahead + info.offset, PSP_SEEK_SET);
sceIoRead(file, lpdata, info.length);
sceIoLseek(file, head.datahead + info.name, PSP_SEEK_SET);
sceIoRead(file, lpname, info.namelen);
char * pname = lpname;
while(1)
{
pname = strchr(pname, '\\');
if(!pname) break; *pname++ = '/';
}
printf(lpname); printf("\n");
char dir[260]; memset(dir, 0, 260);
char tmp[260]; memcpy(tmp, lpname, info.namelen);
char * start = tmp; char * end = 0;
while(1)
{
end = strchr(start, '/');
if(!end) break; *end++ = 0;
strcat(dir, start);
sceIoMkdir(dir, 0777);
strcat(dir, "/");
start = end;
}
if(info.level < 2)
{
SceUID wfile = sceIoOpen(lpname, PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
sceIoWrite(wfile, lpdata, info.length);
sceIoClose(wfile);
}
else if(info.level < 4)
{
unsigned int slen = 0;
((sub_0007C7E8)&asm_sub_0007C7E8)(0, (unsigned int)lpdata, (unsigned int)info.length, (unsigned int)lptmp, (unsigned int)&slen);
SceUID wfile = sceIoOpen(lpname, PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
sceIoWrite(wfile, lptmp, slen);
sceIoClose(wfile);
}
else
{
unsigned int slen = 0;
((sub_0007C65C)&asm_sub_0007C65C)((unsigned int)lpdata, (unsigned int)info.length, (unsigned int)lptmp, (unsigned int)&slen);
SceUID wfile = sceIoOpen(lpname, PSP_O_APPEND | PSP_O_CREAT | PSP_O_WRONLY, 0777);
sceIoWrite(wfile, lptmp, slen);
sceIoClose(wfile);
}
free(lpname);
free(lpdata);
}
sceIoClose(file);
printf("ok!\n");
}
free(lptmp);
sceKernelExitGame();
return 0;
}