Comments (6)
Thanks. But i am still getting the same error after that.
``llvm-mctoll: /data/llvm-project/llvm/tools/llvm-mctoll/X86/X86MachineInstructionRaiserUtils.cpp:1531: llvm::Function* llvm::mctoll::X86MachineInstructionRaiser::getTargetFunctionAtPLTOffset(const llvm::MachineInstr&, uint64_t): Assertion `(GotPltReloc->getType() == ELF::R_X86_64_JUMP_SLOT) && "Unexpected relocation type for PLT jmp instruction"' failed.
It appears that you need to pull the llvm-mctoll
repo as that line has been part of the change I pushed - see here. Rebuild llvm-mctoll
once you update your llvm-mctoll
repo.
I have verified that the change works using the sclang
binary you provided earlier before I pushed.
from llvm-mctoll.
Thanks so much. It worked. I was just pulling llvm project instead of llvm-mctoll. But i am getting this:
Unknown prototype for function : strcmp Use -I </full/path/to/file>, where /full/path/to/file declares its prototype
Do we need the include file to get the llvm IR? If we actually need to put it, does that mean some portion of source is needed to lift binary to IR? and when using the command "llvm-mctoll -d " yield the result in the interface itself?
You do not need any portion of the source file. You will need to provide the prototypes of externally linked functions (such as strcmp
) for llvm-mctoll
to help the process of raising as described here. llvm-mctoll
cannot figure out the prototypes of externally linked functions just using the binary.
For example, here is a portion of the file I created with external (i.e., glibc
) function prototypes to ensure that the tool makes progress beyond the assertion fix I made while raising your binary.
$ cat myinclude.h
#include <stddef.h>
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
char *strcpy(char *dest, const char *src);
size_t strlen(const char *s);
char *strndup(const char *s, size_t n);
char *strdup(const char *s);
$ llvm-mctoll -d -I /full/path/to/myinclude.h sclang
Please note that I have not added all the necessary prototypes. Please add any additional prototypes to check if your sclang
binary can be raised by llvm-mctoll
.
from llvm-mctoll.
Thanks for your interest in the project.
I have pushed a change to relax the assertion to handle the relocation type R_X86_64_GLOB_DAT
.
Let me know if that helps.
from llvm-mctoll.
Thanks. But i am still getting the same error after that.
``llvm-mctoll: /data/llvm-project/llvm/tools/llvm-mctoll/X86/X86MachineInstructionRaiserUtils.cpp:1531: llvm::Function* llvm::mctoll::X86MachineInstructionRaiser::getTargetFunctionAtPLTOffset(const llvm::MachineInstr&, uint64_t): Assertion `(GotPltReloc->getType() == ELF::R_X86_64_JUMP_SLOT) && "Unexpected relocation type for PLT jmp instruction"' failed.
*** Please submit an issue at https://github.com/microsoft/llvm-mctoll
*** along with a back trace and a reproducer, if possible.
Stack dump:
0. Program arguments: ./llvm-mctoll -d sclang
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH
to point to it):
0 llvm-mctoll 0x0000558dac9fca56
1 llvm-mctoll 0x0000558dac9fa43e
2 libc.so.6 0x00007f59c9caf520
3 libc.so.6 0x00007f59c9d03a7c pthread_kill + 300
4 libc.so.6 0x00007f59c9caf476 raise + 22
5 libc.so.6 0x00007f59c9c957f3 abort + 211
6 libc.so.6 0x00007f59c9c9571b
7 libc.so.6 0x00007f59c9ca6e96
8 llvm-mctoll 0x0000558dad04c36b
9 llvm-mctoll 0x0000558dad063c6f
10 llvm-mctoll 0x0000558dad02c3cd
11 llvm-mctoll 0x0000558dac19f51d
12 llvm-mctoll 0x0000558dac13f942
13 libc.so.6 0x00007f59c9c96d90
14 libc.so.6 0x00007f59c9c96e40 __libc_start_main + 128
15 llvm-mctoll 0x0000558dac18d1c5
Aborted (core dumped)
I have attached the file at the top if you want to recreate.
from llvm-mctoll.
Thanks so much. It worked. I was just pulling llvm project instead of llvm-mctoll. But i am getting this:
Unknown prototype for function : strcmp
Use -I </full/path/to/file>, where /full/path/to/file declares its prototype
Do we need the include file to get the llvm IR? If we actually need to put it, does that mean some portion of source is needed to lift binary to IR? and when using the command "llvm-mctoll -d " yield the result in the interface itself?
from llvm-mctoll.
Got it. Thanks so much.
from llvm-mctoll.
Related Issues (20)
- Demangle function symbol for signature when lifting C++ programs HOT 2
- Wrong lift result for nested "for" loops. HOT 2
- Unable to raise arm binary containing an array HOT 3
- Adapt mctoll to use Opaque pointers HOT 1
- This repo is missing important files
- Unknown prototype for function : _ZNSaIcEC1Ev HOT 1
- Failing to lift binaries HOT 2
- TEST8rr instruction failing to lift properly HOT 1
- Failed to lift binary (core dumped) HOT 1
- Failed to lift simple ARM binary HOT 1
- Build without LLVM source? HOT 1
- Supported LLVM version HOT 1
- assert failed at X86FuncPrototypeDiscovery.cpp:227 HOT 2
- Does Mctoll Translator support Weak Memory Model Architectures ? HOT 1
- cannot compile mctoll without assertions HOT 7
- Error when lifting. HOT 1
- is this project still on-going? HOT 1
- i need to install llvm mctoll HOT 3
- generate invalid llir instructions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llvm-mctoll.