From 2070b7a427e21415d293171e5cef30a6b18aac19 Mon Sep 17 00:00:00 2001 From: athre0z Date: Fri, 22 May 2015 17:23:32 +0200 Subject: [PATCH] improved documentation and README.md --- README.md | 15 ++++--- Zydis/Zydis.hpp | 67 +++++++++++++++++++++++++++-- Zydis/ZydisAPI.h | 5 +++ Zydis/ZydisInstructionDecoder.hpp | 5 +++ Zydis/ZydisInstructionFormatter.hpp | 5 +++ Zydis/ZydisOpcodeTable.hpp | 5 +++ Zydis/ZydisSymbolResolver.hpp | 5 +++ Zydis/ZydisUtils.hpp | 5 +++ 8 files changed, 104 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1544355..af62520 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -Zyan Disassembler Engine (Zydis) -================================== +Zyan Disassembler Engine (Zydis) [![Build Status](https://travis-ci.org/zyantific/zyan-disassembler-engine.svg?branch=master)](https://travis-ci.org/zyantific/zyan-disassembler-engine) +================================ Fast and lightweight x86/x86-64 disassembler library. @@ -20,7 +20,7 @@ Fast and lightweight x86/x86-64 disassembler library. The following example program uses Zydis to disassemble a given memory buffer and prints the output to the console. -```C++ +```c++ #include #include #include @@ -47,8 +47,13 @@ int _tmain(int argc, _TCHAR* argv[]) ``` ## Compilation ## - + Zydis builds cleanly on most platforms without any external dependencies. You can use CMake to generate project files for your favorite C++14 compiler. - + +## Documentation ## + +[The HTML Doxygen documentation](https://www.zyantific.com/doc/zydis/index.html) is automatically built from master every 12 hours. + ## License ## + Zyan Disassembler Engine is licensed under the MIT License. Dependencies are under their respective licenses. diff --git a/Zydis/Zydis.hpp b/Zydis/Zydis.hpp index 4c77299..f6a3fd9 100644 --- a/Zydis/Zydis.hpp +++ b/Zydis/Zydis.hpp @@ -28,12 +28,73 @@ ***************************************************************************************************/ -#ifndef _ZYDIS_DISASSEMBLER_HPP_ -#define _ZYDIS_DISASSEMBLER_HPP_ +/** + * @file + * @brief C++ API include file. + */ + + /** + * @mainpage Zyan Disassembler Engine (Zydis) + * + * Zydis is a fast and lightweight x86/x86-64 disassembler library. + * + * @section Features + * - Supports all x86 and x86-64 (AMD64) General purpose and System instructions. + * - Supported ISA extensions: + * - MMX, FPU (x87), AMD 3DNow + * - SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AES, + * - AMD-V, INTEL-VMX, SMX + * - Optimized for high performance + * - Very small overhead compared to other common disassembler libraries (about 60KiB) + * - Abstract formatter and symbol-resolver classes for custom syntax implementations. + * - Intel syntax is implemented by default + * - Complete doxygen documentation + * + * @section Quick Example + * The following example program uses Zydis to disassemble a given memory buffer and prints the + * output to the console. + * + * @code + * #include + * #include + * #include + * #include "Zydis.hpp" + * + * int _tmain(int argc, _TCHAR* argv[]) + * { + * uint8_t data[] = + * { + * 0x90, 0xE9, 0x00, 0x00, 0x00, 0x00, 0xC3 + * }; + * Zydis::MemoryInput input(&data[0], sizeof(data)); + * Zydis::InstructionInfo info; + * Zydis::InstructionDecoder decoder; + * decoder.setDisassemblerMode(Zydis::DisassemblerMode::M32BIT); + * decoder.setDataSource(&input); + * decoder.setInstructionPointer(0); + * Zydis::IntelInstructionFormatter formatter; + * while (decoder.decodeInstruction(info)) + * { + * std::cout << formatter.formatInstruction(info) << std::endl; + * } + * } + * @endcode + * + * @section Compilation + * Zydis builds cleanly on most platforms without any external dependencies. You can use CMake + * to generate project files for your favorite C++14 compiler. + * + * @section License + * Zyan Disassembler Engine is licensed under the MIT License. Dependencies are under their + * respective licenses. + */ + +#ifndef _ZYDIS_HPP_ +#define _ZYDIS_HPP_ #include "ZydisInstructionDecoder.hpp" #include "ZydisInstructionFormatter.hpp" #include "ZydisSymbolResolver.hpp" #include "ZydisUtils.hpp" -#endif /*_ZYDIS_DISASSEMBLER_HPP_ */ \ No newline at end of file +#endif /*_ZYDIS_HPP_ */ \ No newline at end of file diff --git a/Zydis/ZydisAPI.h b/Zydis/ZydisAPI.h index 3cff446..a4807ab 100644 --- a/Zydis/ZydisAPI.h +++ b/Zydis/ZydisAPI.h @@ -28,6 +28,11 @@ ***************************************************************************************************/ +/** + * @file + * @brief C API for Zydis. + */ + #ifndef _ZYDIS_API_H_ #define _ZYDIS_API_H_ diff --git a/Zydis/ZydisInstructionDecoder.hpp b/Zydis/ZydisInstructionDecoder.hpp index 19a1d07..426e7b8 100644 --- a/Zydis/ZydisInstructionDecoder.hpp +++ b/Zydis/ZydisInstructionDecoder.hpp @@ -28,6 +28,11 @@ ***************************************************************************************************/ +/** + * @file + * @brief Instruction decoder classes. + */ + #ifndef _ZYDIS_INSTRUCTIONDECODER_HPP_ #define _ZYDIS_INSTRUCTIONDECODER_HPP_ diff --git a/Zydis/ZydisInstructionFormatter.hpp b/Zydis/ZydisInstructionFormatter.hpp index d2d8789..6077010 100644 --- a/Zydis/ZydisInstructionFormatter.hpp +++ b/Zydis/ZydisInstructionFormatter.hpp @@ -28,6 +28,11 @@ ***************************************************************************************************/ +/** + * @file + * @brief Instruction formatting classes. + */ + #ifndef _ZYDIS_INSTRUCTIONFORMATTER_HPP_ #define _ZYDIS_INSTRUCTIONFORMATTER_HPP_ diff --git a/Zydis/ZydisOpcodeTable.hpp b/Zydis/ZydisOpcodeTable.hpp index ae1d101..a9c7887 100644 --- a/Zydis/ZydisOpcodeTable.hpp +++ b/Zydis/ZydisOpcodeTable.hpp @@ -28,6 +28,11 @@ ***************************************************************************************************/ +/** + * @file + * @brief The opcode table definition, mostly internal stuff. + */ + #ifndef _ZYDIS_OPCODETABLE_HPP_ #define _ZYDIS_OPCODETABLE_HPP_ diff --git a/Zydis/ZydisSymbolResolver.hpp b/Zydis/ZydisSymbolResolver.hpp index e3d2a2e..d7c4d53 100644 --- a/Zydis/ZydisSymbolResolver.hpp +++ b/Zydis/ZydisSymbolResolver.hpp @@ -28,6 +28,11 @@ ***************************************************************************************************/ +/** + * @file + * @brief Classes for symbol resolving in the disassembly. + */ + #ifndef _ZYDIS_SYMBOLRESOLVER_HPP_ #define _ZYDIS_SYMBOLRESOLVER_HPP_ diff --git a/Zydis/ZydisUtils.hpp b/Zydis/ZydisUtils.hpp index 81c5398..9641b7e 100644 --- a/Zydis/ZydisUtils.hpp +++ b/Zydis/ZydisUtils.hpp @@ -28,6 +28,11 @@ ***************************************************************************************************/ +/** + * @file + * @brief Utility functions. + */ + #ifndef _ZYDIS_UTILS_HPP_ #define _ZYDIS_UTILS_HPP_