<div dir="ltr">Hi All,<div><br></div><div>Is this possible to generate LLVM IR from any static/dynamic link library?</div><div>I have some static and dynamic link library and I want to generate LLVM IR as I want to obfuscate these libraries.</div><div>Is there any way to do the same.</div><div><br></div><div>Please give me some pointers on this.</div><div><br></div><div>Thanks,</div><div>Deep</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 28, 2015 at 9:04 AM, Sandeep Kumar Singh <span dir="ltr"><<a href="mailto:deepdondo007@gmail.com" target="_blank">deepdondo007@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Tim,<div><br></div><div>Thank you for reply.</div><span class=""><div><br></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">> llvm::Value *intermediateValue = LLVMIRBuilder->CreateLShr(</span><span style="color:rgb(80,0,80);font-size:12.8000001907349px">x64BitValue, 32);</span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"></div></span><div><font color="#500050"><span style="font-size:12.8000001907349px">Now I am using below to calculate upper 32bits, I think this is OK,</span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px"><div><span style="white-space:pre-wrap"> </span>llvm::Value *intermediateValue = LLVMIRBuilder->CreateAnd(x64BitValue, 0xFFFFFFFF00000000); </div><div><span style="white-space:pre-wrap"> </span>intermediateValue = LLVMIRBuilder->CreateLShr(intermediateValue, 32); </div><div>    //cast value to 32 bit</div><div>    intermediateValue = castValueByOpSize(intermediateValue, 32);</div><div><br></div><div><br></div><div>Regards,</div><div>Deep</div></span></font></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Sep 25, 2015 at 7:12 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 24 September 2015 at 22:12, Sandeep Kumar Singh via llvm-dev<br>
<span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> I need to fetch lower and higher 32bits from 64bit value. I found<br>
> "CreateLShr" function to fetch lower 32bits,<br>
> llvm::Value *intermediateValue = LLVMIRBuilder->CreateLShr(x64BitValue, 32);<br>
<br>
</span>That would give you the upper bits, I think.<br>
<span><br>
> What function I need to use for fetching upper 32bits from 64bit value.<br>
<br>
</span>There's multiple ways to get the other half: "x & 0xffffffff" is the<br>
canonical one (LLVM's optimisers will convert the others into that if<br>
they can).<br>
<br>
Cheers.<br>
<span><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><br>Thanks and Regards,<br>Sandeep Kumar Singh</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><br>Thanks and Regards,<br>Sandeep Kumar Singh</div>
</div>