|
1 |
| -Capstone source is organized as followings. |
| 1 | +Code structure |
| 2 | +-------------- |
2 | 3 |
|
| 4 | +Capstone source is organized as followings. |
3 | 5 |
|
4 | 6 | . <- core engine + README + COMPILE.TXT etc
|
5 | 7 | ├── arch <- code handling disasm engine for each arch
|
@@ -51,43 +53,50 @@ See bindings/<language>/README for detail instructions on how to compile &
|
51 | 53 | install the bindings.
|
52 | 54 |
|
53 | 55 |
|
54 |
| -Adding an architecture : |
| 56 | +Coding style |
| 57 | +------------ |
| 58 | +- C code follows Linux kernel coding style, using tabs for indentation. |
| 59 | +- Python code uses 4 spaces for indentation. |
| 60 | + |
| 61 | + |
| 62 | +Adding an architecture |
| 63 | +---------------------- |
55 | 64 |
|
56 | 65 | Obviously, you first need to write all the logic and put it in a new directory arch/newarch
|
57 | 66 | Then, you have to modify other files.
|
58 | 67 | (You can look for one architecture such as EVM in these files to get what you need to do)
|
59 | 68 |
|
60 |
| -Integrate : |
| 69 | +Integrate: |
61 | 70 | - cs.c
|
62 | 71 | - cstool/cstool.c
|
63 |
| -- cstool/cstool_newarch.c : print the architecture specific details |
| 72 | +- cstool/cstool_newarch.c: print the architecture specific details |
64 | 73 | - include/capstone/capstone.h
|
65 |
| -- include/capstone/newarch.h : create this file to export all specifics about the new architecture |
| 74 | +- include/capstone/newarch.h: create this file to export all specifics about the new architecture |
66 | 75 |
|
67 |
| -Compile : |
| 76 | +Compile: |
68 | 77 | - CMakeLists.txt
|
69 | 78 | - Makefile
|
70 | 79 | - config.mk
|
71 | 80 |
|
72 |
| -Tests : |
| 81 | +Tests: |
73 | 82 | - tests/Makefile
|
74 | 83 | - tests/test_basic.c
|
75 | 84 | - tests/test_detail.c
|
76 | 85 | - tests/test_iter.c
|
77 | 86 | - tests/test_newarch.c
|
78 |
| -- suite/fuzz/fuzz_disasm.c : add the architecture and its modes to the list of fuzzed platforms |
| 87 | +- suite/fuzz/fuzz_disasm.c: add the architecture and its modes to the list of fuzzed platforms |
79 | 88 |
|
80 |
| -Bindings : |
| 89 | +Bindings: |
81 | 90 | - bindings/Makefile
|
82 |
| -- bindings/const_generator.py : add the header file and the architecture |
| 91 | +- bindings/const_generator.py: add the header file and the architecture |
83 | 92 | - bindings/python/Makefile
|
84 | 93 | - bindings/python/capstone/__init__.py
|
85 |
| -- bindings/python/capstone/newarch.py : define the python structures |
86 |
| -- bindings/python/capstone/newarch_const.py : generate this file |
87 |
| -- bindings/python/test_newarch.py : create a basic decoding test |
| 94 | +- bindings/python/capstone/newarch.py: define the python structures |
| 95 | +- bindings/python/capstone/newarch_const.py: generate this file |
| 96 | +- bindings/python/test_newarch.py: create a basic decoding test |
88 | 97 | - bindings/python/test_all.py
|
89 | 98 |
|
90 |
| -Docs : |
| 99 | +Docs: |
91 | 100 | - README.md
|
92 | 101 | - HACK.txt
|
93 |
| -- CREDITS.txt : add your name |
| 102 | +- CREDITS.txt: add your name |
0 commit comments