disasm displacements and offsets by default now printed as "relative" signed integers and not as unsigned offsets could toggle it back with disasm command.
help disasm in debugger
This commit is contained in:
parent
069ea6228e
commit
fe687fd1a6
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -96,52 +96,53 @@
|
|||||||
BX_TOKEN_TAKE = 312,
|
BX_TOKEN_TAKE = 312,
|
||||||
BX_TOKEN_DMA = 313,
|
BX_TOKEN_DMA = 313,
|
||||||
BX_TOKEN_IRQ = 314,
|
BX_TOKEN_IRQ = 314,
|
||||||
BX_TOKEN_DISASSEMBLE = 315,
|
BX_TOKEN_HEX = 315,
|
||||||
BX_TOKEN_INSTRUMENT = 316,
|
BX_TOKEN_DISASM = 316,
|
||||||
BX_TOKEN_STRING = 317,
|
BX_TOKEN_INSTRUMENT = 317,
|
||||||
BX_TOKEN_STOP = 318,
|
BX_TOKEN_STRING = 318,
|
||||||
BX_TOKEN_DOIT = 319,
|
BX_TOKEN_STOP = 319,
|
||||||
BX_TOKEN_CRC = 320,
|
BX_TOKEN_DOIT = 320,
|
||||||
BX_TOKEN_TRACE = 321,
|
BX_TOKEN_CRC = 321,
|
||||||
BX_TOKEN_TRACEREG = 322,
|
BX_TOKEN_TRACE = 322,
|
||||||
BX_TOKEN_TRACEMEM = 323,
|
BX_TOKEN_TRACEREG = 323,
|
||||||
BX_TOKEN_SWITCH_MODE = 324,
|
BX_TOKEN_TRACEMEM = 324,
|
||||||
BX_TOKEN_SIZE = 325,
|
BX_TOKEN_SWITCH_MODE = 325,
|
||||||
BX_TOKEN_PTIME = 326,
|
BX_TOKEN_SIZE = 326,
|
||||||
BX_TOKEN_TIMEBP_ABSOLUTE = 327,
|
BX_TOKEN_PTIME = 327,
|
||||||
BX_TOKEN_TIMEBP = 328,
|
BX_TOKEN_TIMEBP_ABSOLUTE = 328,
|
||||||
BX_TOKEN_RECORD = 329,
|
BX_TOKEN_TIMEBP = 329,
|
||||||
BX_TOKEN_PLAYBACK = 330,
|
BX_TOKEN_RECORD = 330,
|
||||||
BX_TOKEN_MODEBP = 331,
|
BX_TOKEN_PLAYBACK = 331,
|
||||||
BX_TOKEN_PRINT_STACK = 332,
|
BX_TOKEN_MODEBP = 332,
|
||||||
BX_TOKEN_WATCH = 333,
|
BX_TOKEN_PRINT_STACK = 333,
|
||||||
BX_TOKEN_UNWATCH = 334,
|
BX_TOKEN_WATCH = 334,
|
||||||
BX_TOKEN_READ = 335,
|
BX_TOKEN_UNWATCH = 335,
|
||||||
BX_TOKEN_WRITE = 336,
|
BX_TOKEN_READ = 336,
|
||||||
BX_TOKEN_SHOW = 337,
|
BX_TOKEN_WRITE = 337,
|
||||||
BX_TOKEN_LOAD_SYMBOLS = 338,
|
BX_TOKEN_SHOW = 338,
|
||||||
BX_TOKEN_SYMBOLS = 339,
|
BX_TOKEN_LOAD_SYMBOLS = 339,
|
||||||
BX_TOKEN_LIST_SYMBOLS = 340,
|
BX_TOKEN_SYMBOLS = 340,
|
||||||
BX_TOKEN_GLOBAL = 341,
|
BX_TOKEN_LIST_SYMBOLS = 341,
|
||||||
BX_TOKEN_WHERE = 342,
|
BX_TOKEN_GLOBAL = 342,
|
||||||
BX_TOKEN_PRINT_STRING = 343,
|
BX_TOKEN_WHERE = 343,
|
||||||
BX_TOKEN_NUMERIC = 344,
|
BX_TOKEN_PRINT_STRING = 344,
|
||||||
BX_TOKEN_NE2000 = 345,
|
BX_TOKEN_NUMERIC = 345,
|
||||||
BX_TOKEN_PIC = 346,
|
BX_TOKEN_NE2000 = 346,
|
||||||
BX_TOKEN_PAGE = 347,
|
BX_TOKEN_PIC = 347,
|
||||||
BX_TOKEN_HELP = 348,
|
BX_TOKEN_PAGE = 348,
|
||||||
BX_TOKEN_CALC = 349,
|
BX_TOKEN_HELP = 349,
|
||||||
BX_TOKEN_VGA = 350,
|
BX_TOKEN_CALC = 350,
|
||||||
BX_TOKEN_PCI = 351,
|
BX_TOKEN_VGA = 351,
|
||||||
BX_TOKEN_COMMAND = 352,
|
BX_TOKEN_PCI = 352,
|
||||||
BX_TOKEN_GENERIC = 353,
|
BX_TOKEN_COMMAND = 353,
|
||||||
BX_TOKEN_RSHIFT = 354,
|
BX_TOKEN_GENERIC = 354,
|
||||||
BX_TOKEN_LSHIFT = 355,
|
BX_TOKEN_RSHIFT = 355,
|
||||||
BX_TOKEN_REG_IP = 356,
|
BX_TOKEN_LSHIFT = 356,
|
||||||
BX_TOKEN_REG_EIP = 357,
|
BX_TOKEN_REG_IP = 357,
|
||||||
BX_TOKEN_REG_RIP = 358,
|
BX_TOKEN_REG_EIP = 358,
|
||||||
NEG = 359,
|
BX_TOKEN_REG_RIP = 359,
|
||||||
NOT = 360
|
NEG = 360,
|
||||||
|
NOT = 361
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
/* Tokens. */
|
/* Tokens. */
|
||||||
@ -202,52 +203,53 @@
|
|||||||
#define BX_TOKEN_TAKE 312
|
#define BX_TOKEN_TAKE 312
|
||||||
#define BX_TOKEN_DMA 313
|
#define BX_TOKEN_DMA 313
|
||||||
#define BX_TOKEN_IRQ 314
|
#define BX_TOKEN_IRQ 314
|
||||||
#define BX_TOKEN_DISASSEMBLE 315
|
#define BX_TOKEN_HEX 315
|
||||||
#define BX_TOKEN_INSTRUMENT 316
|
#define BX_TOKEN_DISASM 316
|
||||||
#define BX_TOKEN_STRING 317
|
#define BX_TOKEN_INSTRUMENT 317
|
||||||
#define BX_TOKEN_STOP 318
|
#define BX_TOKEN_STRING 318
|
||||||
#define BX_TOKEN_DOIT 319
|
#define BX_TOKEN_STOP 319
|
||||||
#define BX_TOKEN_CRC 320
|
#define BX_TOKEN_DOIT 320
|
||||||
#define BX_TOKEN_TRACE 321
|
#define BX_TOKEN_CRC 321
|
||||||
#define BX_TOKEN_TRACEREG 322
|
#define BX_TOKEN_TRACE 322
|
||||||
#define BX_TOKEN_TRACEMEM 323
|
#define BX_TOKEN_TRACEREG 323
|
||||||
#define BX_TOKEN_SWITCH_MODE 324
|
#define BX_TOKEN_TRACEMEM 324
|
||||||
#define BX_TOKEN_SIZE 325
|
#define BX_TOKEN_SWITCH_MODE 325
|
||||||
#define BX_TOKEN_PTIME 326
|
#define BX_TOKEN_SIZE 326
|
||||||
#define BX_TOKEN_TIMEBP_ABSOLUTE 327
|
#define BX_TOKEN_PTIME 327
|
||||||
#define BX_TOKEN_TIMEBP 328
|
#define BX_TOKEN_TIMEBP_ABSOLUTE 328
|
||||||
#define BX_TOKEN_RECORD 329
|
#define BX_TOKEN_TIMEBP 329
|
||||||
#define BX_TOKEN_PLAYBACK 330
|
#define BX_TOKEN_RECORD 330
|
||||||
#define BX_TOKEN_MODEBP 331
|
#define BX_TOKEN_PLAYBACK 331
|
||||||
#define BX_TOKEN_PRINT_STACK 332
|
#define BX_TOKEN_MODEBP 332
|
||||||
#define BX_TOKEN_WATCH 333
|
#define BX_TOKEN_PRINT_STACK 333
|
||||||
#define BX_TOKEN_UNWATCH 334
|
#define BX_TOKEN_WATCH 334
|
||||||
#define BX_TOKEN_READ 335
|
#define BX_TOKEN_UNWATCH 335
|
||||||
#define BX_TOKEN_WRITE 336
|
#define BX_TOKEN_READ 336
|
||||||
#define BX_TOKEN_SHOW 337
|
#define BX_TOKEN_WRITE 337
|
||||||
#define BX_TOKEN_LOAD_SYMBOLS 338
|
#define BX_TOKEN_SHOW 338
|
||||||
#define BX_TOKEN_SYMBOLS 339
|
#define BX_TOKEN_LOAD_SYMBOLS 339
|
||||||
#define BX_TOKEN_LIST_SYMBOLS 340
|
#define BX_TOKEN_SYMBOLS 340
|
||||||
#define BX_TOKEN_GLOBAL 341
|
#define BX_TOKEN_LIST_SYMBOLS 341
|
||||||
#define BX_TOKEN_WHERE 342
|
#define BX_TOKEN_GLOBAL 342
|
||||||
#define BX_TOKEN_PRINT_STRING 343
|
#define BX_TOKEN_WHERE 343
|
||||||
#define BX_TOKEN_NUMERIC 344
|
#define BX_TOKEN_PRINT_STRING 344
|
||||||
#define BX_TOKEN_NE2000 345
|
#define BX_TOKEN_NUMERIC 345
|
||||||
#define BX_TOKEN_PIC 346
|
#define BX_TOKEN_NE2000 346
|
||||||
#define BX_TOKEN_PAGE 347
|
#define BX_TOKEN_PIC 347
|
||||||
#define BX_TOKEN_HELP 348
|
#define BX_TOKEN_PAGE 348
|
||||||
#define BX_TOKEN_CALC 349
|
#define BX_TOKEN_HELP 349
|
||||||
#define BX_TOKEN_VGA 350
|
#define BX_TOKEN_CALC 350
|
||||||
#define BX_TOKEN_PCI 351
|
#define BX_TOKEN_VGA 351
|
||||||
#define BX_TOKEN_COMMAND 352
|
#define BX_TOKEN_PCI 352
|
||||||
#define BX_TOKEN_GENERIC 353
|
#define BX_TOKEN_COMMAND 353
|
||||||
#define BX_TOKEN_RSHIFT 354
|
#define BX_TOKEN_GENERIC 354
|
||||||
#define BX_TOKEN_LSHIFT 355
|
#define BX_TOKEN_RSHIFT 355
|
||||||
#define BX_TOKEN_REG_IP 356
|
#define BX_TOKEN_LSHIFT 356
|
||||||
#define BX_TOKEN_REG_EIP 357
|
#define BX_TOKEN_REG_IP 357
|
||||||
#define BX_TOKEN_REG_RIP 358
|
#define BX_TOKEN_REG_EIP 358
|
||||||
#define NEG 359
|
#define BX_TOKEN_REG_RIP 359
|
||||||
#define NOT 360
|
#define NEG 360
|
||||||
|
#define NOT 361
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -261,7 +263,7 @@ typedef union YYSTYPE
|
|||||||
bx_bool bval;
|
bx_bool bval;
|
||||||
}
|
}
|
||||||
/* Line 1489 of yacc.c. */
|
/* Line 1489 of yacc.c. */
|
||||||
#line 265 "y.tab.h"
|
#line 267 "y.tab.h"
|
||||||
YYSTYPE;
|
YYSTYPE;
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id: dis_groups.cc,v 1.45 2009-12-28 13:44:32 sshwarts Exp $
|
// $Id: dis_groups.cc,v 1.46 2009-12-28 13:52:40 sshwarts Exp $
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2009 Stanislav Shwartsman
|
// Copyright (c) 2005-2009 Stanislav Shwartsman
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id: disasm.h,v 1.52 2009-12-28 13:44:32 sshwarts Exp $
|
// $Id: disasm.h,v 1.53 2009-12-28 13:52:40 sshwarts Exp $
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2009 Stanislav Shwartsman
|
// Copyright (c) 2005-2009 Stanislav Shwartsman
|
||||||
@ -310,9 +310,10 @@ private:
|
|||||||
|
|
||||||
void print_memory_access16(int datasize,
|
void print_memory_access16(int datasize,
|
||||||
const char *seg, const char *index, Bit16u disp);
|
const char *seg, const char *index, Bit16u disp);
|
||||||
void print_memory_access (int datasize,
|
void print_memory_access32(int datasize,
|
||||||
const char *seg, const char *base, const char *index, int scale,
|
const char *seg, const char *base, const char *index, int scale, Bit32s disp);
|
||||||
Bit32s disp, bx_bool disp64 = 0);
|
void print_memory_access64(int datasize,
|
||||||
|
const char *seg, const char *base, const char *index, int scale, Bit32s disp);
|
||||||
|
|
||||||
void print_disassembly_intel(const x86_insn *insn, const BxDisasmOpcodeInfo_t *entry);
|
void print_disassembly_intel(const x86_insn *insn, const BxDisasmOpcodeInfo_t *entry);
|
||||||
void print_disassembly_att (const x86_insn *insn, const BxDisasmOpcodeInfo_t *entry);
|
void print_disassembly_att (const x86_insn *insn, const BxDisasmOpcodeInfo_t *entry);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id: resolve.cc,v 1.19 2009-10-14 20:45:29 sshwarts Exp $
|
// $Id: resolve.cc,v 1.20 2009-12-28 13:52:40 sshwarts Exp $
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2009 Stanislav Shwartsman
|
// Copyright (c) 2005-2009 Stanislav Shwartsman
|
||||||
@ -197,9 +197,9 @@ void disassembler::resolve32_mod0(const x86_insn *insn, unsigned mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((insn->rm & 7) == 5) /* no reg, 32-bit displacement */
|
if ((insn->rm & 7) == 5) /* no reg, 32-bit displacement */
|
||||||
print_memory_access(mode, seg, eip_regname, NULL, 0, insn->displacement.displ32);
|
print_memory_access32(mode, seg, eip_regname, NULL, 0, insn->displacement.displ32);
|
||||||
else
|
else
|
||||||
print_memory_access(mode, seg, general_32bit_regname[insn->rm], NULL, 0, 0);
|
print_memory_access32(mode, seg, general_32bit_regname[insn->rm], NULL, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::resolve32_mod1or2(const x86_insn *insn, unsigned mode)
|
void disassembler::resolve32_mod1or2(const x86_insn *insn, unsigned mode)
|
||||||
@ -211,7 +211,7 @@ void disassembler::resolve32_mod1or2(const x86_insn *insn, unsigned mode)
|
|||||||
else
|
else
|
||||||
seg = sreg_mod01or10_rm32[insn->rm];
|
seg = sreg_mod01or10_rm32[insn->rm];
|
||||||
|
|
||||||
print_memory_access(mode, seg,
|
print_memory_access32(mode, seg,
|
||||||
general_32bit_regname[insn->rm], NULL, 0, insn->displacement.displ32);
|
general_32bit_regname[insn->rm], NULL, 0, insn->displacement.displ32);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ void disassembler::resolve32_mod0_rm4(const x86_insn *insn, unsigned mode)
|
|||||||
if (insn->index != 4)
|
if (insn->index != 4)
|
||||||
index = general_32bit_regname[insn->index];
|
index = general_32bit_regname[insn->index];
|
||||||
|
|
||||||
print_memory_access(mode, seg, base, index, insn->scale, disp32);
|
print_memory_access32(mode, seg, base, index, insn->scale, disp32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::resolve32_mod1or2_rm4(const x86_insn *insn, unsigned mode)
|
void disassembler::resolve32_mod1or2_rm4(const x86_insn *insn, unsigned mode)
|
||||||
@ -248,7 +248,7 @@ void disassembler::resolve32_mod1or2_rm4(const x86_insn *insn, unsigned mode)
|
|||||||
if (insn->index != 4)
|
if (insn->index != 4)
|
||||||
index = general_32bit_regname[insn->index];
|
index = general_32bit_regname[insn->index];
|
||||||
|
|
||||||
print_memory_access(mode, seg,
|
print_memory_access32(mode, seg,
|
||||||
general_32bit_regname[insn->base], index, insn->scale, insn->displacement.displ32);
|
general_32bit_regname[insn->base], index, insn->scale, insn->displacement.displ32);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,9 +265,9 @@ void disassembler::resolve64_mod0(const x86_insn *insn, unsigned mode)
|
|||||||
else rip_regname = "%rip";
|
else rip_regname = "%rip";
|
||||||
|
|
||||||
if ((insn->rm & 7) == 5) /* no reg, 32-bit displacement */
|
if ((insn->rm & 7) == 5) /* no reg, 32-bit displacement */
|
||||||
print_memory_access(mode, seg, rip_regname, NULL, 0, (Bit32s) insn->displacement.displ32, 1);
|
print_memory_access64(mode, seg, rip_regname, NULL, 0, (Bit32s) insn->displacement.displ32);
|
||||||
else
|
else
|
||||||
print_memory_access(mode, seg, general_64bit_regname[insn->rm], NULL, 0, 0);
|
print_memory_access64(mode, seg, general_64bit_regname[insn->rm], NULL, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::resolve64_mod1or2(const x86_insn *insn, unsigned mode)
|
void disassembler::resolve64_mod1or2(const x86_insn *insn, unsigned mode)
|
||||||
@ -279,8 +279,8 @@ void disassembler::resolve64_mod1or2(const x86_insn *insn, unsigned mode)
|
|||||||
else
|
else
|
||||||
seg = sreg_mod01or10_rm32[insn->rm];
|
seg = sreg_mod01or10_rm32[insn->rm];
|
||||||
|
|
||||||
print_memory_access(mode, seg,
|
print_memory_access64(mode, seg,
|
||||||
general_64bit_regname[insn->rm], NULL, 0, (Bit32s) insn->displacement.displ32, 1);
|
general_64bit_regname[insn->rm], NULL, 0, (Bit32s) insn->displacement.displ32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::resolve64_mod0_rm4(const x86_insn *insn, unsigned mode)
|
void disassembler::resolve64_mod0_rm4(const x86_insn *insn, unsigned mode)
|
||||||
@ -301,7 +301,7 @@ void disassembler::resolve64_mod0_rm4(const x86_insn *insn, unsigned mode)
|
|||||||
if (insn->index != 4)
|
if (insn->index != 4)
|
||||||
index = general_64bit_regname[insn->index];
|
index = general_64bit_regname[insn->index];
|
||||||
|
|
||||||
print_memory_access(mode, seg, base, index, insn->scale, disp32, 1);
|
print_memory_access64(mode, seg, base, index, insn->scale, disp32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::resolve64_mod1or2_rm4(const x86_insn *insn, unsigned mode)
|
void disassembler::resolve64_mod1or2_rm4(const x86_insn *insn, unsigned mode)
|
||||||
@ -316,8 +316,8 @@ void disassembler::resolve64_mod1or2_rm4(const x86_insn *insn, unsigned mode)
|
|||||||
if (insn->index != 4)
|
if (insn->index != 4)
|
||||||
index = general_64bit_regname[insn->index];
|
index = general_64bit_regname[insn->index];
|
||||||
|
|
||||||
print_memory_access(mode, seg,
|
print_memory_access64(mode, seg,
|
||||||
general_64bit_regname[insn->base], index, insn->scale, (Bit32s) insn->displacement.displ32, 1);
|
general_64bit_regname[insn->base], index, insn->scale, (Bit32s) insn->displacement.displ32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_datasize(unsigned size)
|
void disassembler::print_datasize(unsigned size)
|
||||||
@ -364,8 +364,12 @@ void disassembler::print_memory_access16(int datasize,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (disp != 0)
|
if (disp != 0) {
|
||||||
dis_sprintf("%s:[%s+0x%x]", seg, index, (unsigned) disp);
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:[%s+0x%x]", seg, index, (unsigned) disp);
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s%+d]", seg, index, (int) (Bit16s) disp);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:[%s]", seg, index);
|
dis_sprintf("%s:[%s]", seg, index);
|
||||||
}
|
}
|
||||||
@ -378,16 +382,20 @@ void disassembler::print_memory_access16(int datasize,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (disp != 0)
|
if (disp != 0) {
|
||||||
dis_sprintf("%s:0x%x(%s,1)", seg, (unsigned) disp, index);
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:0x%x(%s,1)", seg, (unsigned) disp, index);
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:%d(%s,1)", seg, (int) (Bit16s) disp, index);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:(%s,1)", seg, index);
|
dis_sprintf("%s:(%s,1)", seg, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void disassembler::print_memory_access(int datasize,
|
void disassembler::print_memory_access32(int datasize,
|
||||||
const char *seg, const char *base, const char *index, int scale, Bit32s disp, bx_bool disp64)
|
const char *seg, const char *base, const char *index, int scale, Bit32s disp)
|
||||||
{
|
{
|
||||||
print_datasize(datasize);
|
print_datasize(datasize);
|
||||||
|
|
||||||
@ -399,24 +407,17 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
{
|
{
|
||||||
if (index == NULL)
|
if (index == NULL)
|
||||||
{
|
{
|
||||||
if (disp64) {
|
dis_sprintf("%s:0x%x", seg, (unsigned) disp);
|
||||||
dis_sprintf("%s:0x%08x%08x", seg, GET32H(disp), GET32L(disp));
|
|
||||||
} else {
|
|
||||||
dis_sprintf("%s:0x%x", seg, (unsigned) disp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (scale != 1)
|
if (scale != 1)
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:[%s*%d+0x%08x%08x]", seg, index, scale,
|
|
||||||
GET32H(disp), GET32L(disp));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:[%s*%d+0x%x]", seg, index, scale, (unsigned) disp);
|
dis_sprintf("%s:[%s*%d+0x%x]", seg, index, scale, (unsigned) disp);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:[%s*%d%+d]", seg, index, scale, (int) disp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:[%s*%d]", seg, index, scale);
|
dis_sprintf("%s:[%s*%d]", seg, index, scale);
|
||||||
@ -424,12 +425,10 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:[%s+0x%08x%08x]", seg, index, GET32H(disp), GET32L(disp));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:[%s+0x%x]", seg, index, (unsigned) disp);
|
dis_sprintf("%s:[%s+0x%x]", seg, index, (unsigned) disp);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:[%s%+d]", seg, index, (int) disp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dis_sprintf("%s:[%s]", seg, index);
|
dis_sprintf("%s:[%s]", seg, index);
|
||||||
@ -442,12 +441,10 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
if (index == NULL)
|
if (index == NULL)
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:[%s+0x%08x%08x]", seg, base, GET32H(disp), GET32L(disp));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:[%s+0x%x]", seg, base, (unsigned) disp);
|
dis_sprintf("%s:[%s+0x%x]", seg, base, (unsigned) disp);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:[%s%+d]", seg, base, (int) disp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dis_sprintf("%s:[%s]", seg, base);
|
dis_sprintf("%s:[%s]", seg, base);
|
||||||
@ -458,13 +455,10 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
if (scale != 1)
|
if (scale != 1)
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:[%s+%s*%d+0x%08x%08x]", seg, base, index, scale,
|
|
||||||
GET32H(disp), GET32L(disp));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:[%s+%s*%d+0x%x]", seg, base, index, scale, (unsigned) disp);
|
dis_sprintf("%s:[%s+%s*%d+0x%x]", seg, base, index, scale, (unsigned) disp);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:[%s+%s*%d%+d]", seg, base, index, scale, (int) disp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dis_sprintf("%s:[%s+%s*%d]", seg, base, index, scale);
|
dis_sprintf("%s:[%s+%s*%d]", seg, base, index, scale);
|
||||||
@ -473,12 +467,10 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:[%s+%s+0x%08x%08x]", seg, base, index, GET32H(disp), GET32L(disp));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:[%s+%s+0x%x]", seg, base, index, (unsigned) disp);
|
dis_sprintf("%s:[%s+%s+0x%x]", seg, base, index, (unsigned) disp);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:[%s+%s%+d]", seg, base, index, (int) disp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:[%s+%s]", seg, base, index);
|
dis_sprintf("%s:[%s+%s]", seg, base, index);
|
||||||
@ -492,20 +484,15 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
{
|
{
|
||||||
if (index == NULL)
|
if (index == NULL)
|
||||||
{
|
{
|
||||||
if (disp64) {
|
dis_sprintf("%s:0x%x", seg, (unsigned) disp);
|
||||||
dis_sprintf("%s:0x%08x%08x", seg, GET32H(disp), GET32L(disp));
|
|
||||||
} else {
|
|
||||||
dis_sprintf("%s:0x%x", seg, (unsigned) disp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:0x%08x%08x(,%s,%d)", seg, GET32H(disp), GET32L(disp), index, scale);
|
|
||||||
} else {
|
|
||||||
dis_sprintf("%s:0x%x(,%s,%d)", seg, (unsigned) disp, index, scale);
|
dis_sprintf("%s:0x%x(,%s,%d)", seg, (unsigned) disp, index, scale);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:%d(,%s,%d)", seg, (int) disp, index, scale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:(,%s,%d)", seg, index, scale);
|
dis_sprintf("%s:(,%s,%d)", seg, index, scale);
|
||||||
@ -516,12 +503,10 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
if (index == NULL)
|
if (index == NULL)
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:0x%08x%08x(%s)", seg, GET32H(disp), GET32L(disp), base);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:0x%x(%s)", seg, (unsigned) disp, base);
|
dis_sprintf("%s:0x%x(%s)", seg, (unsigned) disp, base);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:%d(%s)", seg, (int) disp, base);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:(%s)", seg, base);
|
dis_sprintf("%s:(%s)", seg, base);
|
||||||
@ -529,12 +514,144 @@ void disassembler::print_memory_access(int datasize,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (disp != 0) {
|
if (disp != 0) {
|
||||||
if (disp64) {
|
if (offset_mode_hex)
|
||||||
dis_sprintf("%s:0x%08x%08x(%s,%s,%d)", seg, GET32H(disp), GET32L(disp), base, index, scale);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dis_sprintf("%s:0x%x(%s,%s,%d)", seg, (unsigned) disp, base, index, scale);
|
dis_sprintf("%s:0x%x(%s,%s,%d)", seg, (unsigned) disp, base, index, scale);
|
||||||
}
|
else
|
||||||
|
dis_sprintf("%s:%d(%s,%s,%d)", seg, (int) disp, base, index, scale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:(%s,%s,%d)", seg, base, index, scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void disassembler::print_memory_access64(int datasize,
|
||||||
|
const char *seg, const char *base, const char *index, int scale, Bit32s disp)
|
||||||
|
{
|
||||||
|
Bit64u disp64 = (Bit64s) disp;
|
||||||
|
|
||||||
|
print_datasize(datasize);
|
||||||
|
|
||||||
|
scale = 1 << scale;
|
||||||
|
|
||||||
|
if (intel_mode)
|
||||||
|
{
|
||||||
|
if (base == NULL)
|
||||||
|
{
|
||||||
|
if (index == NULL)
|
||||||
|
{
|
||||||
|
dis_sprintf("%s:0x%08x%08x", seg, GET32H(disp64), GET32L(disp64));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (scale != 1)
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:[%s*%d+0x%08x%08x]", seg, index, scale, GET32H(disp64), GET32L(disp64));
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s*%d%+d]", seg, index, scale, (int) disp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s*%d]", seg, index, scale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:[%s+0x%08x%08x]", seg, index, GET32H(disp64), GET32L(disp64));
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s%+d]", seg, index, (int) disp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dis_sprintf("%s:[%s]", seg, index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (index == NULL)
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:[%s+0x%08x%08x]", seg, base, GET32H(disp64), GET32L(disp64));
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s%+d]", seg, base, (int) disp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dis_sprintf("%s:[%s]", seg, base);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (scale != 1)
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:[%s+%s*%d+0x%08x%08x]", seg, base, index, scale, GET32H(disp64), GET32L(disp64));
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s+%s*%d%+d]", seg, base, index, scale, (int) disp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dis_sprintf("%s:[%s+%s*%d]", seg, base, index, scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:[%s+%s+0x%08x%08x]", seg, base, index, GET32H(disp64), GET32L(disp64));
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s+%s%+d]", seg, base, index, (int) disp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:[%s+%s]", seg, base, index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (base == NULL)
|
||||||
|
{
|
||||||
|
if (index == NULL)
|
||||||
|
{
|
||||||
|
dis_sprintf("%s:0x%08x%08x", seg, GET32H(disp64), GET32L(disp64));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:0x%08x%08x(,%s,%d)", seg, GET32H(disp64), GET32L(disp64), index, scale);
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:%d(,%s,%d)", seg, (int) disp, index, scale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:(,%s,%d)", seg, index, scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (index == NULL)
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:0x%08x%08x(%s)", seg, GET32H(disp64), GET32L(disp64), base);
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:%d(%s)", seg, (int) disp, base);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:(%s)", seg, base);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (disp != 0) {
|
||||||
|
if (offset_mode_hex)
|
||||||
|
dis_sprintf("%s:0x%08x%08x(%s,%s,%d)", seg, GET32H(disp64), GET32L(disp64), base, index, scale);
|
||||||
|
else
|
||||||
|
dis_sprintf("%s:%d(%s,%s,%d)", seg, (int) disp, base, index, scale);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dis_sprintf("%s:(%s,%s,%d)", seg, base, index, scale);
|
dis_sprintf("%s:(%s,%s,%d)", seg, base, index, scale);
|
||||||
|
Loading…
Reference in New Issue
Block a user