-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.h
More file actions
26 lines (20 loc) · 785 Bytes
/
utils.h
File metadata and controls
26 lines (20 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef SHELLCODE_BLOCKS_ARCH_UTILS_H
#define SHELLCODE_BLOCKS_ARCH_UTILS_H
#if defined(__mips__)
#include "mips/utils.h"
#elif defined(__i386__) || defined(__x86_64__)
#include "x86/utils.h"
#elif defined(__arm__)
#include "arm/utils.h"
#elif defined(__powerpc__)
#include "powerpc/utils.h"
#endif
#define REL_ACCESS_STRING __attribute__((section(".text")))
#define GET_REL_LABEL(LABEL) "__get_" # LABEL
#define DECLARE_NOP_END(var_name) \
const u32 var_name[] REL_ACCESS_STRING = {NOP_OPCODE,NOP_OPCODE,NOP_OPCODE};
#define JUMP_TO_NOP_END(var_name) \
void (*var_name##_rel)(); \
GET_REL_ADDRESS(var_name##_rel, var_name); \
var_name##_rel();
#endif // !SHELLCODE_BLOCKS_ARCH_UTILS_H