1

I have the following assembly code disassembled using capstone. I started with entry point obtained from header.

.text : 4195648
...
...
0x400584L lui $t9, 0x40
0x400588L addiu $t9, $t9, 0xba0
0x40058cL jalr $t9

How do I find which address jalr is pointing to? (I thought I could reach main function in C program)

Based on slide number 19 in this reference I made target = 0x0400ba0

I looked for it and found it in .plt section. Here is the disassembly of .plt

.plt : 4197152
...
...
0x400ba0L lui $t7, 0x41
0x400ba4L lw $t9, 0xbe4($t7)
0x400ba8L jr $t9
0x400bacL addiu $t8, $t7, 0xbe4

I am confused - How do I make sense of it. Or how can I reach actual main function in the MIPS disassembly

phuclv
  • 37,963
  • 15
  • 156
  • 475
hilly
  • 57
  • 4
  • _"How do I find which address jalr is pointing to?"_ Look up `lui` and `addiu` in a MIPS instruction set reference. – Michael Oct 21 '16 at 05:52
  • Just keep tracing through the code. You have `jalr 0x00400ba0` which leads you `jr 0x00410be4`. What is at that address? – markgz Oct 21 '16 at 21:12

0 Answers0