Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a solution tool to the "anvill-specify-bitcode(Currently unsupported)" #359

Open
Stephen-lei opened this issue Mar 2, 2023 · 1 comment

Comments

@Stephen-lei
Copy link

Hello, I am a user of Mcsema, and I have pushed some code to Mcsema before PL#780(which is not very important just a script).

and I want to contribute my tool to the community, is it ok? I am not sure my tool can be contributed to anvill project or Mcsema project。

During my use of Mcsema, I find that it can`t give out the correct parameters and return type of externally- defined functions in binaries (e.g. libc, libc++, libstdc++). Mcsema always completes the parameters with int64(as explained in the annotation, Mcsema supplies all the parameters with int and can pass nearly 80% of the test cases ). example as bellow:
image
as we all know cos comes a double and returns a double.
Although Mcsema leaves an interface --abi_loader and a generate_abi_wrapper.py, it still has some bugs with the above script, and the script can't deal with the C++ Name Mangling problem.

Inspired by the script, I write a tool that imports an elf file and outputs the complete details (in LLVM IR) of the external functions of the elf(with the help of readelf and clang). And my tool can deal with the C++ Name Mangling problem.
Here is an example。
the c++ source code is:
image

after compiler this source code into an elf, the symtable contains these external functions:
image

put this elf as input to my tool, part of the outputs are:
image
image

as we can see the outputs LLVM IR give the complete details of the external functions in this elf. and this file can be a input to Mcsema through --abi_loader。and this really works for Mcsema to lifting。my tool is automated.
in the previous issue in Mcsea #748, dear @pgoodman told me that Mcsema will no longer be maintained, and suggested me use the anvill. so i open an issue here and it seems that my tool may be a solution to the "anvill-specify-bitcode(Currently unsupported)" problem.
and I want to contribute my tool to the community, is it ok? I am not sure my tool can be contributed to anvill project or Mcsema project。
thank you very much!

@Stephen-lei
Copy link
Author

sorry, I find that the Mcsema project has been archived, I will create a pull request in anvill project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant