fix: small bugfixes

This commit is contained in:
Dobin
2024-05-29 08:28:23 +01:00
parent 0e08fde15d
commit 854c41300e
4 changed files with 14 additions and 9 deletions
+3
View File
@@ -180,6 +180,9 @@ def convert_asm_db_to_bytes(line: str) -> bytes:
value += str.encode(part.split('\'')[1])
elif part.endswith('H') or part.endswith('H,'):
hex = part.split('H')[0]
if len(hex) == 3:
# 09cH,
hex = hex[1:]
value += bytes.fromhex(hex)
return value
+1 -1
View File
@@ -28,7 +28,7 @@ def inject_exe(main_shc: bytes, settings: Settings, carrier: Carrier):
shellcode_len = len(main_shc)
code_sect_size = carrier.superpe.get_code_section().Misc_VirtualSize
if shellcode_len + CODE_INJECT_SIZE_CHECK_ADD > code_sect_size:
raise Exception("Error: Shellcode size {}+{} too small for target code section {}".format(
raise Exception("Error: Shellcode size {}+{} too big for target code section {}".format(
shellcode_len, CODE_INJECT_SIZE_CHECK_ADD, code_sect_size
))