We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2911cf9 commit ac5d11fCopy full SHA for ac5d11f
2 files changed
shellblocks/src/arch/utils.h
@@ -3,6 +3,8 @@
3
4
#if defined(__mips__)
5
#include "mips/utils.h"
6
+#elif defined(__i386__) || defined(__x86_64__)
7
+#include "x86/utils.h"
8
#elif defined(__arm__)
9
#include "arm/utils.h"
10
#endif
shellblocks/src/arch/x86/utils.h
@@ -0,0 +1,14 @@
1
+#ifndef SHELLCODE_BLOCKS_ARCH_I386_UTILS_H
2
+#define SHELLCODE_BLOCKS_ARCH_I386_UTILS_H
+
+#define NOP_OPCODE (0x90909090)
+#define GET_REL_ADDRESS(OUTPUT, LABEL) \
+ __asm__ volatile ( \
+ "call " GET_REL_LABEL(LABEL) "\n\t" \
+ GET_REL_LABEL(LABEL) ": pop %0\n\t" \
+ "add $(" #LABEL " - " GET_REL_LABEL(LABEL) "), %0\n\t" \
11
+ : "=r" (OUTPUT) : : \
12
+ )
13
14
+#endif // !SHELLCODE_BLOCKS_ARCH_I386_UTILS_H
0 commit comments