Skip to content

Commit

Permalink
fix: add missing error codes from yara/error.h
Browse files Browse the repository at this point in the history
  • Loading branch information
secDre4mer authored and hillu committed Jan 22, 2024
1 parent 1bab2fc commit 1a86fd9
Showing 1 changed file with 64 additions and 42 deletions.
106 changes: 64 additions & 42 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,48 +52,70 @@ func newError(code C.int) error {
}

const (
ERROR_SUCCESS = C.ERROR_SUCCESS
ERROR_INSUFFICIENT_MEMORY = C.ERROR_INSUFFICIENT_MEMORY
ERROR_COULD_NOT_ATTACH_TO_PROCESS = C.ERROR_COULD_NOT_ATTACH_TO_PROCESS
ERROR_COULD_NOT_OPEN_FILE = C.ERROR_COULD_NOT_OPEN_FILE
ERROR_COULD_NOT_MAP_FILE = C.ERROR_COULD_NOT_MAP_FILE
ERROR_INVALID_FILE = C.ERROR_INVALID_FILE
ERROR_CORRUPT_FILE = C.ERROR_CORRUPT_FILE
ERROR_UNSUPPORTED_FILE_VERSION = C.ERROR_UNSUPPORTED_FILE_VERSION
ERROR_INVALID_REGULAR_EXPRESSION = C.ERROR_INVALID_REGULAR_EXPRESSION
ERROR_INVALID_HEX_STRING = C.ERROR_INVALID_HEX_STRING
ERROR_SYNTAX_ERROR = C.ERROR_SYNTAX_ERROR
ERROR_LOOP_NESTING_LIMIT_EXCEEDED = C.ERROR_LOOP_NESTING_LIMIT_EXCEEDED
ERROR_DUPLICATED_LOOP_IDENTIFIER = C.ERROR_DUPLICATED_LOOP_IDENTIFIER
ERROR_DUPLICATED_IDENTIFIER = C.ERROR_DUPLICATED_IDENTIFIER
ERROR_DUPLICATED_TAG_IDENTIFIER = C.ERROR_DUPLICATED_TAG_IDENTIFIER
ERROR_DUPLICATED_META_IDENTIFIER = C.ERROR_DUPLICATED_META_IDENTIFIER
ERROR_DUPLICATED_STRING_IDENTIFIER = C.ERROR_DUPLICATED_STRING_IDENTIFIER
ERROR_UNREFERENCED_STRING = C.ERROR_UNREFERENCED_STRING
ERROR_UNDEFINED_STRING = C.ERROR_UNDEFINED_STRING
ERROR_UNDEFINED_IDENTIFIER = C.ERROR_UNDEFINED_IDENTIFIER
ERROR_MISPLACED_ANONYMOUS_STRING = C.ERROR_MISPLACED_ANONYMOUS_STRING
ERROR_INCLUDES_CIRCULAR_REFERENCE = C.ERROR_INCLUDES_CIRCULAR_REFERENCE
ERROR_INCLUDE_DEPTH_EXCEEDED = C.ERROR_INCLUDE_DEPTH_EXCEEDED
ERROR_WRONG_TYPE = C.ERROR_WRONG_TYPE
ERROR_EXEC_STACK_OVERFLOW = C.ERROR_EXEC_STACK_OVERFLOW
ERROR_SCAN_TIMEOUT = C.ERROR_SCAN_TIMEOUT
ERROR_TOO_MANY_SCAN_THREADS = C.ERROR_TOO_MANY_SCAN_THREADS
ERROR_CALLBACK_ERROR = C.ERROR_CALLBACK_ERROR
ERROR_INVALID_ARGUMENT = C.ERROR_INVALID_ARGUMENT
ERROR_TOO_MANY_MATCHES = C.ERROR_TOO_MANY_MATCHES
ERROR_INTERNAL_FATAL_ERROR = C.ERROR_INTERNAL_FATAL_ERROR
ERROR_NESTED_FOR_OF_LOOP = C.ERROR_NESTED_FOR_OF_LOOP
ERROR_INVALID_FIELD_NAME = C.ERROR_INVALID_FIELD_NAME
ERROR_UNKNOWN_MODULE = C.ERROR_UNKNOWN_MODULE
ERROR_NOT_A_STRUCTURE = C.ERROR_NOT_A_STRUCTURE
ERROR_NOT_INDEXABLE = C.ERROR_NOT_INDEXABLE
ERROR_NOT_A_FUNCTION = C.ERROR_NOT_A_FUNCTION
ERROR_INVALID_FORMAT = C.ERROR_INVALID_FORMAT
ERROR_TOO_MANY_ARGUMENTS = C.ERROR_TOO_MANY_ARGUMENTS
ERROR_WRONG_ARGUMENTS = C.ERROR_WRONG_ARGUMENTS
ERROR_WRONG_RETURN_TYPE = C.ERROR_WRONG_RETURN_TYPE
ERROR_DUPLICATED_STRUCTURE_MEMBER = C.ERROR_DUPLICATED_STRUCTURE_MEMBER
ERROR_SUCCESS = C.ERROR_SUCCESS
ERROR_INSUFFICIENT_MEMORY = C.ERROR_INSUFFICIENT_MEMORY
ERROR_COULD_NOT_ATTACH_TO_PROCESS = C.ERROR_COULD_NOT_ATTACH_TO_PROCESS
ERROR_COULD_NOT_OPEN_FILE = C.ERROR_COULD_NOT_OPEN_FILE
ERROR_COULD_NOT_MAP_FILE = C.ERROR_COULD_NOT_MAP_FILE
ERROR_INVALID_FILE = C.ERROR_INVALID_FILE
ERROR_CORRUPT_FILE = C.ERROR_CORRUPT_FILE
ERROR_UNSUPPORTED_FILE_VERSION = C.ERROR_UNSUPPORTED_FILE_VERSION
ERROR_INVALID_REGULAR_EXPRESSION = C.ERROR_INVALID_REGULAR_EXPRESSION
ERROR_INVALID_HEX_STRING = C.ERROR_INVALID_HEX_STRING
ERROR_SYNTAX_ERROR = C.ERROR_SYNTAX_ERROR
ERROR_LOOP_NESTING_LIMIT_EXCEEDED = C.ERROR_LOOP_NESTING_LIMIT_EXCEEDED
ERROR_DUPLICATED_LOOP_IDENTIFIER = C.ERROR_DUPLICATED_LOOP_IDENTIFIER
ERROR_DUPLICATED_IDENTIFIER = C.ERROR_DUPLICATED_IDENTIFIER
ERROR_DUPLICATED_TAG_IDENTIFIER = C.ERROR_DUPLICATED_TAG_IDENTIFIER
ERROR_DUPLICATED_META_IDENTIFIER = C.ERROR_DUPLICATED_META_IDENTIFIER
ERROR_DUPLICATED_STRING_IDENTIFIER = C.ERROR_DUPLICATED_STRING_IDENTIFIER
ERROR_UNREFERENCED_STRING = C.ERROR_UNREFERENCED_STRING
ERROR_UNDEFINED_STRING = C.ERROR_UNDEFINED_STRING
ERROR_UNDEFINED_IDENTIFIER = C.ERROR_UNDEFINED_IDENTIFIER
ERROR_MISPLACED_ANONYMOUS_STRING = C.ERROR_MISPLACED_ANONYMOUS_STRING
ERROR_INCLUDES_CIRCULAR_REFERENCE = C.ERROR_INCLUDES_CIRCULAR_REFERENCE
ERROR_INCLUDE_DEPTH_EXCEEDED = C.ERROR_INCLUDE_DEPTH_EXCEEDED
ERROR_WRONG_TYPE = C.ERROR_WRONG_TYPE
ERROR_EXEC_STACK_OVERFLOW = C.ERROR_EXEC_STACK_OVERFLOW
ERROR_SCAN_TIMEOUT = C.ERROR_SCAN_TIMEOUT
ERROR_TOO_MANY_SCAN_THREADS = C.ERROR_TOO_MANY_SCAN_THREADS
ERROR_CALLBACK_ERROR = C.ERROR_CALLBACK_ERROR
ERROR_INVALID_ARGUMENT = C.ERROR_INVALID_ARGUMENT
ERROR_TOO_MANY_MATCHES = C.ERROR_TOO_MANY_MATCHES
ERROR_INTERNAL_FATAL_ERROR = C.ERROR_INTERNAL_FATAL_ERROR
ERROR_NESTED_FOR_OF_LOOP = C.ERROR_NESTED_FOR_OF_LOOP
ERROR_INVALID_FIELD_NAME = C.ERROR_INVALID_FIELD_NAME
ERROR_UNKNOWN_MODULE = C.ERROR_UNKNOWN_MODULE
ERROR_NOT_A_STRUCTURE = C.ERROR_NOT_A_STRUCTURE
ERROR_NOT_INDEXABLE = C.ERROR_NOT_INDEXABLE
ERROR_NOT_A_FUNCTION = C.ERROR_NOT_A_FUNCTION
ERROR_INVALID_FORMAT = C.ERROR_INVALID_FORMAT
ERROR_TOO_MANY_ARGUMENTS = C.ERROR_TOO_MANY_ARGUMENTS
ERROR_WRONG_ARGUMENTS = C.ERROR_WRONG_ARGUMENTS
ERROR_WRONG_RETURN_TYPE = C.ERROR_WRONG_RETURN_TYPE
ERROR_DUPLICATED_STRUCTURE_MEMBER = C.ERROR_DUPLICATED_STRUCTURE_MEMBER
ERROR_EMPTY_STRING = C.ERROR_EMPTY_STRING
ERROR_DIVISION_BY_ZERO = C.ERROR_DIVISION_BY_ZERO
ERROR_REGULAR_EXPRESSION_TOO_LARGE = C.ERROR_REGULAR_EXPRESSION_TOO_LARGE
ERROR_TOO_MANY_RE_FIBERS = C.ERROR_TOO_MANY_RE_FIBERS
ERROR_COULD_NOT_READ_PROCESS_MEMORY = C.ERROR_COULD_NOT_READ_PROCESS_MEMORY
ERROR_INVALID_EXTERNAL_VARIABLE_TYPE = C.ERROR_INVALID_EXTERNAL_VARIABLE_TYPE
ERROR_REGULAR_EXPRESSION_TOO_COMPLEX = C.ERROR_REGULAR_EXPRESSION_TOO_COMPLEX
ERROR_INVALID_MODULE_NAME = C.ERROR_INVALID_MODULE_NAME
ERROR_TOO_MANY_STRINGS = C.ERROR_TOO_MANY_STRINGS
ERROR_INTEGER_OVERFLOW = C.ERROR_INTEGER_OVERFLOW
ERROR_CALLBACK_REQUIRED = C.ERROR_CALLBACK_REQUIRED
ERROR_INVALID_OPERAND = C.ERROR_INVALID_OPERAND
ERROR_COULD_NOT_READ_FILE = C.ERROR_COULD_NOT_READ_FILE
ERROR_DUPLICATED_EXTERNAL_VARIABLE = C.ERROR_DUPLICATED_EXTERNAL_VARIABLE
ERROR_INVALID_MODULE_DATA = C.ERROR_INVALID_MODULE_DATA
ERROR_WRITING_FILE = C.ERROR_WRITING_FILE
ERROR_INVALID_MODIFIER = C.ERROR_INVALID_MODIFIER
ERROR_DUPLICATED_MODIFIER = C.ERROR_DUPLICATED_MODIFIER
ERROR_BLOCK_NOT_READY = C.ERROR_BLOCK_NOT_READY
ERROR_INVALID_PERCENTAGE = C.ERROR_INVALID_PERCENTAGE
ERROR_IDENTIFIER_MATCHES_WILDCARD = C.ERROR_IDENTIFIER_MATCHES_WILDCARD
ERROR_INVALID_VALUE = C.ERROR_INVALID_VALUE
)

// FIXME: This should be generated from yara/error.h
Expand Down

0 comments on commit 1a86fd9

Please sign in to comment.