fix program header rebase issue in non-PIE exes, and export program header

info through DEMON event
This commit is contained in:
Nikita Smith
2025-11-07 14:39:45 -08:00
committed by Ryan Fleury
parent 7f705923e6
commit 78f2e641bc
4 changed files with 57 additions and 11 deletions
+26
View File
@@ -180,3 +180,29 @@ dmn_process_read_cstring(Arena *arena, DMN_Handle process, U64 addr)
scratch_end(scratch);
return result;
}
internal String8
dmn_process_read_block(Arena *arena, DMN_Handle process, Rng1U64 vrange)
{
String8 block = {0};
void *raw = dmn_process_read_raw(arena, process, vrange);
if(raw)
{
block = str8(raw, dim_1u64(vrange));
}
return block;
}
internal void *
dmn_process_read_raw(Arena *arena, DMN_Handle process, Rng1U64 vrange)
{
Temp temp = temp_begin(arena);
void *buffer = push_array(arena, U8, dim_1u64(vrange));
U64 read_size = dmn_process_read(process, vrange, buffer);
if(read_size != dim_1u64(vrange))
{
buffer = 0;
temp_end(temp);
}
return buffer;
}