Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit for dissect.executable.pe #10

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dissect/executable/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from dissect.executable.elf import ELF
from dissect.executable.pe import PE

__all__ = [
"ELF",
"PE",
]
25 changes: 25 additions & 0 deletions dissect/executable/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,28 @@ class Error(Exception):

class InvalidSignatureError(Error):
"""Exception that occurs if the magic in the header does not match."""


class InvalidPE(Error):
"""Exception that occurs if the PE signature does not match."""


class InvalidVA(Error):
"""Exception that occurs when a virtual address is not found within the PE sections."""


class InvalidAddress(Error):
"""Exception that occurs when a raw address is not found within the PE file when translating from a virtual
address."""


class InvalidArchitecture(Error):
"""Exception that occurs when an invalid value is encountered for the PE architecture types."""


class BuildSectionException(Error):
"""Exception that occurs when the section to be build contains an error."""


class ResourceException(Error):
"""Exception that occurs when an error is thrown parsing the resources."""
25 changes: 25 additions & 0 deletions dissect/executable/pe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from dissect.executable.pe.helpers.builder import Builder
from dissect.executable.pe.helpers.exports import ExportFunction, ExportManager
from dissect.executable.pe.helpers.imports import (
ImportFunction,
ImportManager,
ImportModule,
)
from dissect.executable.pe.helpers.patcher import Patcher
from dissect.executable.pe.helpers.resources import Resource, ResourceManager
from dissect.executable.pe.helpers.sections import PESection
from dissect.executable.pe.pe import PE

__all__ = [
"Builder",
"ExportFunction",
"ExportManager",
"ImportFunction",
"ImportManager",
"ImportModule",
"Patcher",
"PE",
"PESection",
"Resource",
"ResourceManager",
]
Empty file.
Loading
Loading