Created
March 29, 2017 12:40
-
-
Save huhuang03/c7cb647b374e01513a4e58c47d1b3306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# R0 - R11 为寄存器 | |
# BL 表示调用子程序 | |
# puts 表示标准函数printf的实现 | |
EXPORT main # IDA 生成,函数名称 | |
main # 函数名称 | |
var_C = -0xc # variable var_c = -0xc | |
var_8 = -8 # variable var_8 = -8 | |
STMFD SP!, {R11,LR} # 将寄存器入栈 | |
ADD R11, SP, #4 # R11 = [SP] + 4 | |
SUB SP, SP, #8 # SP = [SP] + 8 | |
STR R0, [R11, #var_8] # var_8 = [R0] | |
STR R1, [R11, #var_C] # var_c = [R1] | |
LDR R3, =(aHelloArm - 0x8300) # R3 = [aHelloArm - 0x8300]? | |
ADD R3, PC, R3 ; "Hello ARM!" | |
MOV R0, R3 ; s | |
BL puts ; BL表示调用子程序 BL puts 调用标准函数printf的实现 | |
MOV R3, #0 | |
MOV R0, R3 | |
SUB SP, R11, #4 | |
LDMFD SP!, {R11, PC} | |
# include <stdio.h> | |
int main(int argc, char* argv[]) { | |
printf("Hello ARM!\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment