Alexandre Gouraud
2009-Sep-29 10:14 UTC
[LLVMdev] converting x86 instructions to LLVM instructions
Dear all, I am studying a paper (cf below) that says they have written a piece of code to translate x86 instructions to LLVM. I am interested in this, and would like to write the same kind of thing, but not using QEMU as they claim in the paper, but rather with my own pin tool.>From what I have red until now on LLVM, and my relative poor knowledge ofassembly, I have the feeling that this is a huge task (many months of work). This holds me back to dig into it and I would well be encouraged if I knew that this is an easy thing for some of you, experts. If there was a public piece of code that does it already would be awesome of course. The paper is mentioning this (http://code.google.com/p/llvm-qemu/) but I am not sure it would lead me where I want. Any comment welcome. ( http://wwwse.inf.tu-dresden.de/hotdep/S2-1-candea-cameraReady_HotDep_2009.pdf) -- Alexandre -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090929/2edf8fcb/attachment.html>
Timo Juhani Lindfors
2009-Sep-29 11:14 UTC
[LLVMdev] converting x86 instructions to LLVM instructions
Alexandre Gouraud <alexandre.gouraud at enst-bretagne.fr> writes:> like to write the same kind of thing, but not using QEMU as they claim in > the paper, but rather with my own pin tool.You could also use valgrind to convert x86 to valgrind's IR and then write a tool to convert that IR to LLVM.
Alexandre Gouraud
2009-Sep-29 12:21 UTC
[LLVMdev] converting x86 instructions to LLVM instructions
Hi Timo, Thanks for commenting. I feel like I have to justify why I don't want to use QEMU, which is fine since my choice is not frozen actually. QEMU is much more than what I need for dynamically instrumenting software. My goal is automated testing to find bugs, which can quickly be intensive in term of computational load. Thus I am trying to get the smallest (and fastest) tool. Even using QEMU, I am not sure the piece of code already exists. And if it does, I can still extract it and put where I want. My question is really : is it a long work (several months) or is it just a matter of two weeks? And if it does not already exists, could it mean it is a nonsense, then why? Finally about your proposition using valgrind, I think I will stick to windows tools because this is what I know better. But it was ironic, wasn't it? Alexandre. 2009/9/29 Timo Juhani Lindfors <timo.lindfors at iki.fi>> Alexandre Gouraud <alexandre.gouraud at enst-bretagne.fr> writes: > > like to write the same kind of thing, but not using QEMU as they claim in > > the paper, but rather with my own pin tool. > > You could also use valgrind to convert x86 to valgrind's IR and then > write a tool to convert that IR to LLVM. > > >-- Alexandre -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090929/7a3beba0/attachment.html>
Tilmann Scheller
2009-Sep-29 13:48 UTC
[LLVMdev] converting x86 instructions to LLVM instructions
Hi Alexandre, On Tue, Sep 29, 2009 at 12:14 PM, Alexandre Gouraud <alexandre.gouraud at enst-bretagne.fr> wrote:> I am studying a paper (cf below) that says they have written a piece of code > to translate x86 instructions to LLVM. I am interested in this, and would > like to write the same kind of thing, but not using QEMU as they claim in > the paper, but rather with my own pin tool. > > From what I have red until now on LLVM, and my relative poor knowledge of > assembly, I have the feeling that this is a huge task (many months of work). > This holds me back to dig into it and I would well be encouraged if I knew > that this is an easy thing for some of you, experts. If there was a public > piece of code that does it already would be awesome of course. The paper is > mentioning this (http://code.google.com/p/llvm-qemu/) but I am not sure it > would lead me where I want.Changing llvm-qemu to use x86 is a matter of a few hours (only trivial changes to the source code are required). Nevertheless, I believe valgrind is a better choice for you if your goal is dynamic binary instrumentation (simply because it was designed for this purpose). However, it also depends on whether you want to generate LLVM IR or not. If you do, llvm-qemu might be the better choice. Are there particular reasons why you want to translate to LLVM IR? (E.g. the authors of the paper wanted to be able to use KLEE with machine code) Cheers, Tilmann
Alexandre Gouraud
2009-Sep-29 14:17 UTC
[LLVMdev] converting x86 instructions to LLVM instructions
> > > Are there particular reasons why you want to translate to LLVM IR? > (E.g. the authors of the paper wanted to be able to use KLEE with > machine code) > > Hi TilmannI want to do the same. Using KLEE with machine code. With such a framework, I could try to do the same that what is explained here : http://research.microsoft.com/en-us/um/people/pg/public_psfiles/ndss2008.pdf But as you can deduce from the url, nothing is open source there. For this I need an IR I can work on easily, and I think LLVM is a good candidate. What about your llvm-qemu implementation? You are the author aren't you? I could not understand from the progress status if this x86 to LLVM translation worked or not. -- Alexandre -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090929/e0538e42/attachment.html>
Possibly Parallel Threads
- [LLVMdev] converting x86 instructions to LLVM instructions
- [LLVMdev] converting x86 instructions to LLVM instructions
- [LLVMdev] converting x86 instructions to LLVM instructions
- [LLVMdev] converting x86 instructions to LLVM instructions
- [LLVMdev] llvm-qemu. (Was: Newbie)