Rizin
unix-like reverse engineering framework and cli tools
bin_xbe.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2022 Florian Märkl <info@florianmaerkl.de>
2 // SPDX-FileCopyrightText: 2014-2019 LemonBoy <thatlemon@gmail.com>
3 // SPDX-FileCopyrightText: 2014-2019 pancake <pancake@nopcode.org>
4 // SPDX-License-Identifier: LGPL-3.0-only
5 
6 #include <rz_types.h>
7 #include <rz_util.h>
8 #include <rz_lib.h>
9 #include <rz_bin.h>
10 #include <string.h>
11 #include "../format/xbe/xbe.h"
12 
13 static const char *kt_name[] = {
14 #include "../format/xbe/kernel.h"
15 };
16 
17 static bool read_xbe_header(xbe_header *hdr, RzBuffer *b, ut64 off) {
18  if (rz_buf_read_at(b, off, hdr->magic, sizeof(hdr->magic)) != sizeof(hdr->magic) ||
19  rz_buf_read_at(b, off + 4, hdr->signature, sizeof(hdr->signature)) != sizeof(hdr->signature) ||
20  !rz_buf_read_le32_at(b, off + 0x104, &hdr->base) ||
21  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32), &hdr->headers_size) ||
22  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 2, &hdr->image_size) ||
23  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 3, &hdr->image_header_size) ||
24  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 4, &hdr->timestamp) ||
25  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 5, &hdr->cert_addr) ||
26  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 6, &hdr->sections) ||
27  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 7, &hdr->sechdr_addr) ||
28  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 8, &hdr->init_flags) ||
29  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 9, &hdr->ep) ||
30  !rz_buf_read_le32_at(b, off + 0x104 + sizeof(ut32) * 10, &hdr->tls_addr)) {
31  return false;
32  }
33  off += 0x104 + sizeof(ut32) * 11;
34  for (size_t i = 0; i < RZ_ARRAY_SIZE(hdr->pe_data); i++) {
35  if (!rz_buf_read_le32_at(b, off, &hdr->pe_data[i])) {
36  return false;
37  }
38  off += sizeof(ut32);
39  }
40  return rz_buf_read_le32_at(b, off, &hdr->debug_path_addr) &&
41  rz_buf_read_le32_at(b, off + sizeof(ut32), &hdr->debug_name_addr) &&
42  rz_buf_read_le32_at(b, off + sizeof(ut32) * 2, &hdr->debug_uname_addr) &&
43  rz_buf_read_le32_at(b, off + sizeof(ut32) * 3, &hdr->kernel_thunk_addr) &&
44  rz_buf_read_le32_at(b, off + sizeof(ut32) * 4, &hdr->nonkernel_import_dir_addr) &&
45  rz_buf_read_le32_at(b, off + sizeof(ut32) * 5, &hdr->lib_versions) &&
46  rz_buf_read_le32_at(b, off + sizeof(ut32) * 6, &hdr->lib_versions_addr) &&
47  rz_buf_read_le32_at(b, off + sizeof(ut32) * 7, &hdr->kernel_lib_addr) &&
48  rz_buf_read_le32_at(b, off + sizeof(ut32) * 8, &hdr->xapi_lib_addr) &&
49  rz_buf_read_le32_at(b, off + sizeof(ut32) * 9, &hdr->padding[0]) &&
50  rz_buf_read_le32_at(b, off + sizeof(ut32) * 10, &hdr->padding[1]);
51 }
52 
53 static bool read_xbe_section(xbe_section *sect, RzBuffer *b, ut64 off) {
54  return rz_buf_read_le32_at(b, off, &sect->flags) &&
55  rz_buf_read_le32_at(b, off + sizeof(ut32), &sect->vaddr) &&
56  rz_buf_read_le32_at(b, off + sizeof(ut32) * 2, &sect->vsize) &&
57  rz_buf_read_le32_at(b, off + sizeof(ut32) * 3, &sect->offset) &&
58  rz_buf_read_le32_at(b, off + sizeof(ut32) * 4, &sect->size) &&
59  rz_buf_read_le32_at(b, off + sizeof(ut32) * 5, &sect->name_addr) &&
60  rz_buf_read_le32_at(b, off + sizeof(ut32) * 6, &sect->refcount) &&
61  rz_buf_read_le32_at(b, off + sizeof(ut32) * 7, &sect->padding[0]) &&
62  rz_buf_read_le32_at(b, off + sizeof(ut32) * 8, &sect->padding[1]) &&
63  rz_buf_read_at(b, off + sizeof(ut32) * 9, sect->digest, sizeof(sect->digest)) == sizeof(sect->digest);
64 }
65 
66 static bool read_xbe_lib(xbe_lib *lib, RzBuffer *b, ut64 off) {
67  return rz_buf_read_at(b, off, lib->name, sizeof(lib->name)) == sizeof(lib->name) &&
68  rz_buf_read_le16_at(b, off + 8, &lib->major) &&
69  rz_buf_read_le16_at(b, off + 8 + sizeof(ut16), &lib->minor) &&
70  rz_buf_read_le16_at(b, off + 8 + sizeof(ut16) * 2, &lib->build) &&
71  rz_buf_read_le16_at(b, off + 8 + sizeof(ut16) * 3, &lib->flags);
72 }
73 
74 static bool check_buffer(RzBuffer *b) {
75  ut8 magic[4];
76  if (rz_buf_read_at(b, 0, magic, sizeof(magic)) == 4) {
77  return !memcmp(magic, "XBEH", 4);
78  }
79  return false;
80 }
81 
82 static bool load_buffer(RzBinFile *bf, RzBinObject *o, RzBuffer *buf, Sdb *sdb) {
84  if (!obj) {
85  return false;
86  }
87  if (!read_xbe_header(&obj->header, buf, 0)) {
88  RZ_FREE(obj);
89  return false;
90  }
91 
92  if ((obj->header.ep & 0xf0000000) == 0x40000000) {
93  // Sega Chihiro xbe
94  obj->ep_key = XBE_EP_CHIHIRO;
95  obj->kt_key = XBE_KP_CHIHIRO;
96  } else if ((obj->header.ep ^ XBE_EP_RETAIL) > 0x1000000) {
97  // Debug xbe
98  obj->ep_key = XBE_EP_DEBUG;
99  obj->kt_key = XBE_KP_DEBUG;
100  } else {
101  // Retail xbe
102  obj->ep_key = XBE_EP_RETAIL;
103  obj->kt_key = XBE_KP_RETAIL;
104  }
105  o->bin_obj = obj;
106  return true;
107 }
108 
109 static void destroy(RzBinFile *bf) {
110  RZ_FREE(bf->o->bin_obj);
111 }
112 
114  if (!bf || !bf->buf || type != RZ_BIN_SPECIAL_SYMBOL_MAIN) {
115  return NULL;
116  }
117  rz_bin_xbe_obj_t *obj = bf->o->bin_obj;
118  RzBinAddr *ret = RZ_NEW0(RzBinAddr);
119  if (!ret) {
120  return NULL;
121  }
122  ret->vaddr = obj->header.ep ^ obj->ep_key;
123  ret->paddr = ret->vaddr - obj->header.base;
124  return ret;
125 }
126 
127 static RzList *entries(RzBinFile *bf) {
128  const rz_bin_xbe_obj_t *obj;
129  RzList *ret;
130  RzBinAddr *ptr = RZ_NEW0(RzBinAddr);
131  if (!bf || !bf->buf || !bf->o->bin_obj || !ptr) {
132  free(ptr);
133  return NULL;
134  }
135  ret = rz_list_new();
136  if (!ret) {
137  free(ptr);
138  return NULL;
139  }
140  ret->free = free;
141  obj = bf->o->bin_obj;
142  ptr->vaddr = obj->header.ep ^ obj->ep_key;
143  ptr->paddr = ptr->vaddr - obj->header.base;
144  rz_list_append(ret, ptr);
145  return ret;
146 }
147 
148 static RzList *sections(RzBinFile *bf) {
149  rz_bin_xbe_obj_t *obj = NULL;
150  xbe_header *h = NULL;
151  RzList *ret = NULL;
152  char tmp[0x100];
153  int i, r;
154  ut32 addr;
155 
156  if (!bf || !bf->o || !bf->o->bin_obj || !bf->buf) {
157  return NULL;
158  }
159  obj = bf->o->bin_obj;
160  h = &obj->header;
161  if (h->sections < 1) {
162  return NULL;
163  }
164  ret = rz_list_new();
165  if (!ret) {
166  return NULL;
167  }
168  ret->free = free;
169  if (h->sections < 1 || h->sections > 255) {
170  goto out_error;
171  }
172  addr = h->sechdr_addr - h->base;
173  if (addr > bf->size || addr + (sizeof(xbe_section) * h->sections) > bf->size) {
174  goto out_error;
175  }
176  for (i = 0; i < h->sections; i++) {
177  xbe_section sect;
178  if (!read_xbe_section(&sect, bf->buf, addr + i * sizeof(xbe_section))) {
179  goto out_error;
180  }
182  ut32 name_addr = sect.name_addr - h->base;
183  tmp[0] = 0;
184  if (name_addr > bf->size || name_addr + sizeof(tmp) > bf->size) {
185  free(item);
186  goto out_error;
187  }
188  r = rz_buf_read_at(bf->buf, name_addr, (ut8 *)tmp, sizeof(tmp));
189  if (r < 1) {
190  free(item);
191  goto out_error;
192  }
193  tmp[sizeof(tmp) - 1] = 0;
194  item->name = rz_str_newf("%s.%i", tmp, i);
195  item->paddr = sect.offset;
196  item->vaddr = sect.vaddr;
197  item->size = sect.size;
198  item->vsize = sect.vsize;
199 
200  item->perm = RZ_PERM_R;
201  if (sect.flags & SECT_FLAG_X) {
202  item->perm |= RZ_PERM_X;
203  }
204  if (sect.flags & SECT_FLAG_W) {
205  item->perm |= RZ_PERM_W;
206  }
207  rz_list_append(ret, item);
208  }
209  return ret;
210 out_error:
211  rz_list_free(ret);
212  return NULL;
213 }
214 
219 static char *describe_xbe_lib_at(RzBuffer *b, ut64 off, ut64 filesz) {
220  if (off + sizeof(xbe_lib) > filesz) {
221  return NULL;
222  }
223  xbe_lib lib;
224  if (!read_xbe_lib(&lib, b, off)) {
225  return NULL;
226  }
227  // lib.name may not be 0-terminated
228  char name[9];
229  RZ_STATIC_ASSERT(sizeof(name) == sizeof(lib.name) + 1);
230  memcpy(name, lib.name, sizeof(lib.name));
231  name[sizeof(lib.name)] = 0;
232  return rz_str_newf("%s %i.%i.%i", name, lib.major, lib.minor, lib.build);
233 }
234 
235 static RzList *libs(RzBinFile *bf) {
236  if (!bf || !bf->o || !bf->o->bin_obj) {
237  return NULL;
238  }
239  rz_bin_xbe_obj_t *obj = bf->o->bin_obj;
240  xbe_header *h = &obj->header;
241  RzList *ret = rz_list_newf(free);
242  if (!ret) {
243  return NULL;
244  }
245 
246  // Hint: h->kernel_lib_addr and h->xapi_lib_addr also point to xbe_lib structs,
247  // but in our known samples, they just point into the array below, so no need
248  // to check them explicitly.
249 
250  for (ut32 i = 0; i < h->lib_versions; i++) {
251  ut64 addr = h->lib_versions_addr - h->base + (i * sizeof(xbe_lib));
252  char *lib = describe_xbe_lib_at(bf->buf, addr, bf->size);
253  if (!lib) {
254  break;
255  }
256  rz_list_push(ret, lib);
257  }
258 
259  return ret;
260 }
261 
262 static RzList *symbols(RzBinFile *bf) {
263  rz_bin_xbe_obj_t *obj;
264  xbe_header *h;
265  RzList *ret;
266  ut32 kt_addr;
267  ut32 addr;
268 
269  if (!bf || !bf->o || !bf->o->bin_obj) {
270  return NULL;
271  }
272 
273  obj = bf->o->bin_obj;
274  h = &obj->header;
275  kt_addr = h->kernel_thunk_addr ^ obj->kt_key;
277  if (!ret) {
278  return NULL;
279  }
280  int limit = h->sections;
281  if (limit * (sizeof(xbe_section)) >= bf->size - h->sechdr_addr) {
282  goto out_error;
283  }
284  xbe_section sect;
285  bool found = false;
286  for (size_t i = 0; found == false && i < limit; i++) {
287  addr = h->sechdr_addr - h->base + (sizeof(xbe_section) * i);
288  if (addr > bf->size || addr + sizeof(sect) > bf->size ||
289  !read_xbe_section(&sect, bf->buf, addr)) {
290  goto out_error;
291  }
292  if (kt_addr >= sect.vaddr && kt_addr < sect.vaddr + sect.vsize) {
293  found = true;
294  }
295  }
296  if (!found) {
297  goto out_error;
298  }
299  addr = sect.offset + (kt_addr - sect.vaddr);
300  ut32 thunk_addr[XBE_MAX_THUNK];
301  if (addr > bf->size || addr + sizeof(thunk_addr) > bf->size) {
302  goto out_error;
303  }
304  for (size_t i = 0; i < RZ_ARRAY_SIZE(thunk_addr); i++) {
305  if (!rz_buf_read_le32_at(bf->buf, addr + i * sizeof(ut32), &thunk_addr[i])) {
306  goto out_error;
307  }
308  }
309  for (size_t i = 0; i < XBE_MAX_THUNK && thunk_addr[i]; i++) {
311  if (!sym) {
312  goto out_error;
313  }
314  const ut32 thunk_index = thunk_addr[i] ^ 0x80000000;
315  // Basic sanity checks
316  if (thunk_addr[i] & 0x80000000 && thunk_index > 0 && thunk_index <= XBE_MAX_THUNK) {
317  sym->name = rz_str_newf("kt.%s", kt_name[thunk_index - 1]);
318  sym->vaddr = (h->kernel_thunk_addr ^ obj->kt_key) + (4 * i);
319  sym->paddr = sym->vaddr - h->base;
320  sym->size = 4;
321  sym->ordinal = i;
322  rz_list_append(ret, sym);
323  } else {
324  free(sym);
325  }
326  }
327  return ret;
328 out_error:
329  rz_list_free(ret);
330  return NULL;
331 }
332 
333 static RzBinInfo *info(RzBinFile *bf) {
334  rz_bin_xbe_obj_t *obj;
335  RzBinInfo *ret;
336  ut8 dbg_name[256];
337 
338  if (!bf || !bf->buf) {
339  return NULL;
340  }
341 
342  ret = RZ_NEW0(RzBinInfo);
343  if (!ret) {
344  return NULL;
345  }
346 
347  obj = bf->o->bin_obj;
348 
349  memset(dbg_name, 0, sizeof(dbg_name));
350  rz_buf_read_at(bf->buf, obj->header.debug_name_addr - obj->header.base, dbg_name, sizeof(dbg_name));
351  dbg_name[sizeof(dbg_name) - 1] = 0;
352  ret->file = strdup((char *)dbg_name);
353  ret->bclass = strdup("program");
354  ret->machine = strdup("Microsoft Xbox");
355  ret->os = strdup("xbox");
356  ret->type = strdup("Microsoft Xbox executable");
357  ret->arch = strdup("x86");
358  ret->has_va = 1;
359  ret->bits = 32;
360  ret->big_endian = 0;
361  ret->dbg_info = 0;
362  ret->lang = NULL;
363  return ret;
364 }
365 
366 static ut64 baddr(RzBinFile *bf) {
367  rz_bin_xbe_obj_t *obj = bf->o->bin_obj;
368  return obj->header.base;
369 }
370 
372  .name = "xbe",
373  .desc = "Microsoft Xbox xbe format rz_bin plugin",
374  .license = "LGPL3",
375  .load_buffer = &load_buffer,
376  .destroy = &destroy,
377  .check_buffer = &check_buffer,
378  .baddr = &baddr,
379  .binsym = &binsym,
380  .entries = &entries,
382  .sections = &sections,
383  .symbols = &symbols,
384  .info = &info,
385  .libs = &libs,
386 };
387 
388 #ifndef RZ_PLUGIN_INCORE
391  .data = &rz_bin_plugin_xbe,
393 };
394 #endif
lzma_index ** i
Definition: index.h:629
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
Definition: bin.c:175
RZ_API RZ_OWN RzList * rz_bin_maps_of_file_sections(RZ_NONNULL RzBinFile *binfile)
Create a list of RzBinMap from RzBinSections queried from the given file.
Definition: bin.c:1040
static RzList * symbols(RzBinFile *bf)
Definition: bin_xbe.c:262
static RzBinAddr * binsym(RzBinFile *bf, RzBinSpecialSymbol type)
Definition: bin_xbe.c:113
static char * describe_xbe_lib_at(RzBuffer *b, ut64 off, ut64 filesz)
Definition: bin_xbe.c:219
static RzList * libs(RzBinFile *bf)
Definition: bin_xbe.c:235
static void destroy(RzBinFile *bf)
Definition: bin_xbe.c:109
RZ_API RzLibStruct rizin_plugin
Definition: bin_xbe.c:389
static bool check_buffer(RzBuffer *b)
Definition: bin_xbe.c:74
static bool read_xbe_section(xbe_section *sect, RzBuffer *b, ut64 off)
Definition: bin_xbe.c:53
static RzBinInfo * info(RzBinFile *bf)
Definition: bin_xbe.c:333
static ut64 baddr(RzBinFile *bf)
Definition: bin_xbe.c:366
static const char * kt_name[]
Definition: bin_xbe.c:13
static bool read_xbe_header(xbe_header *hdr, RzBuffer *b, ut64 off)
Definition: bin_xbe.c:17
static RzList * entries(RzBinFile *bf)
Definition: bin_xbe.c:127
static bool read_xbe_lib(xbe_lib *lib, RzBuffer *b, ut64 off)
Definition: bin_xbe.c:66
static bool load_buffer(RzBinFile *bf, RzBinObject *o, RzBuffer *buf, Sdb *sdb)
Definition: bin_xbe.c:82
static RzList * sections(RzBinFile *bf)
Definition: bin_xbe.c:148
RzBinPlugin rz_bin_plugin_xbe
Definition: bin_xbe.c:371
#define RZ_API
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
uint16_t ut16
uint32_t ut32
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
RZ_API const KEY_TYPE bool * found
Definition: ht_inc.h:130
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
Definition: list.c:60
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
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")
static uint32_t const uint8_t uint32_t uint32_t limit
Definition: memcmplen.h:45
int type
Definition: mipsasm.c:17
int off
Definition: pal.c:13
#define RZ_STATIC_ASSERT(x)
Definition: rz_assert.h:10
RzBinSpecialSymbol
Definition: rz_bin.h:136
@ RZ_BIN_SPECIAL_SYMBOL_MAIN
Definition: rz_bin.h:139
#define rz_buf_read_le16_at(b, addr, result)
Definition: rz_buf.h:270
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
Definition: buf.c:1136
#define rz_buf_read_le32_at(b, addr, result)
Definition: rz_buf.h:271
@ RZ_LIB_TYPE_BIN
Definition: rz_lib.h:75
void(* RzListFree)(void *ptr)
Definition: rz_list.h:11
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
#define RZ_PERM_R
Definition: rz_types.h:93
#define RZ_NEW0(x)
Definition: rz_types.h:284
#define RZ_NEW(x)
Definition: rz_types.h:285
#define RZ_PERM_W
Definition: rz_types.h:94
#define RZ_PERM_X
Definition: rz_types.h:95
#define RZ_ARRAY_SIZE(x)
Definition: rz_types.h:300
#define RZ_FREE(x)
Definition: rz_types.h:369
#define RZ_VERSION
Definition: rz_version.h:8
#define b(i)
Definition: sha256.c:42
#define h(i)
Definition: sha256.c:48
Definition: z80asm.h:102
ut64 vaddr
Definition: rz_bin.h:186
ut64 paddr
Definition: rz_bin.h:187
XX curplugin == o->plugin.
Definition: rz_bin.h:298
RzBinObject * o
Definition: rz_bin.h:305
RzBuffer * buf
Definition: rz_bin.h:303
int has_va
Definition: rz_bin.h:228
char * type
Definition: rz_bin.h:211
char * os
Definition: rz_bin.h:219
char * machine
Definition: rz_bin.h:216
const char * lang
Definition: rz_bin.h:224
char * bclass
Definition: rz_bin.h:212
char * file
Definition: rz_bin.h:210
ut64 dbg_info
Definition: rz_bin.h:240
char * arch
Definition: rz_bin.h:214
int big_endian
Definition: rz_bin.h:235
void * bin_obj
Definition: rz_bin.h:293
char * name
Definition: rz_bin.h:509
char * version
Definition: rz_bin.h:512
char * name
Definition: rz_bin.h:619
char * name
Definition: rz_bin.h:675
ut32 ordinal
Definition: rz_bin.h:692
int ep_key
Definition: xbe.h:71
int kt_key
Definition: xbe.h:70
xbe_header header
Definition: xbe.h:69
RzListFree free
Definition: rz_list.h:21
Definition: sdb.h:63
Definition: xbe.h:19
ut32 padding[2]
Definition: xbe.h:43
ut32 lib_versions_addr
Definition: xbe.h:40
ut32 headers_size
Definition: xbe.h:23
ut8 magic[4]
Definition: xbe.h:20
ut32 ep
Definition: xbe.h:31
ut32 cert_addr
Definition: xbe.h:27
ut32 pe_data[7]
Definition: xbe.h:33
ut32 xapi_lib_addr
Definition: xbe.h:42
ut32 tls_addr
Definition: xbe.h:32
ut32 debug_uname_addr
Definition: xbe.h:36
ut32 debug_path_addr
Definition: xbe.h:34
ut8 signature[0x100]
Definition: xbe.h:21
ut32 debug_name_addr
Definition: xbe.h:35
ut32 sections
Definition: xbe.h:28
ut32 init_flags
Definition: xbe.h:30
ut32 kernel_lib_addr
Definition: xbe.h:41
ut32 image_header_size
Definition: xbe.h:25
ut32 lib_versions
Definition: xbe.h:39
ut32 image_size
Definition: xbe.h:24
ut32 base
Definition: xbe.h:22
ut32 nonkernel_import_dir_addr
Definition: xbe.h:38
ut32 sechdr_addr
Definition: xbe.h:29
ut32 kernel_thunk_addr
Definition: xbe.h:37
ut32 timestamp
Definition: xbe.h:26
Definition: xbe.h:60
ut16 build
Definition: xbe.h:64
ut8 name[8]
Definition: xbe.h:61
ut16 major
Definition: xbe.h:62
ut16 minor
Definition: xbe.h:63
ut16 flags
Definition: xbe.h:65
ut32 vaddr
Definition: xbe.h:50
ut32 offset
Definition: xbe.h:52
ut32 name_addr
Definition: xbe.h:54
ut32 size
Definition: xbe.h:53
ut8 digest[20]
Definition: xbe.h:57
ut32 vsize
Definition: xbe.h:51
ut32 padding[2]
Definition: xbe.h:56
ut32 flags
Definition: xbe.h:49
ut32 refcount
Definition: xbe.h:55
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
#define SECT_FLAG_X
Definition: xbe.h:46
#define XBE_EP_CHIHIRO
Definition: xbe.h:15
#define XBE_MAX_THUNK
Definition: xbe.h:18
#define XBE_EP_DEBUG
Definition: xbe.h:10
#define SECT_FLAG_W
Definition: xbe.h:47
#define XBE_KP_CHIHIRO
Definition: xbe.h:16
#define XBE_KP_RETAIL
Definition: xbe.h:12
#define XBE_EP_RETAIL
Definition: xbe.h:9
#define XBE_KP_DEBUG
Definition: xbe.h:13
static int addr
Definition: z80asm.c:58