MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / ReadTEImageHeader

Method ReadTEImageHeader

view/pe/teview.cpp:21–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void TEView::ReadTEImageHeader(BinaryReader& reader, struct TEImageHeader& header)
22{
23 header.magic = reader.Read16();
24 header.machine = reader.Read16();
25 header.numberOfSections = reader.Read8();
26 header.subsystem = reader.Read8();
27 header.strippedSize = reader.Read16();
28 header.addressOfEntrypoint = reader.Read32();
29 header.baseOfCode = reader.Read32();
30 header.imageBase = reader.Read64();
31 header.dataDirectory[0].virtualAddress = reader.Read32();
32 header.dataDirectory[0].size = reader.Read32();
33 header.dataDirectory[1].virtualAddress = reader.Read32();
34 header.dataDirectory[1].size = reader.Read32();
35
36 m_logger->LogDebug(
37 "TEImageHeader:\n"
38 "\tmagic: 0x%04x\n"
39 "\tmachine: 0x%04x\n"
40 "\tnumberOfSections: 0x%02x\n"
41 "\tsubsystem: 0x%02x\n"
42 "\tstrippedSize: 0x%04x\n"
43 "\taddressOfEntrypoint: 0x%08x\n"
44 "\tbaseOfCode: 0x%08x\n"
45 "\timageBase: 0x%016x\n"
46 "\tdataDirectory[0].virtualAddress: 0x%08x\n"
47 "\tdataDirectory[0].size: 0x%08x\n"
48 "\tdataDirectory[1].virtualAddress: 0x%08x\n"
49 "\tdataDirectory[1].size: 0x%08x\n",
50 header.magic,
51 header.machine,
52 header.numberOfSections,
53 header.subsystem,
54 header.strippedSize,
55 header.addressOfEntrypoint,
56 header.baseOfCode,
57 header.imageBase,
58 header.dataDirectory[0].virtualAddress,
59 header.dataDirectory[0].size,
60 header.dataDirectory[1].virtualAddress,
61 header.dataDirectory[1].size
62 );
63}
64
65void TEView::ReadTEImageSectionHeaders(BinaryReader& reader, uint32_t numSections)
66{

Callers

nothing calls this directly

Calls 5

LogDebugMethod · 0.80
Read16Method · 0.45
Read8Method · 0.45
Read32Method · 0.45
Read64Method · 0.45

Tested by

no test coverage detected