I am very new to python and I got a script at my job I need to figure out.
My script parses output of a some exe file (let’s call it Mywork.exe ) which processes another binary files (let’s call it processedBinary). Now, my scrpit at some point want’s to take the name of a processedBinary and do a objdump on it. I can see that previous author (for me unreachable) has used this line sys.argv[1] to get a name of processedBinary. My script processes the output of MyWork.exe. So far, the only way for me to call script successfully is by running:
MyWork.exe processedBinary | /usr/bin/python ./myScript.py -v
And then my script processes output correctly, but it doesn’t acquires the name of processedBinary at all (instead sys.argv[1] is actually “-v”). So, I have a couple of questions:
1) Is there a better way of running my script so that sys.argv[1] is name of processedBinary?
2) if the answer on previous question is no, is there a way to acquire name of processedBinary on some better way?
3) Do you have some better suggestions about the implementation/invocation of script, maybe?
Thank you in advance!
You could call MyWork.exe from the Python script and pass the name of processedBinary to that script.
output is now a tuple of stdout and stderr of MyWork.exe