Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RAM_ARM9:0203A32C ; =============== S U B R O U T I N E =======================================
- RAM_ARM9:0203A32C
- RAM_ARM9:0203A32C
- RAM_ARM9:0203A32C ; bool __fastcall isSourceFilename(char *pCopyArray, char *pSrcNameArray)
- RAM_ARM9:0203A32C isSourceFilename ; CODE XREF: verifyBlockGroup+1Ap
- RAM_ARM9:0203A32C ; getFreeSpaceExpHeap+1Cp ...
- RAM_ARM9:0203A32C MOVS R3, #0 ; int i = 0
- RAM_ARM9:0203A32E
- RAM_ARM9:0203A32E copy_sourcefile_local_array ; CODE XREF: isSourceFilename+Ej
- RAM_ARM9:0203A32E LDRSB R2, [R1,R3] ; load ascii byte
- RAM_ARM9:0203A330 CMP R2, #0 ; terminator?
- RAM_ARM9:0203A332 BEQ store_terminator
- RAM_ARM9:0203A334 STRB R2, [R0,R3] ; store non-terminator byte
- RAM_ARM9:0203A336 ADDS R3, R3, #1 ; ++i
- RAM_ARM9:0203A338 CMP R3, #0x12 ; max srcfile name byte count for memblk header
- RAM_ARM9:0203A33A BLT copy_sourcefile_local_array
- RAM_ARM9:0203A33C
- RAM_ARM9:0203A33C store_terminator ; CODE XREF: isSourceFilename+6j
- RAM_ARM9:0203A33C MOVS R2, #0
- RAM_ARM9:0203A33E STRB R2, [R0,R3] ; store terminator
- RAM_ARM9:0203A340 CMP R3, #0
- RAM_ARM9:0203A342 BNE loc_203A348 ; if r3 is 0, there is no source file name. return false.
- RAM_ARM9:0203A344 MOVS R0, R2
- RAM_ARM9:0203A346 BX LR
- RAM_ARM9:0203A348 ; ---------------------------------------------------------------------------
- RAM_ARM9:0203A348
- RAM_ARM9:0203A348 loc_203A348 ; CODE XREF: isSourceFilename+16j
- RAM_ARM9:0203A348 BLE return_if_18bytes_are_filled ; this happens if r3 = 0, thus there's no sourcefile
- RAM_ARM9:0203A34A
- RAM_ARM9:0203A34A is_valid_char ; CODE XREF: isSourceFilename+30j
- RAM_ARM9:0203A34A LDRB R1, [R0,R2]
- RAM_ARM9:0203A34C CMP R1, #0x20 ; ' ' ; below 0x20 is formatting stuff
- RAM_ARM9:0203A34E BCC false_if_invalid_char
- RAM_ARM9:0203A350 CMP R1, #0x7E ; '~' ; above 7e is not a character
- RAM_ARM9:0203A352 BLS inc_if_srcname_loop_lessthan_invalid_loop
- RAM_ARM9:0203A354
- RAM_ARM9:0203A354 false_if_invalid_char ; CODE XREF: isSourceFilename+22j
- RAM_ARM9:0203A354 MOVS R0, #0 ; if it's below 0x20 or above 7e, return false- inappropriate character
- RAM_ARM9:0203A356 BX LR
- RAM_ARM9:0203A358 ; ---------------------------------------------------------------------------
- RAM_ARM9:0203A358
- RAM_ARM9:0203A358 inc_if_srcname_loop_lessthan_invalid_loop
- RAM_ARM9:0203A358 ; CODE XREF: isSourceFilename+26j
- RAM_ARM9:0203A358 ADDS R2, R2, #1 ; ++i
- RAM_ARM9:0203A35A CMP R2, R3 ; is the invalid char check done with the entire array
- RAM_ARM9:0203A35C BLT is_valid_char
- RAM_ARM9:0203A35E
- RAM_ARM9:0203A35E return_if_18bytes_are_filled ; CODE XREF: isSourceFilename:loc_203A348j
- RAM_ARM9:0203A35E CMP R3, #0x12 ; 18 bytes are the entirety of allocated header room for source file names.
- RAM_ARM9:0203A360 BGE loc_203A37C ; return true if all 18 bytes are full
- RAM_ARM9:0203A362 MOVS R2, #0 ; i = 0
- RAM_ARM9:0203A364 CMP R3, #0 ; does the sourcefile array have length?
- RAM_ARM9:0203A366 BLE loc_203A374 ; if r3 is 0, there's no sourcefile name.
- RAM_ARM9:0203A368
- RAM_ARM9:0203A368 check_for_period ; CODE XREF: isSourceFilename+46j
- RAM_ARM9:0203A368 LDRB R1, [R0,R2]
- RAM_ARM9:0203A36A CMP R1, #0x2E ; '.' ; 2e is a period
- RAM_ARM9:0203A36C BEQ loc_203A374
- RAM_ARM9:0203A36E ADDS R2, R2, #1
- RAM_ARM9:0203A370 CMP R2, R3
- RAM_ARM9:0203A372 BLT check_for_period
- RAM_ARM9:0203A374
- RAM_ARM9:0203A374 loc_203A374 ; CODE XREF: isSourceFilename+3Aj
- RAM_ARM9:0203A374 ; isSourceFilename+40j
- RAM_ARM9:0203A374 CMP R2, R3 ; if r2 = r3, then no period was found and it's not a sourcefile name "name.c"
- RAM_ARM9:0203A376 BNE loc_203A37C
- RAM_ARM9:0203A378 MOVS R0, #0 ; return false if it's not a source file
- RAM_ARM9:0203A37A BX LR
- RAM_ARM9:0203A37C ; ---------------------------------------------------------------------------
- RAM_ARM9:0203A37C
- RAM_ARM9:0203A37C loc_203A37C ; CODE XREF: isSourceFilename+34j
- RAM_ARM9:0203A37C ; isSourceFilename+4Aj
- RAM_ARM9:0203A37C MOVS R0, #1 ; return true if it is a source file "name.c" or if the text takes up all 18 bytes of the char array
- RAM_ARM9:0203A37E BX LR
- RAM_ARM9:0203A37E ; End of function isSourceFilename
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement