Rizin
unix-like reverse engineering framework and cli tools
qnx.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2019 deepakchethan <deepakchethan@outlook.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef _QNX_H
5 #define _QNX_H
6 
7 #include "qnx_specs.h"
8 
9 #include <rz_util.h>
10 #include <rz_lib.h>
11 #include <rz_types.h>
12 #include <rz_bin.h>
13 
14 enum {
24 };
25 
27  typedef struct lmf_record {
28  ut8 rec_type;
29  ut8 reserved; // must be 0
30  ut16 data_nbytes; // size of the data record after this.
31  ut16 spare; // must be 0
32  })
33 lmf_record;
34 
36  typedef struct lmf_data {
37  ut16 segment;
38  ut32 offset;
39  })
40 lmf_data;
41 
43  typedef struct lmf_header {
44  ut16 version;
45  ut16 cflags;
46  ut16 cpu; // 86,186,286,386,486
47  ut16 fpu; // 0, 87,287,387
48  ut16 code_index; // segment of code start;
49  ut16 stack_index; // segment to put the stack
50  ut16 heap_index; // segment to start DS at.
51  ut16 argv_index; // segment to put argv & environment.
52  ut16 spare2[4]; // must be zero;
53  ut32 code_offset; // starting offset of code.
54  ut32 stack_nbytes; // stack size
55  ut32 heap_nbytes; // initial size of heap (optional).
56  ut32 image_base; // starting address of image
57  ut32 spare3[2];
58  })
59 lmf_header;
60 
62  typedef struct lmf_eof {
63  ut8 spare[6];
64  })
65 lmf_eof;
66 
67 /* values for the res_type field in the lmf_resource structure */
68 enum {
69  RES_USAGE = 0
70 };
71 
73  typedef struct lmf_resource {
74  ut16 res_type;
75  ut16 spare[3];
76  })
77 lmf_resource;
78 
80  typedef struct lmf_rw_end {
81  ut16 verify;
83  })
84 lmf_rw_end;
85 
87  typedef struct {
88  Sdb *kv;
89  lmf_header lmfh;
90  RzList *fixups;
92  RzList *maps;
93  lmf_rw_end rwend;
94  })
95 QnxObj;
96 
97 #endif
static char * version
Definition: acr.h:4
static ut32 cpu[32]
Definition: analysis_or1k.c:21
static RzList * maps(RzBinFile *bf)
Definition: bin_bf.c:116
RzList * sections(RzBinFile *bf)
Definition: bin_ne.c:110
static char * signature(RzBinFile *bf, bool json)
Definition: bin_pe.c:117
uint16_t ut16
uint32_t ut32
voidpf uLong offset
Definition: ioapi.h:144
uint8_t ut8
Definition: lh5801.h:11
@ reserved
Definition: lm32_isa.h:94
@ LMF_HEADER_REC
Definition: qnx.h:15
@ LMF_LOAD_REC
Definition: qnx.h:17
@ LMF_RESOURCE_REC
Definition: qnx.h:21
@ LMF_LINEAR_FIXUP_REC
Definition: qnx.h:23
@ LMF_FIXUP_REC
Definition: qnx.h:18
@ LMF_RW_END_REC
Definition: qnx.h:22
@ LMF_IMAGE_END_REC
Definition: qnx.h:20
@ LMF_COMMENT_REC
Definition: qnx.h:16
@ LMF_8087_FIXUP_REC
Definition: qnx.h:19
@ RES_USAGE
Definition: qnx.h:69
RZ_PACKED(typedef struct lmf_record { ut8 rec_type;ut8 reserved;ut16 data_nbytes;ut16 spare;}) lmf_record
Definition: sdb.h:63