Created
April 16, 2021 02:01
-
-
Save vxcute/19c0af6f92ce45f16cccf89acc608b66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using PeNet.FileParser; | |
using PeNet; | |
using PeNet.Header; | |
namespace PEFun | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var PeHeader = new PeFile("C:\\WINDOWS\\system32\\kernel32.dll"); | |
var NumberOfFunctions = PeHeader.ImageExportDirectory.NumberOfFunctions; | |
var exports = PeHeader.ExportedFunctions; | |
foreach (var i in exports) | |
Console.WriteLine(i.Name + " => " + HashAPI(i.Name)); | |
} | |
static UInt64 HashAPI(string api) | |
{ | |
UInt64 Hash = 0x1337; | |
for (int i = 0; i < api.Length; i++) | |
{ | |
Hash += (Hash * 0xDEEDBEEF + api[i] & 0xffffff); | |
} | |
return Hash; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment