dennydai / headless-ida Goto Github PK
View Code? Open in Web Editor NEWRun IDA scripts headlessly.
Home Page: https://pypi.org/project/headless-ida/
License: MIT License
Run IDA scripts headlessly.
Home Page: https://pypi.org/project/headless-ida/
License: MIT License
I'm trying to run IDA-Headless on a windows environment and it fails to start . Any idea ?
C:\Program Files\IDA Pro 7.7>headless-ida ida64.exe "C:\Users\me\Desktop\IDAPYTHON\sample.exe"
Traceback (most recent call last):
File "c:\users\me\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\me\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\me\AppData\Local\Programs\Python\Python39\Scripts\headless-ida.exe_main.py", line 7, in
File "c:\users\me\appdata\local\programs\python\python39\lib\site-packages\headless_ida\cli.py", line 21, in headlessida_cli
headlessida = HeadlessIda(args.idat_path, args.binary_path)
File "c:\users\me\appdata\local\programs\python\python39\lib\site-packages\headless_ida\client.py", line 45, in init
raise Exception(
Exception: IDA failed to start: return code 1
=============== STDOUT ===============
=============== STDERR ===============
This seems to require loading a binary directly into IDA, I am making this assumption based off the mandatory -o and -P+ flags.
Is there a way to just load an existing database, query information off it, and do not flush database content to disk?
Additionally, is there a way to initialize HeadlessIda without passing any binary paths provided there's a server running and we know the port?
Thank you!
Sorry just noticed the normal python standalone module works but when running through the server getting same Exception,.
Hello,
I was thinking of using this module to automate disassembling multiple files with the same idapython code.
However it seems that loading a file using HeadlessIda() constructor has no effect beyond the first call.
The issue can be reproduced with the following piece of code:
import os
import sys
# Initialize HeadlessIda
from headless_ida import HeadlessIda
IDA64 = "/home/myhome/idapro-7.5/ida64"
headlessida = HeadlessIda(IDA64, "") # run on empty file, needed for initialization to load ida imports
# Import IDA Modules (make sure you have initialized HeadlessIda first)
import ida_nalt
def idapython_run_on_file(file_path):
headlessida = HeadlessIda(IDA64, file_path)
print("Loading", file_path)
if os.path.basename(ida_nalt.get_input_file_path()) != os.path.basename(file_path):
print("ERROR! file", ida_nalt.get_input_file_path(), "loaded instead of", file_path)
sys.exit(1)
headlessida.conn.close()
if __name__ == "__main__":
files_to_analyze = ["/usr/bin/ls", "/usr/bin/cat"]
for f in files_to_analyze:
idapython_run_on_file(f)
Which outputs
Loading /usr/bin/ls
Loading /usr/bin/cat
ERROR! file /usr/bin/ls loaded instead of /usr/bin/cat
Interrestingly if the script is run a second time, the output is now
Loading /usr/bin/ls
ERROR! file /usr/bin/cat loaded instead of /usr/bin/ls
So there seems to be some sort of cache used by Ida that prevent loading new files (that need to be flushed somehow?), but i could not find out the exact cause of the issue...
HI there hope you are doing well
i wan to decomplie functions but i get error "Decompilation failed: ffffffffffffffff".
i run the same script in IDA PRO and it works, but it does not work with headless ida.
Thanks
Hi there i hope you are doing well
is there a way that i can read .pdb file beside .exe file?
I want to use headless-ida to auto load a file, then exec ida pro python3 plugin
i find “idaapi.load_and_run_plugin” can load C/C++ plugin but cann't load python3 script plugin
so it does not have to reanalyisis every time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.