Giter Site home page Giter Site logo

Comments (1)

hasherezade avatar hasherezade commented on May 26, 2024

I make checks for the cases which are the most casual.

So, it is gonna be a common error to supply a bad path to the PE file - that's why I make checks around opening file and reading from file (the access may be denied for whatever reasons). I don't do checks for the the things which are less casual, or corner cases (such as attempt to load big files which size cannot be retrieved by GetFileSize).

I do check for failure in relocating the PE - because some PEs has no relocation table, and in such case they will not be loadable by this way (as we cannot guarantee at which base we will be able to load them). Relocation will fail also if we try to load a PE of different bitness than a loader. Those are common cases the user of this tool will encounter while playing around with this code.

I want this code to be as simple as possible, so apart from those common things, I don't want to litter it by too many checks. Otherwise it may be difficult for the reader to sieve out what part of code is about processing the PE, and what is about error checking. I also wrote about it in the comment on the top of the file to make the purpose of this code clear.

/*
A demo PE-loader for the training: https://github.com/hasherezade/malware_training_vol1
WARNING: This is a basic example. For the sake of simplicity, some checks have been omitted.
*/

from malware_training_vol1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.