Skip to content

Commit fbe096d

Browse files
committed
fix typo, style
Signed-off-by: Satoshi Tanda <tanda.sat@gmail.com>
1 parent 088b50d commit fbe096d

File tree

8 files changed

+21
-18
lines changed

8 files changed

+21
-18
lines changed

COMPILE_MSVC.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ versions, and Windows Driver Kit 8.1 Update 1 or newer versions are required.
2727
steps.
2828

2929
In VisualStudio interface, modify the preprocessor definitions via
30-
"Project Properties" -> "Configuration Propertis" -> "C/C++" -> "Preprocessor"
30+
"Project Properties" -> "Configuration Properties" -> "C/C++" -> "Preprocessor"
3131
to customize Capstone library, as followings.
3232

3333
- CAPSTONE_HAS_ARM: support ARM. Delete this to remove ARM support.

HACK.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ the code and try to recompile/reinstall again. This can be done with:
3535
$ sudo ./make.sh install
3636

3737
At the same time, for Java/Ocaml/Python bindings, be sure to always use
38-
the bindings coming with the core to avoid potential incompatility issue
38+
the bindings coming with the core to avoid potential incompatibility issue
3939
with older versions.
4040
See bindings/<language>/README for detail instructions on how to compile &
4141
install the bindings.

contrib/cs_driver/cs_driver/cs_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ static NTSTATUS cs_driver_hello() {
5656
// On a 32bit driver, KeSaveFloatingPointState() is required before using any
5757
// Capstone function because Capstone can access to the MMX/x87 registers and
5858
// 32bit Windows requires drivers to use KeSaveFloatingPointState() before and
59-
// KeRestoreFloatingPointState() after accesing to them. See "Using Floating
59+
// KeRestoreFloatingPointState() after accessing them. See "Using Floating
6060
// Point or MMX in a WDM Driver" on MSDN for more details.
6161
status = KeSaveFloatingPointState(&float_save);
6262
if (!NT_SUCCESS(status)) {
6363
return status;
6464
}
6565

66-
// Do stuff just like user-mode. All functionalites are supported.
66+
// Do stuff just like user-mode. All functionalities are supported.
6767
if (cs_open(CS_ARCH_X86, (sizeof(void *) == 4) ? CS_MODE_32 : CS_MODE_64,
6868
&handle) != CS_ERR_OK) {
6969
goto exit;

docs/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Documention of Capstone disassembly framework.
1+
Documentation of Capstone disassembly framework.
22

33
* Switching to 2.1 engine.
44

include/x86.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ typedef struct cs_x86 {
212212
// prefix[3] indicates address-size override (X86_PREFIX_ADDRSIZE)
213213
uint8_t prefix[4];
214214

215-
// Instruction opcode, wich can be from 1 to 4 bytes in size.
215+
// Instruction opcode, which can be from 1 to 4 bytes in size.
216216
// This contains VEX opcode as well.
217217
// An trailing opcode byte gets value 0 when irrelevant.
218218
uint8_t opcode[4];
219219

220-
// REX prefix: only a non-zero value is relavant for x86_64
220+
// REX prefix: only a non-zero value is relevant for x86_64
221221
uint8_t rex;
222222

223-
// Address size, which can be overrided with above prefix[5].
223+
// Address size, which can be overridden with above prefix[5].
224224
uint8_t addr_size;
225225

226226
// ModR/M byte
@@ -235,7 +235,7 @@ typedef struct cs_x86 {
235235
/* SIB state */
236236
// SIB index register, or X86_REG_INVALID when irrelevant.
237237
x86_reg sib_index;
238-
// SIB scale. only applicable if sib_index is relavant.
238+
// SIB scale. only applicable if sib_index is relevant.
239239
int8_t sib_scale;
240240
// SIB base register, or X86_REG_INVALID when irrelevant.
241241
x86_reg sib_base;

tests/test_winkernel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* Capstone Disassembly Engine */
22
/* By Satoshi Tanda <tanda.sat@gmail.com>, 2016 */
3+
34
#include <ntddk.h>
45
#include <capstone.h>
56

@@ -19,7 +20,7 @@ EXTERN_C DRIVER_INITIALIZE DriverEntry;
1920
#pragma warning(disable : 4005) // 'identifier' : macro redefinition
2021
#pragma warning(disable : 4007) // 'main': must be '__cdecl'
2122

22-
// Drivers must protect floating point hardware state. See use of float simm:
23+
// Drivers must protect floating point hardware state. See use of float.
2324
// Use KeSaveFloatingPointState/KeRestoreFloatingPointState around floating
2425
// point operations. Display Drivers should use the corresponding Eng... routines.
2526
#pragma warning(disable : 28110) // Suppress this, as it is false positive.
@@ -93,7 +94,7 @@ static void test()
9394
// On a 32bit driver, KeSaveFloatingPointState() is required before using any
9495
// Capstone function because Capstone can access to the MMX/x87 registers and
9596
// 32bit Windows requires drivers to use KeSaveFloatingPointState() before and
96-
// KeRestoreFloatingPointState() after accesing to them. See "Using Floating
97+
// KeRestoreFloatingPointState() after accessing them. See "Using Floating
9798
// Point or MMX in a WDM Driver" on MSDN for more details.
9899
status = KeSaveFloatingPointState(&float_save);
99100
if (!NT_SUCCESS(status)) {

windows/winkernel_mm.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* Capstone Disassembly Engine */
22
/* By Satoshi Tanda <tanda.sat@gmail.com>, 2016 */
3+
34
#include "winkernel_mm.h"
45
#include <ntddk.h>
56

@@ -77,27 +78,27 @@ void * CAPSTONE_API cs_winkernel_realloc(void *ptr, size_t size)
7778
return new_ptr;
7879
}
7980

80-
// vsnprintf(). _vsnprintf() is avaialable for drivers, but it differs from
81-
// vsnprintf() in a return value and when a null-terminater is set.
81+
// vsnprintf(). _vsnprintf() is available for drivers, but it differs from
82+
// vsnprintf() in a return value and when a null-terminator is set.
8283
// cs_winkernel_vsnprintf() takes care of those differences.
8384
#pragma warning(push)
84-
#pragma warning(disable : 28719) // Banned API Usage : _vsnprintf is a Banned
85-
// API as listed in dontuse.h for security
86-
// purposes.
85+
// Banned API Usage : _vsnprintf is a Banned API as listed in dontuse.h for
86+
// security purposes.
87+
#pragma warning(disable : 28719)
8788
int CAPSTONE_API cs_winkernel_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
8889
{
8990
int result = _vsnprintf(buffer, count, format, argptr);
9091

9192
// _vsnprintf() returns -1 when a string is truncated, and returns "count"
9293
// when an entire string is stored but without '\0' at the end of "buffer".
93-
// In both cases, null-terminater needs to be added manually.
94+
// In both cases, null-terminator needs to be added manually.
9495
if (result == -1 || (size_t)result == count) {
9596
buffer[count - 1] = '\0';
9697
}
9798

9899
if (result == -1) {
99100
// In case when -1 is returned, the function has to get and return a number
100-
// of characters that would have been written. This attempts so by re-tring
101+
// of characters that would have been written. This attempts so by retrying
101102
// the same conversion with temp buffer that is most likely big enough to
102103
// complete formatting and get a number of characters that would have been
103104
// written.

windows/winkernel_mm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* Capstone Disassembly Engine */
22
/* By Satoshi Tanda <tanda.sat@gmail.com>, 2016 */
3+
34
#ifndef CS_WINDOWS_WINKERNEL_MM_H
45
#define CS_WINDOWS_WINKERNEL_MM_H
56

0 commit comments

Comments
 (0)