diff --git a/yara-x/src/modules/macho/mod.rs b/yara-x/src/modules/macho/mod.rs index cf65e0b12..9f9d0a134 100644 --- a/yara-x/src/modules/macho/mod.rs +++ b/yara-x/src/modules/macho/mod.rs @@ -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; @@ -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 @@ -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 diff --git a/yara-x/src/modules/macho/tests/mod.rs b/yara-x/src/modules/macho/tests/mod.rs index be292ae0e..42187f7a4 100644 --- a/yara-x/src/modules/macho/tests/mod.rs +++ b/yara-x/src/modules/macho/tests/mod.rs @@ -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()); diff --git a/yara-x/src/modules/protos/macho.proto b/yara-x/src/modules/protos/macho.proto index 5b9056285..bd8b3ca07 100644 --- a/yara-x/src/modules/protos/macho.proto +++ b/yara-x/src/modules/protos/macho.proto @@ -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;