sorry for the possibly-noobish question. I'm new to Angr and ran into a small issue/question. So, let's say I have a binary program, "mybinary", where I input something and it does some operations and checks against that to find a flag. (Normal crackme style.)
However, the program needs a string, tid, input when the program is first run. I have the tid, it's just a 32-bit string of letters and numbers.
So instead of "./mybinary", to run it, I have to do "./mybinary 'the tid string'".
How do I do that in the context of loading the file into an Angr project?
Like, if my angr code was something along the lines of:
import angr
import claripy
#Whatever variables.
base_addr = #Whatever the base address is.
proj = angr.Project("./mybinary", main_opts={'base_addr': base_addr})
#Some code for defining flag characters.
state = proj.factory.full_init_state(
args=['./mybinary'],
add_options=angr.options.unicorn,
stdin=flag,
)
#Some code to create and run simulation with success and failure.
How could I edit it so that it would run "./mybinary 'the tid string'" instead of just "./mybinary"?
Please and thank you for the help!
Here is how you should instantiate the state to suit your needs:
As per the documentation:
Furthermore, it does not seem like you need
full_init_state
in your case;entry_state
should suffice (same documentation):