Use uint64_t instead of size_t for addresses
This commit is contained in:
parent
25f5612d4d
commit
c04f873791
|
@ -228,7 +228,7 @@ void AArch64_init(MCRegisterInfo *MRI)
|
|||
static DecodeStatus _getInstruction(MCInst *MI,
|
||||
unsigned char *code, size_t code_len,
|
||||
uint16_t *Size,
|
||||
size_t Address, MCRegisterInfo *MRI)
|
||||
uint64_t Address, MCRegisterInfo *MRI)
|
||||
{
|
||||
if (code_len < 4) {
|
||||
// not enough data
|
||||
|
@ -254,7 +254,7 @@ static DecodeStatus _getInstruction(MCInst *MI,
|
|||
return MCDisassembler_Fail;
|
||||
}
|
||||
|
||||
bool AArch64_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, size_t address, void *info)
|
||||
bool AArch64_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *info)
|
||||
{
|
||||
DecodeStatus status = _getInstruction(instr,
|
||||
code, code_len,
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
void AArch64_init(MCRegisterInfo *MRI);
|
||||
|
||||
bool AArch64_getInstruction(csh ud, unsigned char *code, size_t code_len,
|
||||
MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ void ARM_init(MCRegisterInfo *MRI)
|
|||
}
|
||||
|
||||
static DecodeStatus _ARM_getInstruction(cs_struct *ud, MCInst *MI, unsigned char *code, size_t code_len,
|
||||
uint16_t *Size, size_t Address)
|
||||
uint16_t *Size, uint64_t Address)
|
||||
{
|
||||
uint8_t bytes[4];
|
||||
|
||||
|
@ -638,7 +638,7 @@ static void UpdateThumbVFPPredicate(cs_struct *ud, MCInst *MI)
|
|||
}
|
||||
|
||||
static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, unsigned char *code, size_t code_len,
|
||||
uint16_t *Size, size_t Address)
|
||||
uint16_t *Size, uint64_t Address)
|
||||
{
|
||||
uint8_t bytes[4];
|
||||
|
||||
|
@ -815,7 +815,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, unsigned ch
|
|||
}
|
||||
|
||||
bool Thumb_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr,
|
||||
uint16_t *size, size_t address, void *info)
|
||||
uint16_t *size, uint64_t address, void *info)
|
||||
{
|
||||
DecodeStatus status = _Thumb_getInstruction((cs_struct *)ud, instr, code, code_len, size, address);
|
||||
|
||||
|
@ -824,7 +824,7 @@ bool Thumb_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *
|
|||
}
|
||||
|
||||
bool ARM_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr,
|
||||
uint16_t *size, size_t address, void *info)
|
||||
uint16_t *size, uint64_t address, void *info)
|
||||
{
|
||||
DecodeStatus status = _ARM_getInstruction((cs_struct *)ud, instr, code, code_len, size, address);
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
void ARM_init(MCRegisterInfo *MRI);
|
||||
|
||||
bool ARM_getInstruction(csh handle, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
bool ARM_getInstruction(csh handle, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
bool Thumb_getInstruction(csh handle, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
bool Thumb_getInstruction(csh handle, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -245,7 +245,7 @@ static DecodeStatus readInstruction32(unsigned char *code, uint32_t *insn, bool
|
|||
static DecodeStatus MipsDisassembler_getInstruction(int mode, MCInst *instr,
|
||||
unsigned char *code, size_t code_len,
|
||||
uint16_t *Size,
|
||||
size_t Address, bool isBigEndian, MCRegisterInfo *MRI,
|
||||
uint64_t Address, bool isBigEndian, MCRegisterInfo *MRI,
|
||||
bool isMicroMips)
|
||||
{
|
||||
uint32_t Insn;
|
||||
|
@ -280,7 +280,7 @@ static DecodeStatus MipsDisassembler_getInstruction(int mode, MCInst *instr,
|
|||
}
|
||||
|
||||
bool Mips_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr,
|
||||
uint16_t *size, size_t address, void *info)
|
||||
uint16_t *size, uint64_t address, void *info)
|
||||
{
|
||||
cs_struct *handle = (cs_struct *)(uintptr_t)ud;
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
void Mips_init(MCRegisterInfo *MRI);
|
||||
|
||||
bool Mips_getInstruction(csh handle, unsigned char *code, size_t code_len,
|
||||
MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
bool Mips64_getInstruction(csh handle, unsigned char *code, size_t code_len,
|
||||
MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -535,7 +535,7 @@ static void update_pub_insn(cs_insn *pub, InternalInstruction *inter)
|
|||
}
|
||||
|
||||
// Public interface for the disassembler
|
||||
bool X86_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, size_t address, void *_info)
|
||||
bool X86_getInstruction(csh ud, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *_info)
|
||||
{
|
||||
cs_struct *handle = (cs_struct *)(uintptr_t)ud;
|
||||
InternalInstruction insn;
|
||||
|
|
|
@ -96,6 +96,6 @@
|
|||
#undef INSTRUCTION_IDS
|
||||
|
||||
bool X86_getInstruction(csh handle, unsigned char *code, size_t code_len,
|
||||
MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
#endif
|
||||
|
|
4
cs.c
4
cs.c
|
@ -193,7 +193,7 @@ static void fill_insn(cs_struct *handle, cs_insn *insn, char *buffer, MCInst *mc
|
|||
insn->mnemonic[sizeof(insn->mnemonic) - 1] = '\0';
|
||||
}
|
||||
|
||||
size_t cs_disasm(csh ud, unsigned char *buffer, size_t size, size_t offset, size_t count, cs_insn *insn)
|
||||
size_t cs_disasm(csh ud, unsigned char *buffer, size_t size, uint64_t offset, size_t count, cs_insn *insn)
|
||||
{
|
||||
cs_struct *handle = (cs_struct *)(uintptr_t)ud;
|
||||
MCInst mci;
|
||||
|
@ -242,7 +242,7 @@ size_t cs_disasm(csh ud, unsigned char *buffer, size_t size, size_t offset, size
|
|||
|
||||
// dynamicly allocate memory to contain disasm insn
|
||||
// NOTE: caller must free() the allocated memory itself to avoid memory leaking
|
||||
size_t cs_disasm_dyn(csh ud, unsigned char *buffer, size_t size, size_t offset, size_t count, cs_insn **insn)
|
||||
size_t cs_disasm_dyn(csh ud, unsigned char *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
|
||||
{
|
||||
cs_struct *handle = (cs_struct *)(uintptr_t)ud;
|
||||
MCInst mci;
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef void (*Printer_t)(MCInst *MI, SStream *OS, void *info);
|
|||
// this is the best time to gather insn's characteristics
|
||||
typedef void (*PostPrinter_t)(unsigned int insn, cs_insn *, char *mnem);
|
||||
|
||||
typedef bool (*Disasm_t)(csh handle, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, size_t address, void *info);
|
||||
typedef bool (*Disasm_t)(csh handle, unsigned char *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
||||
|
||||
typedef char *(*GetName_t)(unsigned int reg);
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ cs_err cs_errno(csh handle);
|
|||
*/
|
||||
size_t cs_disasm(csh handle,
|
||||
unsigned char *code, size_t code_size,
|
||||
size_t offset,
|
||||
uint64_t offset,
|
||||
size_t count,
|
||||
cs_insn *insn);
|
||||
|
||||
|
@ -170,7 +170,7 @@ size_t cs_disasm(csh handle,
|
|||
*/
|
||||
size_t cs_disasm_dyn(csh handle,
|
||||
unsigned char *code, size_t code_size,
|
||||
size_t offset,
|
||||
uint64_t offset,
|
||||
size_t count,
|
||||
cs_insn **insn);
|
||||
|
||||
|
|
Loading…
Reference in New Issue