Skip to content

Instantly share code, notes, and snippets.

@oupo
Created March 31, 2010 11:36
Show Gist options
  • Save oupo/350209 to your computer and use it in GitHub Desktop.
Save oupo/350209 to your computer and use it in GitHub Desktop.
:0201FA20 B430 push {r4,r5}
:0201FA22 490C ldr r1,[PC,#0x30] ;PC+0x30=*(0x0201fa56)=#-335543779(0xec00021d)
:0201FA24 2427 mov r4,#0x27 ;r4 = 39(0x00000027)
:0201FA26 6088 str r0,[r1,#0x8] ;r1+0x8=*(0xec000225)
:0201FA28 490B ldr r1,[PC,#0x2c] ;PC+0x2c=*(0x0201fa58)=#34663424(0x0210ec00)
:0201FA2A 2001 mov r0,#0x1 ;r0 = 1(0x00000001)
:0201FA2C 6008 str r0,[r1,#0x0] ;r1+0x0=*(0x0210ec00)= write #1(0x00000001)
:0201FA2E 490B ldr r1,[PC,#0x2c] ;PC+0x2c=*(0x0201fa5e)=#-1989869027(0x8965021d)
:0201FA30 4B0B ldr r3,[PC,#0x2c] ;PC+0x2c=*(0x0201fa60)=#1812433253(0x6c078965)
:0201FA32 0124 lsl r4,r4,#0x4 ;r4 = 39 << 4 = 624(0x00000270)
:0201FA34 1F0A sub r2,r1,#0x4 ;r2 = -1989869031(0x89650219)
:0201FA36 6815 ldr r5,[r2,#0x0] ;r2+0x0=*(0x89650219)
:0201FA38 0FAA lsr r2,r5,#0x1e ;r2 = -135716352 >> 30 = 3(0x00000003)
:0201FA3A 406A eor r2,r5 ;r2 = 3^-135716352(0x3^0xf7e92200) = -135716349(0xf7e92203)
:0201FA3C 1C15 mov r5,r2 ;r5 = -135716349(0xf7e92203)
:0201FA3E 435D mul r5,r3 ;r5 = -135716349*1812433253 = -1002240465(0xc443062f)
:0201FA40 1942 add r2,r0,r5 ;r2 = 5(0x00000005)
:0201FA42 1C40 add r0,r0,#0x1 ;r0 = 2(0x00000002)
:0201FA44 C104 stmia r1!,{r2}
:0201FA46 42A0 cmp r0,r4 ;if(2 : 624)
:0201FA48 DBF4 blt 0201FA34
:0201FA4A 4903 ldr r1,[PC,#0xc] ;PC+0xc=*(0x0201fa5a)=#183501328(0x0af00210)
:0201FA4C 6008 str r0,[r1,#0x0] ;r1+0x0=*(0x0af00210)= write #2(0x00000002)
:0201FA4E BC30 pop {r4,r5}
:0201FA50 4770 bx r14 ;jump to addr 0201E9BE
:0201FA52 46C0
:0201FA54 0AE4
:0201FA56 021D
:0201FA58 EC00
:0201FA5A 0210
:0201FA5C 0AF0
:0201FA5E 021D
:0201FA60 8965
:0201FA62 6C07
直後の命令をE7FEに変更して実際にレジスタに格納された値を見てみた
0201FA22: r1の値=021d0ae4
0201FA2E: r1の値=021d0af0
0201FA4A: r1の値=0210ec00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment