mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-31 03:10:03 +00:00
move magic check to PE layer
This commit is contained in:
+14
@@ -408,6 +408,20 @@ pe_subsystem_from_string(String8 string)
|
||||
////////////////////////////////
|
||||
//~ rjf: Parser Functions
|
||||
|
||||
internal B32
|
||||
pe_check_magic(String8 data)
|
||||
{
|
||||
B32 is_pe = 0;
|
||||
PE_DosHeader dos_header = {0};
|
||||
str8_deserial_read_struct(data, 0, &dos_header);
|
||||
if (dos_header.magic == PE_DOS_MAGIC) {
|
||||
U32 pe_magic = 0;
|
||||
str8_deserial_read_struct(data, dos_header.coff_file_offset, &pe_magic);
|
||||
is_pe= pe_magic == PE_MAGIC;
|
||||
}
|
||||
return is_pe;
|
||||
}
|
||||
|
||||
internal PE_BinInfo
|
||||
pe_bin_info_from_data(Arena *arena, String8 data)
|
||||
{
|
||||
|
||||
@@ -1072,6 +1072,7 @@ internal String8 pe_string_from_dll_characteristics(Arena *arena, PE_DllCharacte
|
||||
////////////////////////////////
|
||||
//~ rjf: Parser Functions
|
||||
|
||||
internal B32 pe_check_magic(String8 data);
|
||||
internal PE_BinInfo pe_bin_info_from_data(Arena *arena, String8 data);
|
||||
|
||||
internal PE_DebugInfoList pe_parse_debug_directory(Arena *arena, String8 raw_image, String8 raw_debug_dir);
|
||||
|
||||
Reference in New Issue
Block a user