mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
feature: make exe to UI
This commit is contained in:
@@ -120,6 +120,12 @@ class SuperPe():
|
||||
self.pe.set_bytes_at_offset(sect.PointerToRawData, data)
|
||||
|
||||
|
||||
def patch_subsystem(self):
|
||||
if self.pe.OPTIONAL_HEADER.Subsystem != pefile.SUBSYSTEM_TYPE['IMAGE_SUBSYSTEM_WINDOWS_GUI']:
|
||||
logger.info("EXE is not a GUI application. Patching subsystem to GUI")
|
||||
self.pe.OPTIONAL_HEADER.Subsystem = pefile.SUBSYSTEM_TYPE['IMAGE_SUBSYSTEM_WINDOWS_GUI']
|
||||
|
||||
|
||||
## PE Specific Information
|
||||
|
||||
def get_base_relocs(self) -> List[PeRelocEntry]:
|
||||
|
||||
@@ -112,6 +112,9 @@ def inject_exe(
|
||||
injected_fix_iat(superpe, project.carrier, project.exe_host)
|
||||
injected_fix_data(superpe, project.carrier, project.exe_host)
|
||||
|
||||
# changes from console to UI (no console window) if necessary
|
||||
superpe.patch_subsystem()
|
||||
|
||||
# We done
|
||||
superpe.write_pe_to_file(exe_out)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user