Added a peek() helper and passing the base address through the "call" pointer
This commit is contained in:
parent
98576fdf6d
commit
cfe1768474
@ -203,6 +203,7 @@ typedef struct _ArchPluginHelper
|
|||||||
ssize_t (*write)(Arch * arch, void const * buf, size_t size);
|
ssize_t (*write)(Arch * arch, void const * buf, size_t size);
|
||||||
|
|
||||||
/* disassembly */
|
/* disassembly */
|
||||||
|
ssize_t (*peek)(Arch * arch, void * buf, size_t size);
|
||||||
ssize_t (*read)(Arch * arch, void * buf, size_t size);
|
ssize_t (*read)(Arch * arch, void * buf, size_t size);
|
||||||
off_t (*seek)(Arch * arch, off_t offset, int whence);
|
off_t (*seek)(Arch * arch, off_t offset, int whence);
|
||||||
} ArchPluginHelper;
|
} ArchPluginHelper;
|
||||||
@ -221,8 +222,7 @@ struct _ArchPlugin
|
|||||||
|
|
||||||
int (*write)(ArchPlugin * arch, ArchInstruction * instruction,
|
int (*write)(ArchPlugin * arch, ArchInstruction * instruction,
|
||||||
ArchInstructionCall * call);
|
ArchInstructionCall * call);
|
||||||
int (*decode)(ArchPlugin * arch, ArchInstructionCall * call,
|
int (*decode)(ArchPlugin * arch, ArchInstructionCall * call);
|
||||||
off_t base);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* !DEVEL_ASM_ARCH_H */
|
#endif /* !DEVEL_ASM_ARCH_H */
|
||||||
|
@ -101,6 +101,8 @@ int asm_close(Asm * a);
|
|||||||
/* assemble */
|
/* assemble */
|
||||||
int asm_assemble(Asm * a, AsmPrefs * prefs, char const * infile,
|
int asm_assemble(Asm * a, AsmPrefs * prefs, char const * infile,
|
||||||
char const * outfile);
|
char const * outfile);
|
||||||
|
int asm_assemble_string(Asm * a, AsmPrefs * prefs, char const * outfile,
|
||||||
|
char const * string);
|
||||||
int asm_open_assemble(Asm * a, char const * outfile);
|
int asm_open_assemble(Asm * a, char const * outfile);
|
||||||
|
|
||||||
int asm_instruction(Asm * a, char const * name, unsigned int operands_cnt, ...);
|
int asm_instruction(Asm * a, char const * name, unsigned int operands_cnt, ...);
|
||||||
|
@ -79,8 +79,7 @@ static ArchInstruction _dalvik_instructions[] =
|
|||||||
/* plug-in */
|
/* plug-in */
|
||||||
static int _dalvik_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
static int _dalvik_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
||||||
ArchInstructionCall * call);
|
ArchInstructionCall * call);
|
||||||
static int _dalvik_decode(ArchPlugin * plugin, ArchInstructionCall * call,
|
static int _dalvik_decode(ArchPlugin * plugin, ArchInstructionCall * call);
|
||||||
off_t base);
|
|
||||||
|
|
||||||
|
|
||||||
/* public */
|
/* public */
|
||||||
@ -139,8 +138,7 @@ static int _decode_immediate(DalvikDecode * dd, size_t i);
|
|||||||
static int _decode_operand(DalvikDecode * dd, size_t i);
|
static int _decode_operand(DalvikDecode * dd, size_t i);
|
||||||
static int _decode_register(DalvikDecode * dd, size_t i);
|
static int _decode_register(DalvikDecode * dd, size_t i);
|
||||||
|
|
||||||
static int _dalvik_decode(ArchPlugin * plugin, ArchInstructionCall * call,
|
static int _dalvik_decode(ArchPlugin * plugin, ArchInstructionCall * call)
|
||||||
off_t base)
|
|
||||||
{
|
{
|
||||||
DalvikDecode dd;
|
DalvikDecode dd;
|
||||||
ArchPluginHelper * helper = plugin->helper;
|
ArchPluginHelper * helper = plugin->helper;
|
||||||
|
@ -250,8 +250,7 @@ static ArchInstruction _java_instructions[] =
|
|||||||
/* plug-in */
|
/* plug-in */
|
||||||
static int _java_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
static int _java_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
||||||
ArchInstructionCall * call);
|
ArchInstructionCall * call);
|
||||||
static int _java_decode(ArchPlugin * plugin, ArchInstructionCall * call,
|
static int _java_decode(ArchPlugin * plugin, ArchInstructionCall * call);
|
||||||
off_t base);
|
|
||||||
|
|
||||||
|
|
||||||
/* public */
|
/* public */
|
||||||
@ -318,8 +317,7 @@ static int _java_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
|||||||
|
|
||||||
|
|
||||||
/* java_decode */
|
/* java_decode */
|
||||||
static int _java_decode(ArchPlugin * plugin, ArchInstructionCall * call,
|
static int _java_decode(ArchPlugin * plugin, ArchInstructionCall * call)
|
||||||
off_t base)
|
|
||||||
{
|
{
|
||||||
ArchPluginHelper * helper = plugin->helper;
|
ArchPluginHelper * helper = plugin->helper;
|
||||||
uint8_t u8;
|
uint8_t u8;
|
||||||
|
@ -22,8 +22,7 @@
|
|||||||
/* private */
|
/* private */
|
||||||
/* prototypes */
|
/* prototypes */
|
||||||
/* plug-in */
|
/* plug-in */
|
||||||
static int _sparc_decode(ArchPlugin * plugin, ArchInstructionCall * call,
|
static int _sparc_decode(ArchPlugin * plugin, ArchInstructionCall * call);
|
||||||
off_t base);
|
|
||||||
static int _sparc_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
static int _sparc_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
||||||
ArchInstructionCall * call);
|
ArchInstructionCall * call);
|
||||||
|
|
||||||
@ -31,8 +30,7 @@ static int _sparc_write(ArchPlugin * plugin, ArchInstruction * instruction,
|
|||||||
/* functions */
|
/* functions */
|
||||||
/* plug-in */
|
/* plug-in */
|
||||||
/* sparc_decode */
|
/* sparc_decode */
|
||||||
static int _sparc_decode(ArchPlugin * plugin, ArchInstructionCall * call,
|
static int _sparc_decode(ArchPlugin * plugin, ArchInstructionCall * call)
|
||||||
off_t base)
|
|
||||||
{
|
{
|
||||||
ArchPluginHelper * helper = plugin->helper;
|
ArchPluginHelper * helper = plugin->helper;
|
||||||
uint32_t u32;
|
uint32_t u32;
|
||||||
|
Loading…
Reference in New Issue
Block a user