Skip to content

Commit

Permalink
update HACK.TXT with coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Feb 1, 2019
1 parent 7907626 commit 864595c
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions 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
Expand Down Expand Up @@ -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

0 comments on commit 864595c

Please sign in to comment.