similar to: [LLVMdev] Using LLVM for decompiling.

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Using LLVM for decompiling."

2012 May 07
0
[LLVMdev] Using LLVM for decompiling.
On 5/7/12 5:47 AM, James Courtier-Dutton wrote: > Hi, > > I am writing a decompiler. I was wondering if some of LLVM could be > used for a decompiler. > There are several stages in the decompiler process. > 1) Take binary and create a higher level representation of it. Like RTL. > 2) The output is then broken into blocks or nodes, each block ends in > a CALL, JMP, RET, or
2012 May 07
6
[LLVMdev] Using LLVM for decompiling.
On 7 May 2012 16:31, John Criswell <criswell at illinois.edu> wrote: > On 5/7/12 5:47 AM, James Courtier-Dutton wrote: >> >> Hi, >> >> I am writing a decompiler. I was wondering if some of LLVM could be >> used for a decompiler. >> There are several stages in the decompiler process. >> 1) Take binary and create a higher level representation of it.
2012 May 07
0
[LLVMdev] Using LLVM for decompiling.
> -----Original Message----- > On Behalf Of James Courtier-Dutton > To: John Criswell > > On 7 May 2012 16:31, John Criswell <criswell at illinois.edu> wrote: > > On 5/7/12 5:47 AM, James Courtier-Dutton wrote: > >> > >> Hi, > >> > >> I am writing a decompiler. I was wondering if some of LLVM could be > >> used for a
2012 May 07
0
[LLVMdev] Using LLVM for decompiling.
On 5/7/2012 11:45 AM, James Courtier-Dutton wrote: > On 7 May 2012 16:31, John Criswell<criswell at illinois.edu> wrote: >> Given that you've completed steps one and two (i.e., you've converted the >> binary instructions to LLVM IR and then discovered basic blocks), then yes, >> LLVM's current analysis passes should help you with this third step. LLVM
2013 Mar 12
6
[LLVMdev] help decompiling x86 ASM to LLVM IR
Hi, I am looking to decompile x86 ASM to LLVM IR. The original C is this: int test61 ( unsigned value ) { int ret; if (value < 1) ret = 0x40; else ret = 0x61; return ret; } It compiles with GCC -O2 to (rather cleverly removing any branches): 0000000000000000 <test61>: 0: 83 ff 01 cmp $0x1,%edi 3:
2012 Sep 13
5
[LLVMdev] [OT] Control Flow Graph(CFG) into Abstract Syntax Tree(AST)
Hi, I know most compilers go from AST to CFG. I am writing a decompiler, so I was wondering if anyone knew of any documents describing how best to get from CFG to AST. The decompiler project is open source. https://github.com/jcdutton/libbeauty The decompiler already contains a disassembler and a virtual machine resulting in an annotated CFG. It uses information gained from using a virtual
2013 Mar 12
0
[LLVMdev] help decompiling x86 ASM to LLVM IR
James Courtier-Dutton <james.dutton at gmail.com> writes: > I am looking to decompile x86 ASM to LLVM IR. > The original C is this: > int test61 ( unsigned value ) { > int ret; > if (value < 1) > ret = 0x40; > else > ret = 0x61; > return ret; > } > > It compiles with GCC -O2 to (rather
2013 Mar 12
4
[LLVMdev] help decompiling x86 ASM to LLVM IR
On 12 March 2013 16:39, Óscar Fuentes <ofv at wanadoo.es> wrote: > > This is not possible, except for specific cases. > > Consider this code: > > long foo(long *p) { > ++p; > return *p; > } > > The X86 machine code would do something like > > add %eax, 4 > > for `++p', but for x86_64 it would be > > add %rax, 8 > > But you
2013 Apr 21
2
[LLVMdev] Testing methods
Hi, What does llvm use for testing. The area of testing I am interested in are how to test the accuracy of the assembler/disassembler. So, if you take an IR level instruction. How do you verify that the generated CPU specific instruction is correct? Is there an automated method for this? I wish to implement automated testing on a decompiler I am writing, and thought that the test methods used in
2013 Jun 28
3
[LLVMdev] Question regarding the x86 SBB instruction.
Hi, I have the x86 SBB instruction. how should I represent this in LLVM IR. (as part of a decompiler from binary to LLVM IR) Pre-conditions: %eax = 0xffffffff %edx = 0xffffffff %carry = 1 SBB %eax, %edx // %edx is the destination doing %edx = %edx - (%eax + carry) JC jump_destination1 // If the Carry flag is set, jump to jump_destination1 How do I represent this correctly in LLVM
2013 Mar 12
0
[LLVMdev] help decompiling x86 ASM to LLVM IR
On 3/12/2013 11:55 AM, James Courtier-Dutton wrote: > I already know how to handle the case you describe. > I am not converting ASM to LLVM IR without doing quite a lot of analysis first. > 1) I can already tell if a register is refering to a pointer or an > integer based on how it is used. Does it get de-referenced or not? So, > I would know that "p" is a pointer. What if
2013 Mar 12
1
[LLVMdev] help decompiling x86 ASM to LLVM IR
On 12 March 2013 17:10, Joshua Cranmer 🐧 <Pidgeot18 at gmail.com> wrote: > On 3/12/2013 11:55 AM, James Courtier-Dutton wrote: >> > >> 2) From the binary, I would know if it was for 32bit or 64bit. >> 3) I could then use (1) and (2) to know if "add %rax, 8" is "p = p + >> 1" (64bit long), or "p = p + 2(32bit long)" >> >>
2013 Jun 28
0
[LLVMdev] Question regarding the x86 SBB instruction.
Look at the __builtin_addc* builtins in clang. I am currently working on an optimization which transforms said intrinsics into chains of ADCs/SBBs. Michael On Jun 28, 2013, at 5:51 AM, James Courtier-Dutton <james.dutton at gmail.com> wrote: > Hi, > > I have the x86 SBB instruction. how should I represent this in LLVM > IR. (as part of a decompiler from binary to LLVM IR)
2012 Sep 21
1
[LLVMdev] [OT] Control Flow Graph(CFG) into Abstract Syntax Tree(AST)
On 21 September 2012 09:51, Ralf Karrenberg <Chareos at gmx.de> wrote: > Hi, > > Simon Moll (in CC) has written a decompiler for LLVM in his Bachelor's > Thesis here at Saarland University. The thesis is titled "Decompilation of > LLVM IR" and can be found here: > http://www.cdl.uni-saarland.de/publications/ > > The library he implemented is called
2013 Mar 12
1
[LLVMdev] help decompiling x86 ASM to LLVM IR
On 3/12/13 11:39 AM, Óscar Fuentes wrote: > James Courtier-Dutton <james.dutton at gmail.com> writes: > >> I am looking to decompile x86 ASM to LLVM IR. >> The original C is this: >> int test61 ( unsigned value ) { >> int ret; >> if (value < 1) >> ret = 0x40; >> else >> ret =
2012 Sep 21
0
[LLVMdev] [OT] Control Flow Graph(CFG) into Abstract Syntax Tree(AST)
Hi, Simon Moll (in CC) has written a decompiler for LLVM in his Bachelor's Thesis here at Saarland University. The thesis is titled "Decompilation of LLVM IR" and can be found here: http://www.cdl.uni-saarland.de/publications/ The library he implemented is called "Axtor" (for "AST Extractor") and has been used primarily to generate OpenCL code from LLVM. In
2017 Nov 17
4
Signed or unsigned EQ/NEQ
Hello, In one of the loop transformations I am developing, I need to convert eq and neq loop latch condition into less than or greater than depending on the control flow. The problem is that CmpInst::ICMP_EQ and CmpInst::ICMP_NE are neither signed nor unsigned in LLVM. Also, I did not find a way to find out if the integer operands of the CmpInst are signed or unsigned. Apparently, LLVM does
2013 Sep 15
2
[LLVMdev] LLVM disassembler bugs
The attached patch includes no test-case and isn't consistent with the rest of the file: - constants should be on the right hand side of comparisons - the braces around your single line 'if' aren't needed. On Sun, Sep 15, 2013 at 2:39 PM, James Courtier-Dutton < james.dutton at gmail.com> wrote: > I attach a patch that fixes this bug. Applies to llvm 3.4svn > >
2013 Mar 12
0
[LLVMdev] help decompiling x86 ASM to LLVM IR
On 3/12/2013 11:20 AM, James Courtier-Dutton wrote: > It compiles with GCC -O2 to (rather cleverly removing any branches): > 0000000000000000 <test61>: > 0: 83 ff 01 cmp $0x1,%edi > 3: 19 c0 sbb %eax,%eax > 5: 83 e0 df and $0xffffffdf,%eax > 8: 83 c0 61 add $0x61,%eax >
2013 Sep 13
3
[LLVMdev] LLVM disassembler bugs
Hi, I am looking at the "LLVMOpInfoCallback GetOpInfo" callback. Example 1 GOOD: 41 c6 84 24 16 04 00 00 0c : movb $12, 1046(%r12) Makes calls to the callback with: Offset = 0x4, Size = 0x4 <- Octets: 16 04 00 00 Offset = 0x8, Size = 0x1 <- Octets: 0c That was correct. Example 2 BAD: c7 45 98 a1 ff ff ff : movl $4294967201, -104(%rbp) Makes calls to the callback