Skip to content

Instantly share code, notes, and snippets.

@vxcute
Created April 16, 2021 02:01
Show Gist options
  • Save vxcute/19c0af6f92ce45f16cccf89acc608b66 to your computer and use it in GitHub Desktop.
Save vxcute/19c0af6f92ce45f16cccf89acc608b66 to your computer and use it in GitHub Desktop.
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