mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-14 12:59:41 -07:00
COFF lib writer
This commit is contained in:
1 parent
ccf204d2f1
commit
120829095b
4 files changed
+470
-4
No files matched your search
+26
-2
@@ -302,9 +302,9 @@ coff_ordinal_data_from_hint(Arena *arena, COFF_MachineType machine, U16 hint)
|
||||
|
||||
internal String8
|
||||
coff_make_import_header_by_name(Arena *arena,
|
||||
String8 dll_name,
|
||||
COFF_MachineType machine,
|
||||
COFF_TimeStamp time_stamp,
|
||||
String8 dll_name,
|
||||
String8 name,
|
||||
U16 hint,
|
||||
COFF_ImportType type)
|
||||
@@ -346,9 +346,9 @@ coff_make_import_header_by_name(Arena *arena,
|
||||
|
||||
internal String8
|
||||
coff_make_import_header_by_ordinal(Arena *arena,
|
||||
String8 dll_name,
|
||||
COFF_MachineType machine,
|
||||
COFF_TimeStamp time_stamp,
|
||||
String8 dll_name,
|
||||
U16 ordinal,
|
||||
COFF_ImportType type)
|
||||
{
|
||||
@@ -930,3 +930,27 @@ coff_import_header_type_from_string(String8 name)
|
||||
}
|
||||
return COFF_ImportType_Invalid;
|
||||
}
|
||||
internal String8
|
||||
coff_make_lib_member_header(Arena *arena, String8 name, COFF_TimeStamp time_stamp, U16 user_id, U16 group_id, U16 mode, U32 size)
|
||||
{
|
||||
Assert(name.size < 16);
|
||||
Assert(user_id < 10000);
|
||||
Assert(group_id < 10000);
|
||||
Assert(mode < 10000);
|
||||
Assert(size < 1000000000);
|
||||
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
String8List list = {0};
|
||||
str8_list_pushf(scratch.arena, &list, "%-16.*s", str8_varg(name));
|
||||
str8_list_pushf(scratch.arena, &list, "%-12u", time_stamp);
|
||||
str8_list_pushf(scratch.arena, &list, "%-6u", user_id);
|
||||
str8_list_pushf(scratch.arena, &list, "%-6u", group_id);
|
||||
str8_list_pushf(scratch.arena, &list, "%-8u", mode);
|
||||
str8_list_pushf(scratch.arena, &list, "%-10u", size);
|
||||
str8_list_pushf(scratch.arena, &list, "`\n");
|
||||
String8 result = str8_list_join(arena, &list, 0);
|
||||
|
||||
Assert(result.size == sizeof(COFF_ArchiveMemberHeader));
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user