Skip to content

Commit

Permalink
Doc anout adding an architecture (capstone-engine#1356)
Browse files Browse the repository at this point in the history
and fixing a comment
  • Loading branch information
catenacyber authored and aquynh committed Jan 30, 2019
1 parent 6808a8e commit 4baab44
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions HACK.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,45 @@ the bindings coming with the core to avoid potential incompatibility issue
with older versions.
See bindings/<language>/README for detail instructions on how to compile &
install the bindings.


Adding an architecture :

Obviously, you first need to write all the logic and put it in a new directory arch/newarch
Then, you have to modify other files.
(You can look for one architecture such as EVM in these files to get what you need to do)

Integrate :
- cs.c
- cstool/cstool.c
- cstool/cstool_newarch.c : print the architecture specific details
- include/capstone/capstone.h
- include/capstone/newarch.h : create this file to export all specifics about the new architecture

Compile :
- CMakeLists.txt
- Makefile
- config.mk

Tests :
- tests/Makefile
- tests/test_basic.c
- tests/test_detail.c
- tests/test_iter.c
- tests/test_newarch.c
- suite/fuzz/fuzz_disasm.c : add the architecture and its modes to the list of fuzzed platforms

Bindings :
- bindings/Makefile
- bindings/const_generator.py : add the header file and the architecture
- bindings/python/Makefile
- bindings/python/capstone/__init__.py
- bindings/python/capstone/newarch.py : define the python structures
- bindings/python/capstone/newarch_const.py : generate this file
- bindings/python/test_newarch.py : create a basic decoding test
- bindings/python/test_all.py

Docs :
- README.md
- HACK.txt
- CREDITS.txt : add your name
2 changes: 1 addition & 1 deletion include/capstone/capstone.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ typedef struct cs_detail {
cs_tms320c64x tms320c64x; ///< TMS320C64x architecture
cs_m680x m680x; ///< M680X architecture
cs_evm evm; ///< Ethereum architecture
cs_mos65xx mos65xx; ///< Ethereum architecture
cs_mos65xx mos65xx; ///< MOS65XX architecture (including MOS6502)
};
} cs_detail;

Expand Down

0 comments on commit 4baab44

Please sign in to comment.