feat(binana): no special include directories now, you must pass GHIDRA or IDA as a definition into your preprocessor

This commit is contained in:
phaneron 2024-08-09 07:15:03 -04:00
parent de5bdadc78
commit 1042d9fa22
60 changed files with 3132 additions and 589 deletions

View file

@ -0,0 +1,23 @@
#ifndef SYSTEM_DETECT_H
#define SYSTEM_DETECT_H
#if !defined(IDA) && !defined(GHIDRA) && !defined(BINANA_GENERATOR)
#error "Preprocessor mode not detected! You must define either IDA or GHIDRA or BINANA_GENERATOR"
#endif
#if defined(IDA)
// why does this work?
#define DECLARE_ENUM(E) typedef enum E##__ E
#else
#define DECLARE_ENUM(E) typedef enum E E
#endif
#define DECLARE_STRUCT(T) typedef struct T T
#endif

View file

@ -0,0 +1,40 @@
#ifndef SYSTEM_TYPES_H
#define SYSTEM_TYPES_H
// stdint
#if defined(IDA) || defined(BINANA_GENERATOR)
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef int32_t ptrdiff_t;
typedef uint32_t uintptr_t;
typedef int32_t intptr_t;
#else
#include <stdint.h>
#endif
// stdbool
#if defined(BINANA_GENERATOR)
typedef char bool;
#endif
#if defined(GHIDRA)
#include <stdbool.h>
#endif
#endif