43 #define ROWL(nam, siz, val, fmt) \
44 rz_list_append(ret, rz_bin_field_new(addr, addr, siz, nam, sdb_fmt("0x%08" PFMT64x, (ut64)val), fmt, false));
47 ut64 addr =
bin->rich_header_offset ?
bin->rich_header_offset : 128;
51 rz_list_foreach (
bin->rich_entries, it, rich) {
61 ROWL(
"Signature", 4,
bin->nt_headers->Signature,
"x");
63 ROWL(
"Machine", 2,
bin->nt_headers->file_header.Machine,
"x");
65 ROWL(
"NumberOfSections", 2,
bin->nt_headers->file_header.NumberOfSections,
"x");
67 ROWL(
"TimeDateStamp", 4,
bin->nt_headers->file_header.TimeDateStamp,
"x");
69 ROWL(
"PointerToSymbolTable", 4,
bin->nt_headers->file_header.PointerToSymbolTable,
"x");
71 ROWL(
"NumberOfSymbols ", 4,
bin->nt_headers->file_header.NumberOfSymbols,
"x");
73 ROWL(
"SizeOfOptionalHeader", 2,
bin->nt_headers->file_header.SizeOfOptionalHeader,
"x");
75 ROWL(
"Characteristics", 2,
bin->nt_headers->file_header.Characteristics,
"x");
77 ROWL(
"Magic", 2,
bin->nt_headers->optional_header.Magic,
"x");
79 ROWL(
"MajorLinkerVersion", 1,
bin->nt_headers->optional_header.MajorLinkerVersion,
"x");
81 ROWL(
"MinorLinkerVersion", 1,
bin->nt_headers->optional_header.MinorLinkerVersion,
"x");
83 ROWL(
"SizeOfCode", 4,
bin->nt_headers->optional_header.SizeOfCode,
"x");
85 ROWL(
"SizeOfInitializedData", 4,
bin->nt_headers->optional_header.SizeOfInitializedData,
"x");
87 ROWL(
"SizeOfUninitializedData", 4,
bin->nt_headers->optional_header.SizeOfUninitializedData,
"x");
89 ROWL(
"AddressOfEntryPoint", 4,
bin->nt_headers->optional_header.AddressOfEntryPoint,
"x");
91 ROWL(
"BaseOfCode", 4,
bin->nt_headers->optional_header.BaseOfCode,
"x");
93 ROWL(
"ImageBase", 4,
bin->nt_headers->optional_header.ImageBase,
"x");
95 ROWL(
"SectionAlignment", 4,
bin->nt_headers->optional_header.SectionAlignment,
"x");
97 ROWL(
"FileAlignment", 4,
bin->nt_headers->optional_header.FileAlignment,
"x");
99 ROWL(
"MajorOperatingSystemVersion", 2,
bin->nt_headers->optional_header.MajorOperatingSystemVersion,
"x");
101 ROWL(
"MinorOperatingSystemVersion", 2,
bin->nt_headers->optional_header.MinorOperatingSystemVersion,
"x");
103 ROWL(
"MajorImageVersion", 2,
bin->nt_headers->optional_header.MajorImageVersion,
"x");
105 ROWL(
"MinorImageVersion", 2,
bin->nt_headers->optional_header.MinorImageVersion,
"x");
107 ROWL(
"MajorSubsystemVersion", 2,
bin->nt_headers->optional_header.MajorSubsystemVersion,
"x");
109 ROWL(
"MinorSubsystemVersion", 2,
bin->nt_headers->optional_header.MinorSubsystemVersion,
"x");
111 ROWL(
"Win32VersionValue", 4,
bin->nt_headers->optional_header.Win32VersionValue,
"x");
113 ROWL(
"SizeOfImage", 4,
bin->nt_headers->optional_header.SizeOfImage,
"x");
115 ROWL(
"SizeOfHeaders", 4,
bin->nt_headers->optional_header.SizeOfHeaders,
"x");
117 ROWL(
"CheckSum", 4,
bin->nt_headers->optional_header.CheckSum,
"x");
119 ROWL(
"Subsystem", 24,
bin->nt_headers->optional_header.Subsystem,
"x");
121 ROWL(
"DllCharacteristics", 2,
bin->nt_headers->optional_header.DllCharacteristics,
"x");
123 ROWL(
"SizeOfStackReserve", 4,
bin->nt_headers->optional_header.SizeOfStackReserve,
"x");
125 ROWL(
"SizeOfStackCommit", 4,
bin->nt_headers->optional_header.SizeOfStackCommit,
"x");
127 ROWL(
"SizeOfHeapReserve", 4,
bin->nt_headers->optional_header.SizeOfHeapReserve,
"x");
129 ROWL(
"SizeOfHeapCommit", 4,
bin->nt_headers->optional_header.SizeOfHeapCommit,
"x");
131 ROWL(
"LoaderFlags", 4,
bin->nt_headers->optional_header.LoaderFlags,
"x");
133 ROWL(
"NumberOfRvaAndSizes", 4,
bin->nt_headers->optional_header.NumberOfRvaAndSizes,
"x");
139 if (
bin->nt_headers->optional_header.DataDirectory[
i].Size > 0) {
143 ROWL(
"IMAGE_DIRECTORY_ENTRY_EXPORT", 4,
144 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
146 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_EXPORT", 4,
147 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
150 ROWL(
"IMAGE_DIRECTORY_ENTRY_IMPORT", 4,
151 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
153 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_IMPORT", 4,
154 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
157 ROWL(
"IMAGE_DIRECTORY_ENTRY_RESOURCE", 4,
158 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
160 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_RESOURCE", 4,
161 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
164 ROWL(
"IMAGE_DIRECTORY_ENTRY_EXCEPTION", 4,
165 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
167 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_EXCEPTION", 4,
168 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
171 ROWL(
"IMAGE_DIRECTORY_ENTRY_SECURITY", 4,
172 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
174 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_SECURITY", 4,
175 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
178 ROWL(
"IMAGE_DIRECTORY_ENTRY_BASERELOC", 4,
179 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
181 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_BASERELOC", 4,
182 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
185 ROWL(
"IMAGE_DIRECTORY_ENTRY_DEBUG", 4,
186 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
188 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_DEBUG", 4,
189 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
192 ROWL(
"IMAGE_DIRECTORY_ENTRY_COPYRIGHT", 4,
193 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
195 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_COPYRIGHT", 4,
196 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
199 ROWL(
"IMAGE_DIRECTORY_ENTRY_GLOBALPTR", 4,
200 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
202 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_GLOBALPTR", 4,
203 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
206 ROWL(
"IMAGE_DIRECTORY_ENTRY_TLS", 4,
207 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
209 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_TLS", 4,
210 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
213 ROWL(
"IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", 4,
214 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
216 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", 4,
217 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
220 ROWL(
"IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", 4,
221 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
223 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", 4,
224 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
227 ROWL(
"IMAGE_DIRECTORY_ENTRY_IAT", 4,
228 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
230 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_IAT", 4,
231 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
234 ROWL(
"IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", 4,
235 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
237 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", 4,
238 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
241 ROWL(
"IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", 4,
242 bin->nt_headers->optional_header.DataDirectory[
i].VirtualAddress,
"x");
244 ROWL(
"SIZE_IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", 4,
245 bin->nt_headers->optional_header.DataDirectory[
i].Size,
"x");
RZ_API void rz_bin_field_free(RzBinField *field)
RZ_API RzBinField * rz_bin_field_new(ut64 paddr, ut64 vaddr, int size, const char *name, const char *comment, const char *format, bool format_named)
#define ROWL(nam, siz, val, fmt)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define PE_IMAGE_DIRECTORY_ENTRY_EXCEPTION
#define PE_IMAGE_DIRECTORY_ENTRY_COPYRIGHT
#define PE_IMAGE_DIRECTORY_ENTRY_IMPORT
#define PE_IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
#define PE_IMAGE_DIRECTORY_ENTRY_RESOURCE
#define PE_IMAGE_DIRECTORY_ENTRY_BASERELOC
#define PE_IMAGE_DIRECTORY_ENTRY_DEBUG
#define PE_IMAGE_DIRECTORY_ENTRY_SECURITY
#define PE_IMAGE_DIRECTORY_ENTRY_IAT
#define PE_IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT
#define PE_IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
#define PE_IMAGE_DIRECTORY_ENTRY_GLOBALPTR
#define PE_IMAGE_DIRECTORY_ENTRIES
#define PE_IMAGE_DIRECTORY_ENTRY_EXPORT
#define PE_IMAGE_DIRECTORY_ENTRY_TLS
#define PE_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG
void(* RzListFree)(void *ptr)