CrystalPE

CrystalPE is a windows PE parsing library for Crystal. This shard is designed with the goal of malware analysis/research and threat hunting capabilities. The lilbrary supports both x86/64 pe files.

Several executables are included in the "demope" folder. These were used for testing and can be built or downloaded for additional tests.

Installation

As with all crystal shards:

  1. Add the dependency to your shard.yml:

    dependencies:
      crystalpe:
        github: CausticKirbyZ/CrystalPE
  2. Run shards install

Usage

Example of itterating through the strings in a pe file to identify a potential compiler used:

require "crystalpe"

pefile = CrystalPE::PEFile.new( "HelloWorld.exe" )
pefile.strings().each do |str| 
    if str.includes? "GCC"
        puts "This file was likely compiled with GCC" 
    end 
end 

Supports:

Parsing:

Info:

Modifying

Some Support

ToDo:

Add parsing/classes for:

Add validation functions for checksums and offsets.

update the project to be more inline with crystal code guidelines.... yes im bad at things

document more things.

Feature Requests/Bugs

If you have feature requests / bugs submit an issue or (even better) a pull request.

if its a bug, please specify what it is, how you found it, and how it can be fixed(if you know).

For feature requests please describe in detail, the feature you want and the reason it should be in the core library.

Development

TODO Write development instructions here

Contributing

  1. Fork it (https://github.com/your-github-user/crystalpe/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

References: