Rizin
unix-like reverse engineering framework and cli tools
omf.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2015 ampotos <mercie_i@epitech.eu>
2 // SPDX-FileCopyrightText: 2015-2019 pancake <pancake@nopcode.org>
3 // SPDX-License-Identifier: LGPL-3.0-only
4 
5 #ifndef OMF_H_
6 #define OMF_H_
7 
8 #include <rz_util.h>
9 #include <rz_types.h>
10 #include <rz_bin.h>
11 
12 #include "omf_specs.h"
13 
14 typedef struct OMF_record_handler {
18 
19 typedef struct {
21  void *elems;
23 
24 typedef struct OMF_DATA {
25  ut64 paddr; // offset in file
29  struct OMF_DATA *next;
31 
32 // sections return by the plugin are the addr of datas because sections are
33 // separate on non contiguous block on the omf file
34 typedef struct {
40 } OMF_segment;
41 
42 typedef struct {
43  char *name;
46 } OMF_symbol;
47 
48 typedef struct {
50  char **names;
58 
59 // this value was chosen arbitrarily to made the loader work correctly
60 // if someone want to implement rellocation for omf he has to remove this
61 #define OMF_BASE_ADDR 0x1000
62 
71 
72 #endif
static int buf_size
Definition: debug_qnx.c:35
uint16_t ut16
uint32_t ut32
voidpf void uLong size
Definition: ioapi.h:138
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
static void list(RzEgg *egg)
Definition: rz-gg.c:52
bool rz_bin_omf_get_entry(rz_bin_omf_obj *obj, RzBinAddr *addr)
Definition: omf.c:701
ut64 rz_bin_omf_get_vaddr_sym(rz_bin_omf_obj *obj, OMF_symbol *sym)
Definition: omf.c:797
int rz_bin_omf_send_sections(RzList *list, OMF_segment *section, rz_bin_omf_obj *obj)
Definition: omf.c:746
void rz_bin_free_all_omf_obj(rz_bin_omf_obj *obj)
Definition: omf.c:665
struct OMF_record_handler OMF_record_handler
int rz_bin_omf_get_bits(rz_bin_omf_obj *obj)
Definition: omf.c:731
bool rz_bin_checksum_omf_ok(const ut8 *buf, ut64 buf_size)
Definition: omf.c:30
ut64 rz_bin_omf_get_paddr_sym(rz_bin_omf_obj *obj, OMF_symbol *sym)
Definition: omf.c:774
rz_bin_omf_obj * rz_bin_internal_omf_load(const ut8 *buf, ut64 size)
Definition: omf.c:683
struct OMF_DATA OMF_data
Definition: omf.h:24
ut16 seg_idx
Definition: omf.h:28
ut32 offset
Definition: omf.h:27
struct OMF_DATA * next
Definition: omf.h:29
ut64 size
Definition: omf.h:26
ut64 paddr
Definition: omf.h:25
void * elems
Definition: omf.h:21
ut32 nb_elem
Definition: omf.h:20
struct OMF_record_handler * next
Definition: omf.h:16
OMF_record record
Definition: omf.h:15
OMF_data * data
Definition: omf.h:39
ut32 name_idx
Definition: omf.h:35
ut64 vaddr
Definition: omf.h:38
ut8 bits
Definition: omf.h:37
ut64 size
Definition: omf.h:36
Definition: omf.h:42
ut32 offset
Definition: omf.h:45
char * name
Definition: omf.h:43
ut16 seg_idx
Definition: omf.h:44
ut32 nb_name
Definition: omf.h:51
ut32 nb_symbol
Definition: omf.h:55
char ** names
Definition: omf.h:50
OMF_segment ** sections
Definition: omf.h:52
ut8 bits
Definition: omf.h:49
OMF_symbol ** symbols
Definition: omf.h:54
ut32 nb_section
Definition: omf.h:53
OMF_record_handler * records
Definition: omf.h:56
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58