More fixes in shlr for MSVC

This commit is contained in:
SkUaTeR 2017-05-16 20:14:39 +02:00 committed by radare
parent 1ac364b056
commit 7d7c9cb5a7
4 changed files with 19 additions and 12 deletions

View File

@ -96,7 +96,7 @@ typedef struct libgdbr_stub_features_t {
/*!
* Structure for fstat data sent by gdb remote server
*/
R_PACKED(
typedef struct libgdbr_fstat_t {
unsigned dev;
unsigned ino;
@ -111,7 +111,7 @@ typedef struct libgdbr_fstat_t {
unsigned atime;
unsigned mtime;
unsigned ctime;
} __attribute__((packed)) libgdbr_fstat_t;
}) libgdbr_fstat_t;
/*!
* Core "object" that saves

View File

@ -16,7 +16,7 @@ typedef struct java_op {
#endif
#define JAVA_OPS_COUNT 297
extern struct java_op JAVA_OPS[JAVA_OPS_COUNT];
R_IPI int java_print_opcode(RBinJavaObj *obj, ut64 addr, int idx, const ut8 *bytes, int len, char *output, int outlen);
R_API int java_print_opcode(RBinJavaObj *obj, ut64 addr, int idx, const ut8 *bytes, int len, char *output, int outlen);
R_API int r_java_disasm(RBinJavaObj *obj, ut64 addr, const ut8 *bytes, int len, char *output, int outlen);
R_API int r_java_assemble(ut8 *bytes, const char *string);
//R_API void r_java_set_obj(RBinJavaObj *obj);

View File

@ -54,6 +54,7 @@ enum {
#define DBGKD_VERS_FLAG_DATA 0x0002
#define DBGKD_VERS_FLAG_PTR64 0x0004
R_PACKED (
typedef struct kd_req_t {
uint32_t req;
uint16_t cpu_level;
@ -62,11 +63,13 @@ typedef struct kd_req_t {
// Pad to 16-byte boundary (?)
uint32_t pad;
union {
R_PACKED(
struct {
uint64_t addr;
uint32_t length;
uint32_t read;
} __attribute__((packed)) r_mem;
}) r_mem;
R_PACKED (
struct {
uint16_t major;
uint16_t minor;
@ -78,7 +81,7 @@ typedef struct kd_req_t {
uint64_t kernel_base;
uint64_t mod_addr;
uint64_t dbg_addr;
} __attribute__((packed)) r_ver;
}) r_ver;
struct {
uint32_t reason;
uint32_t tf;
@ -116,10 +119,10 @@ typedef struct kd_req_t {
uint8_t raw[40];
};
uint8_t data[0];
} __attribute__((packed)) kd_req_t;
}) kd_req_t;
#define KD_EXC_BKPT 0x80000003
R_PACKED (
typedef struct kd_stc_64 {
uint32_t state;
uint16_t cpu_level;
@ -129,14 +132,15 @@ typedef struct kd_stc_64 {
uint64_t kthread;
uint64_t pc;
union {
R_PACKED (
struct {
uint32_t code;
uint32_t flags;
uint64_t ex_record;
uint64_t ex_addr;
} __attribute__((packed)) exception;
}) exception;
};
} __attribute__((packed)) kd_stc_64;
}) kd_stc_64;
typedef struct kd_ioc_t {
uint32_t req;
@ -144,6 +148,7 @@ typedef struct kd_ioc_t {
uint64_t pad[7];
} kd_ioc_t;
R_PACKED (
typedef struct kd_packet_t {
uint32_t leader;
uint16_t type;
@ -151,7 +156,7 @@ typedef struct kd_packet_t {
uint32_t id;
uint32_t checksum;
uint8_t data[0];
} __attribute__((packed)) kd_packet_t;
}) kd_packet_t;
// Compile time assertions macros taken from :
// http://www.pixelbeat.org/programming/gcc/static_assert.html

View File

@ -280,14 +280,16 @@ int wind_wait_packet (WindCtx *ctx, const uint32_t type, kd_packet_t **p) {
}
// http://dfrws.org/2007/proceedings/p62-dolan-gavitt.pdf
R_PACKED (
typedef struct {
char tag[4];
uint32_t start_vpn;
uint32_t end_vpn;
uint32_t parent;
uint32_t left, right;
uint32_t left;
uint32_t right;
uint32_t flags;
} __attribute__((packed)) mmvad_short;
}) mmvad_short;
int
wind_walk_vadtree (WindCtx *ctx, ut64 address, ut64 parent) {