0

Let's say that I have a simple executable and I want to find the address of the main. Usually, I take the address from the objdump output, and then I use it in my pwn script. I want to make my script more generic without using any of the hardcoded values from objdump. Is there any way to do this with pwn?

Mocanu Gabriel
  • 490
  • 5
  • 19

1 Answers1

4

I found that I can use ELF object and print addresses for all symbols. You can find more information here, but a simple example would be:

Find the address for main:

elf = ELF('./path_to_your_executable')
addr_main = elf.symbols['main']
Mocanu Gabriel
  • 490
  • 5
  • 19