#include <stdio.h>
int IsAdd(int* pNumOne, int* pNumTwo)
{
return *pNumOne + *pNumTwo;
}
int main()
{
int nNumOne = 0;
int nNumTwo = 0;
int nNumResult = 0;
printf("hi arm code.\r\n");
printf("Please Input a Name:");
scanf("%d", &nNumOne);
printf("\r\n");
printf("Please Input a Password:");
scanf("%d", &nNumTwo);
printf("\r\n");
nNumResult = IsAdd(&nNumOne, &nNumTwo);
printf("%d + %d = %d\r\n", nNumOne, nNumTwo, nNumResult);
if(nNumResult != 2013)
{
printf("error\r\n");
}
else
{
printf("success\r\n");
}
return 1;
}
.text:00008204 ; =============== S U B R O U T I N E =======================================
.text:00008204 ; Attributes: noreturn bp-based frame
.text:00008204 EXPORT main
.text:00008204 main ; DATA XREF: _start+20o
.text:00008204 ; .text:off_8154o
.text:00008204 var_10 = -0x10
.text:00008204 var_C = -0xC
.text:00008204 var_8 = -8
.text:00008204 00 48 2D E9 STMFD SP!, {R11,LR} ; Store Block to Memory
.text:00008208 04 B0 8D E2 ADD R11, SP, #4 ; Rd = Op1 + Op2
.text:0000820C 10 D0 4D E2 SUB SP, SP, #0x10 ; Rd = Op1 - Op2
.text:00008210 00 30 A0 E3 MOV R3, #0 ; Rd = Op2
.text:00008214 0C 30 0B E5 STR R3, [R11,#var_C] ; Store to Memory
.text:00008218 00 30 A0 E3 MOV R3, #0 ; Rd = Op2
.text:0000821C 10 30 0B E5 STR R3, [R11,#var_10] ; Store to Memory
.text:00008220 00 30 A0 E3 MOV R3, #0 ; Rd = Op2
.text:00008224 08 30 0B E5 STR R3, [R11,#var_8] ; Store to Memory
.text:00008228 BC 00 9F E5 LDR R0, =aHiArmCode_ ; "hi arm code.\r"
.text:0000822C 19 0B 00 EB BL puts ; Branch with Link
.text:00008230 B8 30 9F E5 LDR R3, =aPleaseInputANa ; "Please Input a Name:"
.text:00008234 03 00 A0 E1 MOV R0, R3 ; Rd = Op2
.text:00008238 80 0A 00 EB BL printf ; Branch with Link
.text:0000823C B0 20 9F E5 LDR R2, =aD ; "%d"
.text:00008240 0C 30 4B E2 SUB R3, R11, #-var_C ; Rd = Op1 - Op2
.text:00008244 02 00 A0 E1 MOV R0, R2 ; Rd = Op2
.text:00008248 03 10 A0 E1 MOV R1, R3 ; Rd = Op2
.text:0000824C 8A 0A 00 EB BL __isoc99_scanf ; Branch with Link
.text:00008250 A0 00 9F E5 LDR R0, =asc_6FE98 ; "\r"
.text:00008254 0F 0B 00 EB BL puts ; Branch with Link
.text:00008258 9C 30 9F E5 LDR R3, =aPleaseInputAPa ; "Please Input a Password:"
.text:0000825C 03 00 A0 E1 MOV R0, R3 ; Rd = Op2
.text:00008260 76 0A 00 EB BL printf ; Branch with Link
.text:00008264 88 20 9F E5 LDR R2, =aD ; "%d"
.text:00008268 10 30 4B E2 SUB R3, R11, #-var_10 ; Rd = Op1 - Op2
.text:0000826C 02 00 A0 E1 MOV R0, R2 ; Rd = Op2
.text:00008270 03 10 A0 E1 MOV R1, R3 ; Rd = Op2
.text:00008274 80 0A 00 EB BL __isoc99_scanf ; Branch with Link
.text:00008278 78 00 9F E5 LDR R0, =asc_6FE98 ; "\r"
.text:0000827C 05 0B 00 EB BL puts ; Branch with Link
.text:00008280 0C 20 4B E2 SUB R2, R11, #-var_C ; Rd = Op1 - Op2
.text:00008284 10 30 4B E2 SUB R3, R11, #-var_10 ; Rd = Op1 - Op2
.text:00008288 02 00 A0 E1 MOV R0, R2 ; Rd = Op2
.text:0000828C 03 10 A0 E1 MOV R1, R3 ; Rd = Op2
.text:00008290 CD FF FF EB BL IsAdd ; Branch with Link
.text:00008294 08 00 0B E5 STR R0, [R11,#var_8] ; Store to Memory
.text:00008298 60 10 9F E5 LDR R1, =aDDD ; "%d + %d = %d\r\n"
.text:0000829C 0C 20 1B E5 LDR R2, [R11,#var_C] ; Load from Memory
.text:000082A0 10 30 1B E5 LDR R3, [R11,#var_10] ; Load from Memory
.text:000082A4 01 00 A0 E1 MOV R0, R1 ; Rd = Op2
.text:000082A8 02 10 A0 E1 MOV R1, R2 ; Rd = Op2
.text:000082AC 03 20 A0 E1 MOV R2, R3 ; Rd = Op2
.text:000082B0 08 30 1B E5 LDR R3, [R11,#var_8] ; Load from Memory
.text:000082B4 61 0A 00 EB BL printf ; Branch with Link
.text:000082B8 08 20 1B E5 LDR R2, [R11,#var_8] ; Load from Memory
.text:000082BC 40 30 9F E5 LDR R3, =0x7DD ; Load from Memory
.text:000082C0 03 00 52 E1 CMP R2, R3 ; Set cond. codes on Op1 - Op2
.text:000082C4 02 00 00 0A BEQ loc_82D4 ; Branch
.text:000082C8 38 00 9F E5 LDR R0, =aError ; "error\r"
.text:000082CC F1 0A 00 EB BL puts ; Branch with Link
.text:000082D0 01 00 00 EA B loc_82DC ; Branch
.text:000082D4 loc_82D4 ; CODE XREF: main+C0j
.text:000082D4 30 00 9F E5 LDR R0, =aSuccess ; "success\r"
.text:000082D8 EE 0A 00 EB BL puts ; Branch with Link
.text:000082DC loc_82DC ; CODE XREF: main+CCj
.text:000082DC 01 30 A0 E3 MOV R3, #1 ; Rd = Op2
.text:000082E0 03 00 A0 E1 MOV R0, R3 ; Rd = Op2
.text:000082E4 04 D0 4B E2 SUB SP, R11, #4 ; Rd = Op1 - Op2
.text:000082E8 00 88 BD E8 LDMFD SP!, {R11,PC} ; Load Block from Memory
.text:000082E8 ; End of function main
.text:000082EC 6C FE 06 00 off_82EC DCD aHiArmCode_ ; DATA XREF: main+24r
.text:000082EC ; "hi arm code.\r"
.text:000082F0 7C FE 06 00 off_82F0 DCD aPleaseInputANa ; DATA XREF: main+2Cr
.text:000082F0 ; "Please Input a Name:"
.text:000082F4 94 FE 06 00 off_82F4 DCD aD ; DATA XREF: main+38r
.text:000082F4 ; main+60r
.text:000082F4 ; "%d"
.text:000082F8 98 FE 06 00 off_82F8 DCD asc_6FE98 ; DATA XREF: main+4Cr
.text:000082F8 ; main+74r
.text:000082F8 ; "\r"
.text:000082FC 9C FE 06 00 off_82FC DCD aPleaseInputAPa ; DATA XREF: main+54r
.text:000082FC ; "Please Input a Password:"
.text:00008300 B8 FE 06 00 off_8300 DCD aDDD ; DATA XREF: main+94r
.text:00008300 ; "%d + %d = %d\r\n"
.text:00008304 DD 07 00 00 dword_8304 DCD 0x7DD ; DATA XREF: main+B8r
.text:00008308 C8 FE 06 00 off_8308 DCD aError ; DATA XREF: main+C4r
.text:00008308 ; "error\r"
.text:0000830C D0 FE 06 00 off_830C DCD aSuccess ; DATA XREF: main:loc_82D4r
.text:0000830C ; "success\r"
.text:00008310 ; =============== S U B R O U T I N E =======================================
.text:000082B8 ; ---------------------------------------------------------------------------
.text:000082B8 08 20 1B E5 LDR R2, [R11,#var_8] ; Load from Memory
.text:000082BC 40 30 9F E5 LDR R3, =0x7DD ; Load from Memory
.text:000082C0 03 00 52 E1 CMP R2, R3 ; Set cond. codes on Op1 - Op2
.text:000082C4 02 00 00 0A BEQ loc_82D4 ; Branch
.text:000082C8 38 00 9F E5 LDR R0, =aError ; "error\r"
.text:000082CC F1 0A 00 EB BL puts ; Branch with Link
.text:000082D0 01 00 00 EA B loc_82DC ; Branch
.text:000082D4 ; ---------------------------------------------------------------------------
.text:000081CC EXPORT IsAdd
.text:000081CC IsAdd ; CODE XREF: main+8Cp
.text:000081CC 04 B0 2D E5 STR R11, [SP,#-4]! ; Store to Memory
.text:000081D0 00 B0 8D E2 ADD R11, SP, #0 ; Rd = Op1 + Op2
.text:000081D4 0C D0 4D E2 SUB SP, SP, #0xC ; Rd = Op1 - Op2
.text:000081D8 08 00 0B E5 STR R0, [R11,#-8] ; Store to Memory
.text:000081DC 0C 10 0B E5 STR R1, [R11,#-0xC] ; Store to Memory
.text:000081E0 08 30 1B E5 LDR R3, [R11,#-8] ; Load from Memory
.text:000081E4 00 20 93 E5 LDR R2, [R3] ; Load from Memory
.text:000081E8 0C 30 1B E5 LDR R3, [R11,#-0xC] ; Load from Memory
.text:000081EC 00 30 93 E5 LDR R3, [R3] ; Load from Memory
.text:000081F0 03 30 82 E0 ADD R3, R2, R3 ; Rd = Op1 + Op2
.text:000081F4 03 00 A0 E1 MOV R0, R3 ; Rd = Op2
.text:000081F8 00 D0 8B E2 MOV SP, R11 ; Rd = Op2
.text:000081FC 04 B0 9D E4 LDR R11, [SP],#4 ; Load from Memory
.text:00008200 1E FF 2F E1 BX LR ; Branch to/from Thumb mode
ROM:9D039D3C 108 1C 00 00 1A BNE loc_9D039DB4 ; Branch
(9D039DB4 - 9D039D3C) / 4 - 2 = 1c
9D039D3C + (1c + 2) * 4 = 9D039DB4
ROM:9D039D90 108 07 00 00 EA B loc_9D039DB4 ; Branch
(9D039DB4 - 9D039D90) / 4 - 2 = 7
9D039D90 + (7 + 2) * 4 = 9D039DB4
000081CC 04 B0 2D E5 STR R11, [SP,#-4+var_s0]! ; Store to Memory
.rodata:00072320 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.rodata:00072324 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.rodata:00072328 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.rodata:0007232C 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.rodata:00072330 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.rodata:00072334 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.rodata:00072338 02 02 02 02 ANDEQ R0, R2, #0x20000000 ; Rd = Op1 & Op2
.text:0000AE98 puts ; CODE XREF: main+28p
.text:0000AE98 ; main+50p ...
.text:0000AE98 F0 47 2D E9 STMFD SP!, {R4-R10,LR} ; Alternative name is '_IO_puts'
.text:0000AE9C 00 90 A0 E1 MOV R9, R0 ; Rd = Op2
.text:0000AEA0 1E 27 00 EB BL strlen ; Branch with Link
.text:0000AEA4 3C 72 9F E5 LDR R7, =stdout ; Load from Memory
.text:0000AEA8 00 60 97 E5 LDR R6, [R7] ; Load from Memory
.text:0000AEAC 00 40 96 E5 LDR R4, [R6] ; Load from Memory
.text:0000AEB0 02 49 14 E2 ANDS R4, R4, #0x8000 ; Rd = Op1 & Op2
.text:0000AEB4 00 A0 A0 E1 MOV R10, R0 ; Rd = Op2
.text:0000AEB8 59 00 00 1A BNE loc_B024 ; Branch
.text:0000AEBC 48 50 96 E5 LDR R5, [R6,#0x48] ; Load from Memory
.text:0000AEC0 B2 FD FF EB BL __aeabi_read_tp ; Branch with Link
.text:0000AEC4 08 30 95 E5 LDR R3, [R5,#8] ; Load from Memory
.text:0000AEC8 13 8D 40 E2 SUB R8, R0, #0x4C0 ; Rd = Op1 - Op2
.text:0000AECC 08 00 53 E1 CMP R3, R8 ; Set cond. codes on Op1 - Op2
.text:0000AED0 0E 00 00 0A BEQ loc_AF10 ; Branch
.text:0000AED4 01 10 A0 E3 MOV R1, #1 ; Rd = Op2
.text:0000AED8 05 20 A0 E1 MOV R2, R5 ; Rd = Op2
...
...
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)