<div dir="ltr">Thanks,<div><br></div><div>I've applied option #3 in r277298.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 12:10 PM, Bandzi Michal <span dir="ltr"><<a href="mailto:xbandz00@stud.fit.vutbr.cz" target="_blank">xbandz00@stud.fit.vutbr.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To close this I prepared 3 patches for removed LUT problem. I will leave the final decision to you.<br>
<br>
removed_lut_fix_1.diff<br>
My first proposed solution. Uses primarily LUT, as it gets never overwritten. When LUT is missing IAT is used instead.<br>
Advantages: robust.<br>
Disadvantages: little bit more complicated.<br>
<br>
removed_lut_fix_2.diff<br>
Your idea to ignore LUT and use IAT all the time. This should work in 99,9999% cases. I checked over 10k binaries and IAT does not get removed.<br>
Advantages: very simple, should work (for now).<br>
Disadvantages: IAT may be a problem - overwritten or removed, we  did not find such a binary yet though.<br>
<br>
removed_lut_fix_3.diff<br>
Same as second solution, but it is also contains iterators and range for LUT as alternative.<br>
<br>
We will be happy with all of them (until some binary with problematic IAT appears).<span><font color="#888888"><br>
<br>
Michal Bandzi</font></span><div><div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Jul 4, 2016 at 9:52 PM, David Majnemer <<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Mon, Jul 4, 2016 at 2:10 PM, Bandzi Michal <<a href="mailto:xbandz00@stud.fit.vutbr.cz" target="_blank">xbandz00@stud.fit.vutbr.cz</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Unless I made some logical error I can't see, it should work that way,<br>
doesn't it?<br>
<br>
if (lookupTable)<br>
  return func(lookupTable, ...)<br>
return func(addressTable, ...)<br>
</blockquote>
<br>
<br>
I was trying to suggest that we ignore the lookup table case and just do:<br>
  return func(addressTable, ...)<br>
<br>
</blockquote>
<br>
<br>
Thinking about it some more... Let's just have two sets of functions, one<br>
for the lookupTable and one for the addressTable.<br>
Let's let the caller decide what information they are interested in :)<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
I wonder if we should just rely on the ImportAddressTableRVA instead of<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
first trying to use the ImportLookupTableRVA.<br>
<br>
What are your thoughts?<br>
<br>
On Mon, Jul 4, 2016 at 11:05 AM, Bandzi Michal <<br>
<a href="mailto:xbandz00@stud.fit.vutbr.cz" target="_blank">xbandz00@stud.fit.vutbr.cz</a>><br>
wrote:<br>
<br>
Cituji David Majnemer <<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Please clang-format the changes in your patch.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
</blockquote>
Not sure what exactly this means. Found and used this:<br>
<br>
<a href="http://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting</a><br>
then created a new patch<br>
<br>
Also, LLVM does not use else after a return:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return" rel="noreferrer" target="_blank">http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return</a><br>
<br>
<br>
</blockquote>
Hope this is better. New patch as attachement.<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
</div></div></blockquote></div><br></div></div>