소스
#include <stdio.h>
int main ()
{
printf("Hello World!\n");
}
objdump로 디스어셈블
addiu sp,sp,-32 : SP(stack pointer) = SP + (-32) (add immediate unsigned)
sw ra,28(sp) : memory[sp+28] = ra(return address) (store word)
sw s8,24(sp) : memory[sp+24] = s8(frame pointer)
move s8,sp : s8 = sp
lui v0,0x40 : v0 = 0x40 << 16 (load upper immediate)
addiu a0,v0,2064 : a0 = v0 + 0x810
jal 400500 : jump 400500 (jump and link == procedure call)
move at,at : at = at
move sp,s8 : sp = s8
lw ra,28(sp) : ra = Memory[sp+28] (load word)
lw s8, 24(sp) : s8 = Memory[sp+24]
addiu sp,sp,32 : sp = sp+32
jr ra : goto address ra (jump register)
'List > Embedded' 카테고리의 다른 글
[mipsel] 기본 bof 취약점 공격 (0) | 2015.01.11 |
---|---|
[mipsel] shellcode 제작 - execve("/bin/sh", [/bin/sh, 0], 0) , 56byte (0) | 2015.01.11 |
[mipsel] add(a, b) 분석 (0) | 2014.12.26 |
[mipsel] execve 분석 (0) | 2014.12.26 |
임베디드 공부 계획[cd80] (0) | 2014.12.25 |