Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ROM:87000A4A ; =============== S U B R O U T I N E =======================================
- ROM:87000A4A
- ROM:87000A4A
- ROM:87000A4A ; int __cdecl check_secure_version(int entry_number)
- ROM:87000A4A check_secure_version ; CODE XREF: check_mbm_secversion+Ep
- ROM:87000A4A ; check_mbm_secversion+8Cp ...
- ROM:87000A4A 000 2D E9 F0 47 PUSH.W {R4-R10,LR} ; Push registers
- ROM:87000A4E 020 04 46 MOV R4, R0 ; Rd = Op2
- ROM:87000A50 020 58 25 MOVS R5, #0x58 ; Rd = Op2
- ROM:87000A52 020 00 27 MOVS R7, #0 ; Rd = Op2
- ROM:87000A54 020 4F F0 00 08 MOV.W R8, #0 ; Rd = Op2
- ROM:87000A58 020 4F F0 00 09 MOV.W R9, #0 ; Rd = Op2
- ROM:87000A5C 020 20 46 MOV R0, R4 ; entry_number
- ROM:87000A5E 020 03 F0 37 FF BL fuse_read_SECVER ; Branch with Link
- ROM:87000A62 020 C6 B2 UXTB R6, R0 ; Unsigned extend byte to word
- ROM:87000A64 020 68 2C CMP R4, #0x68 ; Set cond. codes on Op1 - Op2
- ROM:87000A66 020 02 D0 BEQ entry_is_0x68 ; Branch
- ROM:87000A68 020 69 2C CMP R4, #0x69 ; Set cond. codes on Op1 - Op2
- ROM:87000A6A 020 1A D1 BNE entry_is_0x69 ; Branch
- ROM:87000A6C 020 0C E0 B entry_is_another ; Branch
- ROM:87000A6E ; ---------------------------------------------------------------------------
- ROM:87000A6E
- ROM:87000A6E entry_is_0x68 ; CODE XREF: check_secure_version+1Cj
- ROM:87000A6E 020 DF F8 FC 82 LDR.W R8, =mbmloader_header ; Load from Memory
- ROM:87000A72 020 B8 F1 00 0F CMP.W R8, #0 ; Set cond. codes on Op1 - Op2
- ROM:87000A76 020 06 D0 BEQ loc_87000A86 ; Branch
- ROM:87000A78 020 D8 F8 04 00 LDR.W R0, [R8,#4] ; Load from Memory
- ROM:87000A7C 020 B1 28 CMP R0, #0xB1 ; Set cond. codes on Op1 - Op2
- ROM:87000A7E 020 02 D1 BNE loc_87000A86 ; Branch
- ROM:87000A80 020 98 F8 24 70 LDRB.W R7, [R8,#0x24] ; Load from Memory
- ROM:87000A84 020 23 25 MOVS R5, #0x23 ; Rd = Op2
- ROM:87000A86
- ROM:87000A86 loc_87000A86 ; CODE XREF: check_secure_version+2Cj
- ROM:87000A86 ; check_secure_version+34j
- ROM:87000A86 020 0E E0 B compare_with_fuse ; Branch
- ROM:87000A88 ; ---------------------------------------------------------------------------
- ROM:87000A88
- ROM:87000A88 entry_is_another ; CODE XREF: check_secure_version+22j
- ROM:87000A88 020 DF F8 E4 92 LDR.W R9, =MBM_BASE ; Load from Memory
- ROM:87000A8C 020 B9 F1 00 0F CMP.W R9, #0 ; Set cond. codes on Op1 - Op2
- ROM:87000A90 020 06 D0 BEQ loc_87000AA0 ; Branch
- ROM:87000A92 020 D9 F8 04 00 LDR.W R0, [R9,#4] ; Load from Memory
- ROM:87000A96 020 B1 28 CMP R0, #0xB1 ; Set cond. codes on Op1 - Op2
- ROM:87000A98 020 02 D1 BNE loc_87000AA0 ; Branch
- ROM:87000A9A 020 99 F8 24 70 LDRB.W R7, [R9,#0x24] ; Load from Memory
- ROM:87000A9E 020 23 25 MOVS R5, #0x23 ; Rd = Op2
- ROM:87000AA0
- ROM:87000AA0 loc_87000AA0 ; CODE XREF: check_secure_version+46j
- ROM:87000AA0 ; check_secure_version+4Ej
- ROM:87000AA0 020 01 E0 B compare_with_fuse ; Branch
- ROM:87000AA2 ; ---------------------------------------------------------------------------
- ROM:87000AA2
- ROM:87000AA2 entry_is_0x69 ; CODE XREF: check_secure_version+20j
- ROM:87000AA2 020 58 25 MOVS R5, #0x58 ; Rd = Op2
- ROM:87000AA4 020 00 BF NOP ; No Operation
- ROM:87000AA6
- ROM:87000AA6 compare_with_fuse ; CODE XREF: check_secure_version:loc_87000A86j
- ROM:87000AA6 ; check_secure_version:loc_87000AA0j
- ROM:87000AA6 020 00 BF NOP ; No Operation
- ROM:87000AA8 020 23 2D CMP R5, #0x23 ; Set cond. codes on Op1 - Op2
- ROM:87000AAA 020 0B D1 BNE return ; Branch
- ROM:87000AAC 020 03 F0 9F FE BL hab_su_type ; 2 - HIGH SECURE, 1 - SECURE, 8 - INSECURE
- ROM:87000AB0 020 02 28 CMP R0, #2 ; Set cond. codes on Op1 - Op2
- ROM:87000AB2 020 07 D1 BNE return ; Branch
- ROM:87000AB4 020 03 F0 B2 FE BL check_SMID ; return 0 if SECURE_MODULE_ID or 1 if SECURE_MODULE_ID is null
- ROM:87000AB8 020 20 B9 CBNZ R0, return ; Compare and Branch on Non-Zero
- ROM:87000ABA 020 B7 42 CMP R7, R6 ; Set cond. codes on Op1 - Op2
- ROM:87000ABC 020 01 DB BLT return_0x58 ; Branch
- ROM:87000ABE 020 23 25 MOVS R5, #0x23 ; Rd = Op2
- ROM:87000AC0 020 00 E0 B return ; Branch
- ROM:87000AC2 ; ---------------------------------------------------------------------------
- ROM:87000AC2
- ROM:87000AC2 return_0x58 ; CODE XREF: check_secure_version+72j
- ROM:87000AC2 020 58 25 MOVS R5, #0x58 ; Rd = Op2
- ROM:87000AC4
- ROM:87000AC4 return ; CODE XREF: check_secure_version+60j
- ROM:87000AC4 ; check_secure_version+68j ...
- ROM:87000AC4 020 28 46 MOV R0, R5 ; Rd = Op2
- ROM:87000AC6 020 BD E8 F0 87 POP.W {R4-R10,PC} ; Pop registers
- ROM:87000AC6 020 ; End of function check_secure_version
- ROM:87000AC6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement