Coder Social home page Coder Social logo

dennydai / headless-ida Goto Github PK

View Code? Open in Web Editor NEW
62.0 3.0 5.0 288 KB

Run IDA scripts headlessly.

Home Page: https://pypi.org/project/headless-ida/

License: MIT License

Python 100.00%
headless hexrays ida ida-pro idapro idapython python linux windows

headless-ida's Introduction

profile pic

headless-ida's People

Contributors

dennydai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

headless-ida's Issues

IDA-Headless .. Windows ?

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 ===============

Support for pre-existing databases

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!

HEADLESS_IDA Windows Server

Sorry just noticed the normal python standalone module works but when running through the server getting same Exception,.

Cannot load a file with HeadlessIda() after the first

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...

Decompilation failed: ffffffffffffffff

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.