Skip to content

Commit

Permalink
chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Sep 29, 2023
1 parent 8aa3b8b commit 107275c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions yara-x/src/modules/macho/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use thiserror::Error;
/// correct Real minimum size of Mach-O file would be higher
const VALID_MACHO_LENGTH: usize = 28;

/// Define Mach-O constats used in parsing
/// as it is problematic to get those from proto destriptors
/// Define Mach-O constants used in parsing
/// as it is problematic to get those from proto descriptors
const MH_MAGIC: u32 = 0xfeedface;
const MH_CIGAM: u32 = 0xcefaedfe;
const MH_MAGIC_64: u32 = 0xfeedfacf;
Expand Down Expand Up @@ -1763,7 +1763,7 @@ fn handle_unixthread(
_ => return Err(MachoError::UnsupportedCPUType),
}

// Swap bytes if neccessary
// Swap bytes if necessary
if should_swap_bytes(
macho_file
.magic
Expand Down Expand Up @@ -1821,7 +1821,7 @@ fn handle_main(
let (_, mut entrypoint_cmd) = parse_entry_point_command(command_data)
.map_err(|e| MachoError::ParsingError(format!("{:?}", e)))?;

// Swap bytes if neccesarry
// Swap bytes if necessary
if should_swap_bytes(
macho_file
.magic
Expand Down
2 changes: 1 addition & 1 deletion yara-x/src/modules/macho/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn test_parse_magic() {
let result = parse_magic(short_input);
assert!(result.is_err());

// Not a Mach-O magic constant, parsing should stil succeed
// Not a Mach-O magic constant, parsing should still succeed
let input = &[99, 99, 99, 99];
let result = parse_magic(input);
assert!(result.is_ok());
Expand Down
2 changes: 1 addition & 1 deletion yara-x/src/modules/protos/macho.proto
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ enum SECTION_TYPE {
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS = 0x00000015;
}

enum SECTION_ATTRIBURES {
enum SECTION_ATTRIBUTES {
option (yara.enum_options).inline = true;
S_ATTR_PURE_INSTRUCTIONS = 0 [(yara.enum_value).i64 = 0x80000000];
S_ATTR_NO_TOC = 0x40000000;
Expand Down

0 comments on commit 107275c

Please # to comment.