From cb003974a4d773729a1d29979b824568c5a9cd0c Mon Sep 17 00:00:00 2001 From: Satoshi Tanda Date: Tue, 27 Sep 2016 07:39:51 -0700 Subject: [PATCH] fix typo, style Signed-off-by: Satoshi Tanda --- COMPILE_MSVC.TXT | 2 +- HACK.TXT | 2 +- contrib/cs_driver/cs_driver/cs_driver.c | 4 ++-- docs/README | 2 +- include/capstone/x86.h | 8 ++++---- tests/test_winkernel.cpp | 5 +++-- windows/winkernel_mm.c | 15 ++++++++------- windows/winkernel_mm.h | 1 + 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/COMPILE_MSVC.TXT b/COMPILE_MSVC.TXT index 31748be7f..24705ed36 100644 --- a/COMPILE_MSVC.TXT +++ b/COMPILE_MSVC.TXT @@ -27,7 +27,7 @@ versions, and Windows Driver Kit 8.1 Update 1 or newer versions are required. next steps. In VisualStudio interface, modify the preprocessor definitions via - "Project Properties" -> "Configuration Propertis" -> "C/C++" -> "Preprocessor" + "Project Properties" -> "Configuration Properties" -> "C/C++" -> "Preprocessor" to customize Capstone library, as followings. - CAPSTONE_HAS_ARM: support ARM. Delete this to remove ARM support. diff --git a/HACK.TXT b/HACK.TXT index 19099bbce..8651410c0 100644 --- a/HACK.TXT +++ b/HACK.TXT @@ -36,7 +36,7 @@ the code and try to recompile/reinstall again. This can be done with: $ sudo ./make.sh install At the same time, for Java/Ocaml/Python bindings, be sure to always use -the bindings coming with the core to avoid potential incompatility issue +the bindings coming with the core to avoid potential incompatibility issue with older versions. See bindings//README for detail instructions on how to compile & install the bindings. diff --git a/contrib/cs_driver/cs_driver/cs_driver.c b/contrib/cs_driver/cs_driver/cs_driver.c index 11a129f38..99a1f12fd 100644 --- a/contrib/cs_driver/cs_driver/cs_driver.c +++ b/contrib/cs_driver/cs_driver/cs_driver.c @@ -56,14 +56,14 @@ static NTSTATUS cs_driver_hello() { // On a 32bit driver, KeSaveFloatingPointState() is required before using any // Capstone function because Capstone can access to the MMX/x87 registers and // 32bit Windows requires drivers to use KeSaveFloatingPointState() before and - // KeRestoreFloatingPointState() after accesing to them. See "Using Floating + // KeRestoreFloatingPointState() after accessing them. See "Using Floating // Point or MMX in a WDM Driver" on MSDN for more details. status = KeSaveFloatingPointState(&float_save); if (!NT_SUCCESS(status)) { return status; } - // Do stuff just like user-mode. All functionalites are supported. + // Do stuff just like user-mode. All functionalities are supported. if (cs_open(CS_ARCH_X86, (sizeof(void *) == 4) ? CS_MODE_32 : CS_MODE_64, &handle) != CS_ERR_OK) { goto exit; diff --git a/docs/README b/docs/README index 0865cca8a..15bbeb3cb 100644 --- a/docs/README +++ b/docs/README @@ -1,4 +1,4 @@ -Documention of Capstone disassembly framework. +Documentation of Capstone disassembly framework. * Switching to 2.1 engine. diff --git a/include/capstone/x86.h b/include/capstone/x86.h index adf8fa3c6..d31ceee09 100644 --- a/include/capstone/x86.h +++ b/include/capstone/x86.h @@ -269,15 +269,15 @@ typedef struct cs_x86 { // prefix[3] indicates address-size override (X86_PREFIX_ADDRSIZE) uint8_t prefix[4]; - // Instruction opcode, wich can be from 1 to 4 bytes in size. + // Instruction opcode, which can be from 1 to 4 bytes in size. // This contains VEX opcode as well. // An trailing opcode byte gets value 0 when irrelevant. uint8_t opcode[4]; - // REX prefix: only a non-zero value is relavant for x86_64 + // REX prefix: only a non-zero value is relevant for x86_64 uint8_t rex; - // Address size, which can be overrided with above prefix[5]. + // Address size, which can be overridden with above prefix[5]. uint8_t addr_size; // ModR/M byte @@ -292,7 +292,7 @@ typedef struct cs_x86 { /* SIB state */ // SIB index register, or X86_REG_INVALID when irrelevant. x86_reg sib_index; - // SIB scale. only applicable if sib_index is relavant. + // SIB scale. only applicable if sib_index is relevant. int8_t sib_scale; // SIB base register, or X86_REG_INVALID when irrelevant. x86_reg sib_base; diff --git a/tests/test_winkernel.cpp b/tests/test_winkernel.cpp index dade77956..6413b1a2c 100644 --- a/tests/test_winkernel.cpp +++ b/tests/test_winkernel.cpp @@ -1,5 +1,6 @@ /* Capstone Disassembly Engine */ /* By Satoshi Tanda , 2016 */ + #include #include @@ -21,7 +22,7 @@ EXTERN_C DRIVER_INITIALIZE DriverEntry; #pragma warning(disable : 4005) // 'identifier' : macro redefinition #pragma warning(disable : 4007) // 'main': must be '__cdecl' -// Drivers must protect floating point hardware state. See use of float simm: +// Drivers must protect floating point hardware state. See use of float. // Use KeSaveFloatingPointState/KeRestoreFloatingPointState around floating // point operations. Display Drivers should use the corresponding Eng... routines. #pragma warning(disable : 28110) // Suppress this, as it is false positive. @@ -103,7 +104,7 @@ static void test() // On a 32bit driver, KeSaveFloatingPointState() is required before using any // Capstone function because Capstone can access to the MMX/x87 registers and // 32bit Windows requires drivers to use KeSaveFloatingPointState() before and - // KeRestoreFloatingPointState() after accesing to them. See "Using Floating + // KeRestoreFloatingPointState() after accessing them. See "Using Floating // Point or MMX in a WDM Driver" on MSDN for more details. status = KeSaveFloatingPointState(&float_save); if (!NT_SUCCESS(status)) { diff --git a/windows/winkernel_mm.c b/windows/winkernel_mm.c index 2a3786646..6052be28d 100644 --- a/windows/winkernel_mm.c +++ b/windows/winkernel_mm.c @@ -1,5 +1,6 @@ /* Capstone Disassembly Engine */ /* By Satoshi Tanda , 2016 */ + #include "winkernel_mm.h" #include @@ -77,27 +78,27 @@ void * CAPSTONE_API cs_winkernel_realloc(void *ptr, size_t size) return new_ptr; } -// vsnprintf(). _vsnprintf() is avaialable for drivers, but it differs from -// vsnprintf() in a return value and when a null-terminater is set. +// vsnprintf(). _vsnprintf() is available for drivers, but it differs from +// vsnprintf() in a return value and when a null-terminator is set. // cs_winkernel_vsnprintf() takes care of those differences. #pragma warning(push) -#pragma warning(disable : 28719) // Banned API Usage : _vsnprintf is a Banned -// API as listed in dontuse.h for security -// purposes. +// Banned API Usage : _vsnprintf is a Banned API as listed in dontuse.h for +// security purposes. +#pragma warning(disable : 28719) int CAPSTONE_API cs_winkernel_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr) { int result = _vsnprintf(buffer, count, format, argptr); // _vsnprintf() returns -1 when a string is truncated, and returns "count" // when an entire string is stored but without '\0' at the end of "buffer". - // In both cases, null-terminater needs to be added manually. + // In both cases, null-terminator needs to be added manually. if (result == -1 || (size_t)result == count) { buffer[count - 1] = '\0'; } if (result == -1) { // In case when -1 is returned, the function has to get and return a number - // of characters that would have been written. This attempts so by re-tring + // of characters that would have been written. This attempts so by retrying // the same conversion with temp buffer that is most likely big enough to // complete formatting and get a number of characters that would have been // written. diff --git a/windows/winkernel_mm.h b/windows/winkernel_mm.h index 2df3bfd15..ed743f3e5 100644 --- a/windows/winkernel_mm.h +++ b/windows/winkernel_mm.h @@ -1,5 +1,6 @@ /* Capstone Disassembly Engine */ /* By Satoshi Tanda , 2016 */ + #ifndef CS_WINDOWS_WINKERNEL_MM_H #define CS_WINDOWS_WINKERNEL_MM_H