diff --git a/modules/processing/parsers/malwareconfig/TrickBot.py b/modules/processing/parsers/malwareconfig/TrickBot.py index 3145f5023..8a7fa8e63 100644 --- a/modules/processing/parsers/malwareconfig/TrickBot.py +++ b/modules/processing/parsers/malwareconfig/TrickBot.py @@ -99,13 +99,16 @@ def get_rsrc(pe): ret.append((name,data,resource_lang.data.struct.Size,resource_type)) return ret +def va_to_fileoffset(pe, va): + rva = va - pe.OPTIONAL_HEADER.ImageBase + for section in pe.sections: + if rva >= section.VirtualAddress and rva < section.VirtualAddress + section.Misc_VirtualSize: + return rva - section.VirtualAddress + section.PointerToRawData + def decode_onboard_config(data): try: pe = pefile.PE(data=data) rsrcs = get_rsrc(pe) - for section in pe.sections: - if b".text" in section.Name: - delta = pe.OPTIONAL_HEADER.ImageBase + section.VirtualAddress - section.PointerToRawData except: return @@ -130,9 +133,10 @@ def decode_onboard_config(data): return offset = int(snippet['$snippet1']) key_len = struct.unpack("