-
Notifications
You must be signed in to change notification settings - Fork 1
/
fasmcpp.win64.h
28 lines (23 loc) · 1.03 KB
/
fasmcpp.win64.h
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
27
28
#pragma once
#include <cstdint>
namespace fasmcpp { class Assembly; }
struct FasmBinaryHeader
{
void (*_assemble)(fasmcpp::Assembly* assembly, void* memory, size_t size, const char* predefinitions);
uint64_t (*_run)(const void* memory);
const char* _input_filename;
const char* _output_filename;
char* _fasm_memory;
void (*fasmError)(fasmcpp::Assembly*, const char*);
int (*fasmOpen)(fasmcpp::Assembly*, const char*);
void (*fasmRead)(fasmcpp::Assembly*, uint32_t, char*, uint32_t);
void (*fasmWrite)(fasmcpp::Assembly*, uint32_t, const char*, uint32_t);
void (*fasmClose)(fasmcpp::Assembly*, uint32_t);
uint32_t (*fasmLseek)(fasmcpp::Assembly*, uint32_t, int32_t, uint8_t);
void (*fasmDisplayBlock)(fasmcpp::Assembly*, const char*, uint32_t);
};
#define _BINARY_HEADER reinterpret_cast<FasmBinaryHeader*>(WIN64_LOW_MEMORY_FIXED_ADDRESS)
#define _assemble (_BINARY_HEADER->_assemble)
#define _run (_BINARY_HEADER->_run)
#define _input_filename (_BINARY_HEADER->_input_filename)
#define _output_filename (_BINARY_HEADER->_output_filename)