mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-12-04 20:06:41 +00:00
update HACK.TXT with coding style
This commit is contained in:
parent
413be770df
commit
6f2595f638
39
HACK.TXT
39
HACK.TXT
@ -1,5 +1,7 @@
|
||||
Capstone source is organized as followings.
|
||||
Code structure
|
||||
--------------
|
||||
|
||||
Capstone source is organized as followings.
|
||||
|
||||
. <- core engine + README + COMPILE.TXT etc
|
||||
├── arch <- code handling disasm engine for each arch
|
||||
@ -51,43 +53,50 @@ See bindings/<language>/README for detail instructions on how to compile &
|
||||
install the bindings.
|
||||
|
||||
|
||||
Adding an architecture :
|
||||
Coding style
|
||||
------------
|
||||
- C code follows Linux kernel coding style, using tabs for indentation.
|
||||
- Python code uses 4 spaces for indentation.
|
||||
|
||||
|
||||
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 :
|
||||
Integrate:
|
||||
- cs.c
|
||||
- cstool/cstool.c
|
||||
- cstool/cstool_newarch.c : print the architecture specific details
|
||||
- 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
|
||||
- include/capstone/newarch.h: create this file to export all specifics about the new architecture
|
||||
|
||||
Compile :
|
||||
Compile:
|
||||
- CMakeLists.txt
|
||||
- Makefile
|
||||
- config.mk
|
||||
|
||||
Tests :
|
||||
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
|
||||
- suite/fuzz/fuzz_disasm.c: add the architecture and its modes to the list of fuzzed platforms
|
||||
|
||||
Bindings :
|
||||
Bindings:
|
||||
- bindings/Makefile
|
||||
- bindings/const_generator.py : add the header file and the architecture
|
||||
- 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/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 :
|
||||
Docs:
|
||||
- README.md
|
||||
- HACK.txt
|
||||
- CREDITS.txt : add your name
|
||||
- CREDITS.txt: add your name
|
||||
|
Loading…
Reference in New Issue
Block a user