-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add webassembly arch #1359
Add webassembly arch #1359
Conversation
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words) Added a test for this in test_m68k.s * Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16) * m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list * update bindings to match changes to cs_insn and cs_detail
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words) Added a test for this in test_m68k.s * Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16) * m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list * update bindings to match changes to cs_insn and cs_detail
and fixing a comment
merged, thanks for this amazing work! |
look forward to having Python binding support for Web Assembly next! |
@@ -119,7 +121,7 @@ set(HEADERS_COMMON | |||
set(TEST_SOURCES test_basic.c test_detail.c test_skipdata.c test_iter.c) | |||
|
|||
## architecture support | |||
if (CAPSTONE_ARM_SUPPORT) | |||
if (NOT CAPSTONE_X86_ONLY AND CAPSTONE_ARM_SUPPORT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all this seems unrelated to the pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
he ported his pull req from older branch, so mixed up with newer code. this is from old unrelated commit, but still shows up here
@@ -66,8 +66,7 @@ void printInt64Bang(SStream *O, int64_t val) | |||
SStream_concat(O, "#-0x%"PRIx64, (uint64_t)val); | |||
else | |||
SStream_concat(O, "#-0x%"PRIx64, (uint64_t)-val); | |||
} | |||
else | |||
} else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing coding style? is the capstone coding style documented anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we always use Linux kernel style. i just updated HACK.TXT with this info: 864595c
SStream_concat(O, WASM_insn_name((csh)MI->csh, MI->Opcode)); | ||
|
||
switch (MI->wasm_data.type) { | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is placing the default case at the beginning also part of the capstone coding style? didn't saw that before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not sure if Linux kernel coding style follows this, but personally i find that having default case at the top is easier to track.
else | ||
return insn_name_maps[id].name; | ||
#else | ||
return NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in diet mode wasm disassembler not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpikeI can you take a look at Diet mode?
@@ -129,8 +129,8 @@ | |||
# Capstone C interface | |||
|
|||
# API version | |||
CS_API_MAJOR = 4 | |||
CS_API_MINOR = 1 | |||
CS_API_MAJOR = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to the pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the same issue: older commits shows up here.
case CS_ARCH_MOS65XX: | ||
for (i = 0; i < insn->detail->m680x.op_count; i++) | ||
if (insn->detail->m680x.operands[i].type == (m680x_op_type)op_type) | ||
count++; | ||
break; | ||
case CS_ARCH_WASM: | ||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed with ee8bcfd
printf("cstool for Capstone Disassembler, v%u.%u.%u\n\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA); | ||
printf("Syntax: %s [-d|-u|-s|-v] <arch+mode> <assembly-hexstring> [start-address-in-hex-format]\n", prog); | ||
printf("Cstool for Capstone Disassembler Engine v%u.%u.%u\n\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA); | ||
printf("Syntax: %s [-u|-d|-s|-v] <arch+mode> <assembly-hexstring> [start-address-in-hex-format]\n", prog); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flags sohuld be sorted alphabetically, and this change is unrelated to the pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will fix the flag issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see 5ae5909
Add webassembly arch