2

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?

1 Answer 1

7

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']
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.