blob: 157e09b98fdfc536a73b1aa471978e2535182f4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include "instructions.h"
#include "registers.h"
#include "write_elf.c"
static const unsigned char some_opcodes[] = {
MOVWI(REG_EAX, (long)0x41), MOVQ(REG_EAX, REG_EDI),
MOVDI(REG_EAX, (long)0x3c), SYSCALL};
static const unsigned int some_opcodes_len =
sizeof(some_opcodes) / sizeof(some_opcodes[0]);
int
main(int argc, char* argv[]) {
char opcodes[] = {};
write_elf("test.out", some_opcodes_len, (char*)some_opcodes);
return 0;
}
|