mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
refactor: derbackdoorer / mype / injector (temp)
This commit is contained in:
@@ -24,6 +24,7 @@ class MyPe():
|
||||
def __init__(self):
|
||||
self.pe = None
|
||||
|
||||
|
||||
def openFile(self, infile):
|
||||
self.pe = pefile.PE(infile, fast_load=False)
|
||||
self.pe.parse_data_directories()
|
||||
@@ -53,6 +54,18 @@ class MyPe():
|
||||
return None
|
||||
|
||||
|
||||
def get_code_section_data(self) -> bytes:
|
||||
sect = self.get_code_section()
|
||||
print("CODE GET: {}".format(len(sect.get_data())))
|
||||
return bytes(sect.get_data())
|
||||
|
||||
|
||||
def write_code_section_data(self, data: bytes):
|
||||
sect = self.get_code_section()
|
||||
print("CODE SET {} {}".format(len(data), sect.PointerToRawData))
|
||||
self.pe.set_bytes_at_offset(sect.PointerToRawData, data)
|
||||
|
||||
|
||||
def getSectionIndexByDataDir(self, dirIndex):
|
||||
addr = self.pe.OPTIONAL_HEADER.DATA_DIRECTORY[dirIndex].VirtualAddress
|
||||
|
||||
|
||||
Reference in New Issue
Block a user