ph4s3tw0 / GetProcAddressCaseStudies

Six cases demonstrating methods of optimizing GetProcAddress
GNU General Public License v3.0
17 stars 5 forks source link

A few thoughts #1

Open Genbox opened 2 years ago

Genbox commented 2 years ago

Hi hypervis0r and Jeff,

Interesting blogpost from you guys. A few things came to mind while reading it. Hope you don't mind me dumping a few of them here.

hypervis0r commented 2 years ago

Hey, thanks for your input!

  1. I definitely know that there are a few hashing algorithms that are way more optimized and efficient than DJB2 (murmurHash and xxHash are two that come to mind). However, this is simply meant to be a proof of concept to demonstrate that GetProcAddress could be made faster (and also I'm lazy). If you could write a PoC that uses a faster hash algorithm, I would love to see those results, but that goes beyond the scope of this PoC.

  2. I did some research into perfect hashing when writing case 6, as of course this would make sense in the terms of a constant-sized hash table. The main issue with perfect hashing is the fact that you need a different hash algorithm for all different combinations of input, and portability would be lost. I had a thought that maybe the hash function could be compiled into the PE binary itself, but I'm not sure about the feasibility of this.

  3. Of course these cases do not demonstrate search via ordinal, which is essential. They also do not support forwarders, which are also used often with Microsoft DLLs such as kernel32.dll. As I've said before, this is simply a proof of concept to demonstrate different search methods.