Git Product home page Git Product logo

Comments (2)

artemdinaburg avatar artemdinaburg commented on April 28, 2024

I can reproduce your problem.

Working on a fix, hoping it'll be quick since I think most of the internals should support 64-bit jump tables, just that the cfg recovery and some checks aren't updated to handle them.

I'm also using a build of thttpd -- but its probably too complex to re-emit and still function. If you have a smaller example that has the same behavior, I can add it to the mcsema tests.

from mcsema.

artemdinaburg avatar artemdinaburg commented on April 28, 2024

Fixed the initial issue, but can't confirm how well until we can get a smaller example. Its possible to get output bitcode now, though.

So the bitcode you get for thttpd wont be re-build into a working thttpd. To get runnable bitcode mcsema will need to get better ELF support, like processing .init and add support for callbacks of translated functions, as thttpd looks like it uses threading.

to get some bitcode:

source env.sh

# foo.txt will contain the cfg recovery log
IDALOG=`pwd`/foo.txt ${BIN_DESCEND_PATH}/bin_descend_wrapper.py -d -march=x86-64 -func-map=<path to mcsema>/mc-sema/std_defs/std_defs.txt -entry-symbol=main -i=thttpd > foo.txt

#currently you need -ignore-unsupported since there's a few missing instructions, but you'll get some output bitcode
${CFG_TO_BC_PATH}/cfg_to_bc -mtriple=x86_64-pc-linux-gnu --ignore-unsupported -i thttpd.cfg -driver=mcsema_main,main,raw,return,C -o thttpd.bc

The unsupported instructions are mostly 64-bit versions of things like XOR, CMP, etc. All thats really needed is just to add them to the translation mapping. I already did a few for SUB/SBB and CMOV, which came up a lot. The new instructions also need unit tests.

from mcsema.

Related Issues (20)

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.