📄 main.cod
字号:
; 1177 : }
; 1178 : TOCoffset = (*(UINT32 *)(&SectorData[ROM_TOC_OFFSET_OFFSET]));
; 1179 :
; 1180 : // Move the file pointer to the correct offset.
; 1181 : //
; 1182 : if (!BP_SetDataPointer(hPartition, TOCoffset))
00064 e59d1048 ldr r1, [sp, #0x48]
00068 e1a00004 mov r0, r4
0006c eb000000 bl BP_SetDataPointer
00070 e3500000 cmp r0, #0
; 1183 : {
; 1184 : return(FALSE);
00074 0a00000e beq |$L44674|
; 1185 : }
; 1186 :
; 1187 : // Read the table of contents.
; 1188 : //
; 1189 : if (!BP_ReadData(hPartition, (BYTE *)pTOC, sizeof(ROMHDR)))
00078 e3a02054 mov r2, #0x54
0007c e1a01005 mov r1, r5
00080 e1a00004 mov r0, r4
00084 eb000000 bl BP_ReadData
00088 e3500000 cmp r0, #0
; 1190 : {
; 1191 : return(FALSE);
0008c 0a000008 beq |$L44674|
; 1192 : }
; 1193 :
; 1194 : // Restore the file pointer to the start of the partition.
; 1195 : //
; 1196 : if (!BP_SetDataPointer(hPartition, 0))
00090 e3a01000 mov r1, #0
00094 e1a00004 mov r0, r4
00098 eb000000 bl BP_SetDataPointer
0009c e3500000 cmp r0, #0
; 1197 : {
; 1198 : return(FALSE);
000a0 e59d004c ldr r0, [sp, #0x4C]
000a4 0a000003 beq |$L45261|
; 1199 : }
; 1200 :
; 1201 : return(TRUE);
000a8 eb000000 bl __security_check_cookie
000ac e3a00001 mov r0, #1
000b0 ea000002 b |$L44667|
000b4 |$L44674|
; 1154 : {
; 1155 : return(FALSE);
000b4 e59d004c ldr r0, [sp, #0x4C]
000b8 |$L45261|
000b8 eb000000 bl __security_check_cookie
000bc e3a00000 mov r0, #0
000c0 |$L44667|
; 1202 :
; 1203 : }
000c0 e28dd050 add sp, sp, #0x50
000c4 e8bd4030 ldmia sp!, {r4, r5, lr}
000c8 e12fff1e bx lr
000cc |$L45267|
000cc 43454345 DCD 0x43454345
000d0 00000000 DCD |__security_cookie|
000d4 |$M45263|
ENDP ; |ReadTOC|
EXPORT |CopyToRAM|
EXPORT |??_C@_0DE@KEKIKBNP@g_CompressionHeader?9?$DOdwCompresse@| [ DATA ] ; `string'
EXPORT |??_C@_01LFCBOECM@?4?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0CC@PBGMLNAG@simply?5copy?5the?5data?5to?5RAM?5?$CFd?4?$AN@| [ DATA ] ; `string'
IMPORT |__rt_udiv|
00000 AREA |.text| { |CopyToRAM| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$CopyToRAM|, PDATA, SELECTION=5, ASSOC=|.text| { |CopyToRAM| } ; comdat associative
|$T45286| DCD |$L45285|
DCD 0x40006302
00000 AREA |.rdata| { |??_C@_0CC@PBGMLNAG@simply?5copy?5the?5data?5to?5RAM?5?$CFd?4?$AN@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CC@PBGMLNAG@simply?5copy?5the?5data?5to?5RAM?5?$CFd?4?$AN@| DCB "s"
DCB "imply copy the data to RAM %d.", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_01LFCBOECM@?4?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_01LFCBOECM@?4?$AA@| DCB ".", 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DE@KEKIKBNP@g_CompressionHeader?9?$DOdwCompresse@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DE@KEKIKBNP@g_CompressionHeader?9?$DOdwCompresse@| DCB "g_Compres"
DCB "sionHeader->dwCompressedBlockCount = %x.", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |CopyToRAM| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |CopyToRAM| PROC
; 1206 : {
00000 |$L45285|
00000 e92d4ff0 stmdb sp!, {r4 - r11, lr}
00004 e24dd064 sub sp, sp, #0x64
00008 |$M45283|
00008 e1a07001 mov r7, r1
0000c e1a06000 mov r6, r0
; 1207 : ROMHDR TOC;
; 1208 : PWORD pwCompBlockSize = NULL;
; 1209 : DWORD dwBytesRead = 0, dwCurRAMLoc = 0, i;
; 1210 :
; 1211 : if (g_fCompressed)
00010 e59f5170 ldr r5, [pc, #0x170]
00014 e5953000 ldr r3, [r5]
00018 e3530000 cmp r3, #0
0001c 0a000041 beq |$L44698|
; 1212 : {
; 1213 : // set the data pointer to the first byte after the compressed header
; 1214 : if (!BP_SetDataPointer(hPartition, g_CompressionHeader->dwHeaderSize))
00020 e5953008 ldr r3, [r5, #8]
00024 e5931034 ldr r1, [r3, #0x34]
00028 eb000000 bl BP_SetDataPointer
0002c e3500000 cmp r0, #0
; 1215 : {
; 1216 : return(FALSE);
00030 0a00004d beq |$L45282|
; 1217 : }
; 1218 :
; 1219 : // point our block size pointer to the first entry in the table
; 1220 : pwCompBlockSize = &g_CompressionHeader->wBlockSizeTable[0];
00034 e5953008 ldr r3, [r5, #8]
; 1221 :
; 1222 : // start at the beginning of RAM
; 1223 : dwCurRAMLoc = dwPartitionBase;
; 1224 :
; 1225 : // iterate through all compressed blocks, decompressing straight into RAM
; 1226 : EdbgOutputDebugString("g_CompressionHeader->dwCompressedBlockCount = %x.\r\n", g_CompressionHeader->dwCompressedBlockCount);
00038 e59f0144 ldr r0, [pc, #0x144]
0003c e5931038 ldr r1, [r3, #0x38]
00040 e2838044 add r8, r3, #0x44
00044 eb000000 bl EdbgOutputDebugString
; 1227 : for (i = 0; i < g_CompressionHeader->dwCompressedBlockCount; i++)
00048 e5959008 ldr r9, [r5, #8]
0004c e3a03000 mov r3, #0
00050 e58d3008 str r3, [sp, #8]
00054 e5993038 ldr r3, [r9, #0x38]
00058 e3530000 cmp r3, #0
0005c 9a00002b bls |$L44703|
00060 e59fa118 ldr r10, [pc, #0x118]
00064 e3a0b000 mov r11, #0
00068 |$L44701|
; 1228 : {
; 1229 : if((i * 10 / g_CompressionHeader->dwCompressedBlockCount) != ((i + 1) * 10 / g_CompressionHeader->dwCompressedBlockCount))
00068 e5990038 ldr r0, [r9, #0x38]
0006c e28b100a add r1, r11, #0xA
00070 eb000000 bl __rt_udiv
00074 e1a04000 mov r4, r0
00078 e5990038 ldr r0, [r9, #0x38]
0007c e1a0100b mov r1, r11
00080 eb000000 bl __rt_udiv
00084 e1540000 cmp r4, r0
; 1230 : EdbgOutputDebugString(".");
00088 159f00ec ldrne r0, [pc, #0xEC]
0008c 1b000000 blne EdbgOutputDebugString
; 1231 :
; 1232 : // EdbgOutputDebugString("%d: BP_ReadData(%d).\r\n", i, *pwCompBlockSize);
; 1233 : // read the compressed data into our temporary buffer
; 1234 : if (!BP_ReadData(hPartition, CompressedData, *pwCompBlockSize))
00090 e1d820b0 ldrh r2, [r8]
00094 e1a0100a mov r1, r10
00098 e1a00006 mov r0, r6
0009c eb000000 bl BP_ReadData
000a0 e3500000 cmp r0, #0
000a4 0a000030 beq |$L45282|
; 1235 : {
; 1236 : return(FALSE);
; 1237 : }
; 1238 :
; 1239 : // determine if decompression is necessary
; 1240 : if (*pwCompBlockSize == RAMIMAGE_COMPRESSION_BLOCK_SIZE)
000a8 e1d8e0b0 ldrh lr, [r8]
; 1241 : {
; 1242 : // just do a memcpy
; 1243 : memcpy((LPVOID) dwCurRAMLoc, CompressedData, RAMIMAGE_COMPRESSION_BLOCK_SIZE);
000ac e3a02a01 mov r2, #1, 20
000b0 e35e0a01 cmp lr, #1, 20
000b4 1a000003 bne |$L44707|
000b8 e1a0100a mov r1, r10
000bc e1a00007 mov r0, r7
000c0 eb000000 bl memcpy
; 1244 : }
; 1245 : else
000c4 ea000007 b |$L44711|
000c8 |$L44707|
; 1246 : {
; 1247 : // decompress the data to RAM
; 1248 : dwBytesRead = CeCompressDecode(g_DecodeStream, (LPVOID) dwCurRAMLoc, RAMIMAGE_COMPRESSION_BLOCK_SIZE, RAMIMAGE_COMPRESSION_BLOCK_SIZE, CompressedData, *pwCompBlockSize);
000c8 e5950004 ldr r0, [r5, #4]
000cc e3a03a01 mov r3, #1, 20
000d0 e1a01007 mov r1, r7
000d4 e58de004 str lr, [sp, #4]
000d8 e58da000 str r10, [sp]
000dc eb000000 bl CeCompressDecode
; 1249 : if (dwBytesRead != RAMIMAGE_COMPRESSION_BLOCK_SIZE)
000e0 e3500a01 cmp r0, #1, 20
000e4 1a000020 bne |$L45282|
000e8 |$L44711|
; 1227 : for (i = 0; i < g_CompressionHeader->dwCompressedBlockCount; i++)
000e8 e5959008 ldr r9, [r5, #8]
000ec e59d2008 ldr r2, [sp, #8]
; 1250 : {
; 1251 : return(FALSE);
; 1252 : }
; 1253 : }
; 1254 :
; 1255 : // increment current RAM location and block number
; 1256 : ++pwCompBlockSize;
000f0 e2888002 add r8, r8, #2
000f4 e5993038 ldr r3, [r9, #0x38]
000f8 e2822001 add r2, r2, #1
000fc e58d2008 str r2, [sp, #8]
; 1257 : dwCurRAMLoc += RAMIMAGE_COMPRESSION_BLOCK_SIZE;
00100 e1520003 cmp r2, r3
00104 e2877a01 add r7, r7, #1, 20
00108 e28bb00a add r11, r11, #0xA
0010c 3affffd5 bcc |$L44701|
00110 |$L44703|
; 1258 : }
; 1259 : EdbgOutputDebugString("\r\n");
00110 e59f0060 ldr r0, [pc, #0x60]
00114 eb000000 bl EdbgOutputDebugString
00118 |$L44716|
; 1275 : }
; 1276 : }
; 1277 :
; 1278 : return(TRUE);
00118 e3a00001 mov r0, #1
0011c |$L44691|
; 1279 : }
0011c e28dd064 add sp, sp, #0x64
00120 e8bd4ff0 ldmia sp!, {r4 - r11, lr}
00124 e12fff1e bx lr
00128 |$L44698|
; 1260 : }
; 1261 : else
; 1262 : {
; 1263 : // if the partition is not compressed, we need to read the TOC
; 1264 : // to figure out how much we need to copy to RAM
; 1265 : if (!ReadTOC(hPartition, &TOC))
00128 e28d1010 add r1, sp, #0x10
0012c eb000000 bl ReadTOC
00130 e3500000 cmp r0, #0
; 1266 : {
; 1267 : return(FALSE);
00134 0a00000c beq |$L45282|
; 1268 : }
; 1269 :
; 1270 : // simply copy the data to RAM
; 1271 : EdbgOutputDebugString("simply copy the data to RAM %d.\r\n", (TOC.physlast - TOC.physfirst));
00138 e59d201c ldr r2, [sp, #0x1C]
0013c e59d3018 ldr r3, [sp, #0x18]
00140 e59f002c ldr r0, [pc, #0x2C]
00144 e0421003 sub r1, r2, r3
00148 eb000000 bl EdbgOutputDebugString
; 1272 : if (!BP_ReadData(hPartition, (LPBYTE) dwPartitionBase, (TOC.physlast - TOC.physfirst)))
0014c e59d201c ldr r2, [sp, #0x1C]
00150 e59d3018 ldr r3, [sp, #0x18]
00154 e1a01007 mov r1, r7
00158 e1a00006 mov r0, r6
0015c e0422003 sub r2, r2, r3
00160 eb000000 bl BP_ReadData
00164 e3500000 cmp r0, #0
00168 1affffea bne |$L44716|
0016c |$L45282|
; 1273 : {
; 1274 : return(FALSE);
0016c e3a00000 mov r0, #0
00170 eaffffe9 b |$L44691|
00174 |$L45288|
00174 00000000 DCD |??_C@_0CC@PBGMLNAG@simply?5copy?5the?5data?5to?5RAM?5?$CFd?4?$AN@|
00178 00000000 DCD |??_C@_02PCIJFNDE@?$AN?6?$AA@|
0017c 00000000 DCD |??_C@_01LFCBOECM@?4?$AA@|
00180 00000000 DCD |CompressedData|
00184 00000000 DCD |??_C@_0DE@KEKIKBNP@g_CompressionHeader?9?$DOdwCompresse@|
00188 00000000 DCD |g_fCompressed|
0018c |$M45284|
ENDP ; |CopyToRAM|
EXPORT |OEMLaunchImage|
00000 AREA |.text| { |OEMLaunchImage| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMLaunchImage|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMLaunchImage| } ; comdat associative
|$T45295| DCD |$L45294|
DCD 0x40000501
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMLaunchImage| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMLaunchImage| PROC
; 1282 : {
00000 |$L45294|
00000 e52de004 str lr, [sp, #-4]!
00004 |$M45292|
; 1283 : typedef void (*PFN_LAUNCH)();
; 1284 :
; 1285 : //FAL_UnlockFlashRegion(FILESYS);
; 1286 :
; 1287 : // Since the MMU is off, we just need to jump to the address provided (it was translated by OEMTranslateBaseAddress).
; 1288 : //
; 1289 : ((PFN_LAUNCH)(ulLaunchAddr))();
00004 e1a0e00f mov lr, pc
00008 e12fff10 bx r0
; 1290 : }
0000c e49de004 ldr lr, [sp], #4
00010 e12fff1e bx lr
00014 |$M45293|
ENDP ; |OEMLaunchImage|
EXPORT |??_C@_0BC@JOKCKMOM@StoreEBootCFG?$CI?$CJ?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0DH@LOAHIMIE@ERROR?3?5StoreEBootCFG?3?5failed?5to?5@| [ DATA ] ; `string'
IMPORT |BootDevice_Write|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -