1
0
Fork 0
mirror of https://github.com/hdbg/pape synced 2026-01-15 13:31:41 +00:00
No description
Find a file
2023-01-16 20:35:18 +02:00
src fix 2023-01-16 20:35:18 +02:00
tests Remove trash and add opts 2023-01-14 22:15:45 +02:00
.gitignore Update .gitignore 2023-01-14 22:16:06 +02:00
LICENSE Create LICENSE 2023-01-02 14:53:18 +02:00
pape.nimble bump 2023-01-16 20:11:19 +02:00
README.md Update .gitignore, README.md, and pape.nimble 2023-01-02 14:48:35 +02:00

pape

Pure Nim PE parsing library

How-to use

import pape
import std/[times, strutils, options]

var img = PEImage.newFromFile(r"C:\Windows\System32\kernel32.dll")

echo img.magic == PEMagic.PE64 # true
echo $img.timestamp            # 2038-08-04T14:50:58+03:00

echo img.ver.image             # (major: 10, minor: 0)
echo toHex img.entryPoint      # 0x0000000000015640

for importMod in img.imports:
  echo importMod.name          # api-ms-win-core-rtlsupport-l1-1-0.dll, etc...

# GetThreadId, LocalFree, LocalHandle etc...
for exportEntry in img.exports.entries: 
  if exportEntry.name.isSome:
    echo get(exportEntry.name)