📄 blcommon.cod
字号:
00180 e59f3054 ldr r3, [pc, #0x54]
00184 e5931014 ldr r1, [r3, #0x14]
00188 e59f0048 ldr r0, [pc, #0x48]
0018c eb000000 bl EdbgOutputDebugString
; 146 :
; 147 : } else
00190 ea000007 b |$L38441|
00194 |$L38432|
; 148 : {
; 149 : EdbgOutputDebugString("! Did not Find Windows CE pTOC signature.!\n");
00194 e59f0038 ldr r0, [pc, #0x38]
00198 eb000000 bl EdbgOutputDebugString
; 150 : //
; 151 : // In my image the rom header is not used anyway.
; 152 : //
; 153 : EdbgOutputDebugString("INFO: Jumping to image at 0x%X...\r\n", dwLaunchAddr);
0019c e59d100c ldr r1, [sp, #0xC]
001a0 e59f0028 ldr r0, [pc, #0x28]
001a4 eb000000 bl EdbgOutputDebugString
; 154 : bEthLaunch =FALSE;
001a8 e59f201c ldr r2, [pc, #0x1C]
001ac e3a03000 mov r3, #0
001b0 e5823000 str r3, [r2]
001b4 |$L38441|
001b4 |$L38444|
; 155 :
; 156 : }
; 157 :
; 158 :
; 159 : // fall through
; 160 : case BL_JUMP:
; 161 : // (5) final call to launch the image. never returned
; 162 : OEMLaunch (dwImageStart, dwImageLength, dwLaunchAddr, pRomHdr);
001b4 e59d3008 ldr r3, [sp, #8]
001b8 e59d200c ldr r2, [sp, #0xC]
001bc e59d1010 ldr r1, [sp, #0x10]
001c0 e59d0000 ldr r0, [sp]
001c4 eb000000 bl OEMLaunch
001c8 |$L38445|
001c8 |$L38447|
; 163 : // should never return
; 164 : // fall through
; 165 : default:
; 166 : // ERROR! spin forever
; 167 : SPIN_FOREVER;
001c8 eafffffe b |$L38447|
001cc |$L38570|
001cc 00000000 DCD |bEthLaunch|
001d0 00000000 DCD |??_C@_0CE@IBJJNLHI@INFO?3?5Jumping?5to?5image?5at?50x?$CFX?4?4@|
001d4 00000000 DCD |??_C@_0CM@NLKPPMBO@?$CB?5Did?5not?5Find?5Windows?5CE?5pTOC?5s@|
001d8 00000000 DCD |??_C@_0CO@LCHGIDCB@RomHdr?4ulRAMStart?$DN?$CFXh?5RomHdr?4phy@|
001dc 00000000 DCD |romhdr|
001e0 00000000 DCD |??_C@_0BI@OCFAEGPK@ROMHDR?5at?5Address?5?$CFXh?$AN?6?$AA@|
001e4 00000000 DCD |??_C@_0BH@BICFFKHJ@Found?5pTOC?5signature?4?6?$AA@|
001e8 43454345 DCD 0x43454345
001ec 00000000 DCD |??_C@_0CL@NOFKHKJC@System?5ready?$CB?$AN?6Preparing?5for?5dow@|
001f0 00000000 DCD |NKSignon|
001f4 00000000 DCD |pTOC|
001f8 |$M38566|
ENDP ; |BootloaderMain|
IMPORT |memset|
00000 AREA |.text| { |KernelRelocate| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$KernelRelocate|, PDATA, SELECTION=5, ASSOC=|.text| { |KernelRelocate| } ; comdat associative
|$T38577| DCD |$L38576|
DCD 0x40004b04
; Function compile flags: /Ods
00000 AREA |.text| { |KernelRelocate| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |KernelRelocate| PROC
; 176 : {
00000 |$L38576|
00000 e1a0c00d mov r12, sp
00004 e92d0001 stmdb sp!, {r0}
00008 e92d5000 stmdb sp!, {r12, lr}
0000c e24dd00c sub sp, sp, #0xC
00010 |$M38574|
; 177 : ULONG loop;
; 178 : COPYentry *cptr;
; 179 : if (pTOC == (ROMHDR *const) -1) {
00010 e59d3014 ldr r3, [sp, #0x14]
00014 e3730001 cmn r3, #1
00018 1a000002 bne |$L38455|
; 180 : return FALSE; // spin forever!
0001c e3a03000 mov r3, #0
00020 e58d3008 str r3, [sp, #8]
00024 ea00003c b |$L38451|
00028 |$L38455|
; 181 : }
; 182 : // This is where the data sections become valid... don't read globals until after this
; 183 : for (loop = 0; loop < pTOC->ulCopyEntries; loop++) {
00028 e3a03000 mov r3, #0
0002c e58d3000 str r3, [sp]
00030 ea000002 b |$L38456|
00034 |$L38457|
00034 e59d3000 ldr r3, [sp]
00038 e2833001 add r3, r3, #1
0003c e58d3000 str r3, [sp]
00040 |$L38456|
00040 e59d3014 ldr r3, [sp, #0x14]
00044 e2833020 add r3, r3, #0x20
00048 e59d2000 ldr r2, [sp]
0004c e5933000 ldr r3, [r3]
00050 e1520003 cmp r2, r3
00054 2a00002e bcs |$L38458|
; 184 : cptr = (COPYentry *)(pTOC->ulCopyOffset + loop*sizeof(COPYentry));
00058 e59d3014 ldr r3, [sp, #0x14]
0005c e2830024 add r0, r3, #0x24
00060 e59d1000 ldr r1, [sp]
00064 e3a03010 mov r3, #0x10
00068 e0020391 mul r2, r1, r3
0006c e5903000 ldr r3, [r0]
00070 e0833002 add r3, r3, r2
00074 e58d3004 str r3, [sp, #4]
; 185 : if (cptr->ulCopyLen)
00078 e59d3004 ldr r3, [sp, #4]
0007c e2833008 add r3, r3, #8
00080 e5933000 ldr r3, [r3]
00084 e3530000 cmp r3, #0
00088 0a000008 beq |$L38461|
; 186 : memcpy((LPVOID)cptr->ulDest,(LPVOID)cptr->ulSource,cptr->ulCopyLen);
0008c e59d3004 ldr r3, [sp, #4]
00090 e2833008 add r3, r3, #8
00094 e5932000 ldr r2, [r3]
00098 e59d3004 ldr r3, [sp, #4]
0009c e5931000 ldr r1, [r3]
000a0 e59d3004 ldr r3, [sp, #4]
000a4 e2833004 add r3, r3, #4
000a8 e5930000 ldr r0, [r3]
000ac eb000000 bl memcpy
000b0 |$L38461|
; 187 : if (cptr->ulCopyLen != cptr->ulDestLen)
000b0 e59d3004 ldr r3, [sp, #4]
000b4 e2832008 add r2, r3, #8
000b8 e59d3004 ldr r3, [sp, #4]
000bc e283300c add r3, r3, #0xC
000c0 e5922000 ldr r2, [r2]
000c4 e5933000 ldr r3, [r3]
000c8 e1520003 cmp r2, r3
000cc 0a00000f beq |$L38464|
; 188 : memset((LPVOID)(cptr->ulDest+cptr->ulCopyLen),0,cptr->ulDestLen-cptr->ulCopyLen);
000d0 e59d3004 ldr r3, [sp, #4]
000d4 e283200c add r2, r3, #0xC
000d8 e59d3004 ldr r3, [sp, #4]
000dc e2833008 add r3, r3, #8
000e0 e5922000 ldr r2, [r2]
000e4 e5933000 ldr r3, [r3]
000e8 e0422003 sub r2, r2, r3
000ec e3a01000 mov r1, #0
000f0 e59d3004 ldr r3, [sp, #4]
000f4 e2830004 add r0, r3, #4
000f8 e59d3004 ldr r3, [sp, #4]
000fc e2833008 add r3, r3, #8
00100 e5900000 ldr r0, [r0]
00104 e5933000 ldr r3, [r3]
00108 e0800003 add r0, r0, r3
0010c eb000000 bl memset
00110 |$L38464|
; 189 : }
00110 eaffffc7 b |$L38457|
00114 |$L38458|
; 190 : return TRUE;
00114 e3a03001 mov r3, #1
00118 e58d3008 str r3, [sp, #8]
0011c |$L38451|
; 180 : return FALSE; // spin forever!
0011c e59d0008 ldr r0, [sp, #8]
; 191 : }
00120 e28dd00c add sp, sp, #0xC
00124 e89d6000 ldmia sp, {sp, lr}
00128 e12fff1e bx lr
0012c |$M38575|
ENDP ; |KernelRelocate|
EXPORT |??_C@_07MMNKOBGG@B000FF?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0DB@HGMOIJLD@?$AN?6This?5is?5not?5a?5?4BIN?5file?5?$CFx?5?$CFx?5@| [ DATA ] ; `string'
EXPORT |??_C@_0CE@NKAMCDHO@Unable?5to?5read?5image?5start?1lengt@| [ DATA ] ; `string'
EXPORT |??_C@_0CC@DNECAMLM@?$CBOEMVERIFYMEMORY?3?5Invalid?5image?$AN@| [ DATA ] ; `string'
EXPORT |??_C@_0BN@FJFONPHK@Flash?5can?8t?5be?5initialized?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0BJ@CHJNPJCH@Image?5will?5put?5to?50x?$CFx?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0BP@OAODHDCP@Invalid?5Flash?5Address?1Length?$AN?6?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0DD@KHJBCIED@?$CK?$CK?$CK?$CK?$CK?$CK?5Data?5record?5?$CFd?5corrupted?0@| [ DATA ] ; `string'
EXPORT |??_C@_0DI@FDIIHFBA@?$CK?$CK?$CK?$CK?$CK?$CK?5Checksum?5failure?5on?5recor@| [ DATA ] ; `string'
IMPORT |OEMReadData|
IMPORT |OEMShowProgress|
IMPORT |OEMIsFlashAddr|
IMPORT |OEMStartEraseFlash|
IMPORT |OEMContinueEraseFlash|
IMPORT |OEMFinishEraseFlash|
IMPORT |OEMWriteFlash|
IMPORT |memcmp|
IMPORT |InitializeFlash|
00000 AREA |.text| { |DownloadImage| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$DownloadImage|, PDATA, SELECTION=5, ASSOC=|.text| { |DownloadImage| } ; comdat associative
|$T38585| DCD |$L38584|
DCD 0x4000e804
00000 AREA |.rdata| { |??_C@_0DI@FDIIHFBA@?$CK?$CK?$CK?$CK?$CK?$CK?5Checksum?5failure?5on?5recor@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DI@FDIIHFBA@?$CK?$CK?$CK?$CK?$CK?$CK?5Checksum?5failure?5on?5recor@| DCB "*"
DCB "***** Checksum failure on record %d, ABORT!!! ******", 0xd
DCB 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DD@KHJBCIED@?$CK?$CK?$CK?$CK?$CK?$CK?5Data?5record?5?$CFd?5corrupted?0@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DD@KHJBCIED@?$CK?$CK?$CK?$CK?$CK?$CK?5Data?5record?5?$CFd?5corrupted?0@| DCB "*"
DCB "***** Data record %d corrupted, ABORT!!! ******", 0xd, 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BP@OAODHDCP@Invalid?5Flash?5Address?1Length?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BP@OAODHDCP@Invalid?5Flash?5Address?1Length?$AN?6?$AA@| DCB "Inva"
DCB "lid Flash Address/Length", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BJ@CHJNPJCH@Image?5will?5put?5to?50x?$CFx?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BJ@CHJNPJCH@Image?5will?5put?5to?50x?$CFx?$AN?6?$AA@| DCB "Image "
DCB "will put to 0x%x", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0BN@FJFONPHK@Flash?5can?8t?5be?5initialized?$AN?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BN@FJFONPHK@Flash?5can?8t?5be?5initialized?$AN?6?$AA@| DCB "Flash"
DCB " can't be initialized", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CC@DNECAMLM@?$CBOEMVERIFYMEMORY?3?5Invalid?5image?$AN@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CC@DNECAMLM@?$CBOEMVERIFYMEMORY?3?5Invalid?5image?$AN@| DCB "!OEM"
DCB "VERIFYMEMORY: Invalid image", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0CE@NKAMCDHO@Unable?5to?5read?5image?5start?1lengt@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0CE@NKAMCDHO@Unable?5to?5read?5image?5start?1lengt@| DCB "Unable t"
DCB "o read image start/length", 0xd, 0xa, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DB@HGMOIJLD@?$AN?6This?5is?5not?5a?5?4BIN?5file?5?$CFx?5?$CFx?5@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DB@HGMOIJLD@?$AN?6This?5is?5not?5a?5?4BIN?5file?5?$CFx?5?$CFx?5@| DCB 0xd
DCB 0xa, "This is not a .BIN file %x %x %x %x %x %x %x", 0xd, 0xa
DCB 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_07MMNKOBGG@B000FF?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_07MMNKOBGG@B000FF?6?$AA@| DCB "B000FF", 0xa, 0x0 ; `string'
; Function compile flags: /Ods
00000 AREA |.text| { |DownloadImage| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |DownloadImage| PROC
; 205 : {
00000 |$L38584|
00000 e1a0c00d mov r12, sp
00004 e92d0007 stmdb sp!, {r0 - r2}
00008 e92d5000 stmdb sp!, {r12, lr}
0000c e24dd078 sub sp, sp, #0x78
00010 |$M38582|
; 206 : BYTE hdr[BINHDRSIZE];
; 207 : DWORD dwRecLen, dwRecChk, dwRecAddr;
; 208 : BOOL fIsFlash;
; 209 : LPBYTE lpDest;
; 210 : int nPkgNum = 0;
00010 e3a03000 mov r3, #0
00014 e58d3024 str r3, [sp, #0x24]
; 211 :
; 212 : // read the 7 byte "magic number"
; 213 : if (!OEMReadData (BINHDRSIZE, hdr)
; 214 : || memcmp (hdr, "B000FF\x0A", BINHDRSIZE)) {
00018 e28d1028 add r1, sp, #0x28
0001c e3a00007 mov r0, #7
00020 eb000000 bl OEMReadData
00024 e58d0034 str r0, [sp, #0x34]
00028 e59d3034 ldr r3, [sp, #0x34]
0002c e3530000 cmp r3, #0
00030 0a000007 beq |$L38494|
00034 e3a02007 mov r2, #7
00038 e59f135c ldr r1, [pc, #0x35C]
0003c e28d0028 add r0, sp, #0x28
00040 eb000000 bl memcmp
00044 e58d0038 str r0, [sp, #0x38]
00048 e59d3038 ldr r3, [sp, #0x38]
0004c e3530000 cmp r3, #0
00050 0a00000f beq |$L38493|
00054 |$L38494|
; 215 : EdbgOutputDebugString ("\r\nThis is not a .BIN file %x %x %x %x %x %x %x\r\n",
; 216 : hdr[0], hdr[1], hdr[2], hdr[3], hdr[4], hdr[5], hdr[6]);
00054 e5dd302e ldrb r3, [sp, #0x2E]
00058 e58d300c str r3, [sp, #0xC]
0005c e5dd302d ldrb r3, [sp, #0x2D]
00060 e58d3008 str r3, [sp, #8]
00064 e5dd302c ldrb r3, [sp, #0x2C]
00068 e58d3004 str r3, [sp, #4]
0006c e5dd302b ldrb r3, [sp, #0x2B]
00070 e58d3000 str r3, [sp]
00074 e5dd302a ldrb r3, [sp, #0x2A]
00078 e5dd2029 ldrb r2, [sp, #0x29]
0007c e5dd1028 ldrb r1, [sp, #0x28]
00080 e59f0310 ldr r0, [pc, #0x310]
00084 eb000000 bl EdbgOutputDebugString
; 217 : return FALSE;
00088 e3a03000 mov r3, #0
0008c e58d3030 str r3, [sp, #0x30]
00090 ea0000b4 b |$L38485|
00094 |$L38493|
; 218 : }
; 219 :
; 220 : // read image start/length
; 221 : if (!OEMReadData (sizeof (DWORD), (LPBYTE) pdwImageStart)
; 222 : || !OEMReadData (sizeof (DWORD), (LPBYTE) pdwImageLength)) {
00094 e59d1080 ldr r1, [sp, #0x80]
00098 e3a00004 mov r0, #4
0009c eb000000 bl OEMReadData
000a0 e58d003c str r0, [sp, #0x3C]
000a4 e59d303c ldr r3, [sp, #0x3C]
000a8 e3530000 cmp r3, #0
000ac 0a000006 beq |$L38502|
000b0 e59d1084 ldr r1, [sp, #0x84]
000b4 e3a00004 mov r0, #4
000b8 eb000000 bl OEMReadData
000bc e58d0040 str r0, [sp, #0x40]
000c0 e59d3040 ldr r3, [sp, #0x40]
000c4 e3530000 cmp r3, #0
000c8 1a000004 bne |$L38501|
000cc |$L38502|
; 223 : EdbgOutputDebugString ("Unable to read image start/length\r\n");
000cc e59f02c0 ldr r0, [pc, #0x2C0]
000d0 eb000000 bl EdbgOutputDebugString
; 224 : return FALSE;
000d4 e3a03000 mov r3, #0
000d8 e58d3030 str r3, [sp, #0x30]
000dc ea0000a1 b |$L38485|
000e0 |$L38501|
; 225 : }
; 226 :
; 227 : // give the OEM a chance to verify memory
; 228 : if (g_pOEMVerifyMemory && !g_pOEMVerifyMemory (*pdwImageStart, *pdwImageLength)) {
000e0 e59f32a8 ldr r3, [pc, #0x2A8]
000e4 e5933000 ldr r3, [r3]
000e8 e3530000 cmp r3, #0
000ec 0a000010 beq |$L38504|
000f0 e59d3084 ldr r3, [sp, #0x84]
000f4 e5931000 ldr r1, [r3]
000f8 e59d3080 ldr r3, [sp, #0x80]
000fc e5930000 ldr r0, [r3]
00100 e59f3288 ldr r3, [pc, #0x288]
00104 e5933000 ldr r3, [r3]
00108 e1a0e00f mov lr, pc
0010c e12fff13 bx r3
00110 e58d0044 str r0, [sp, #0x44]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -