-
Notifications
You must be signed in to change notification settings - Fork 16
/
modf.h
44 lines (38 loc) · 961 Bytes
/
modf.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _MODF_H_
#define _MODF_H_
#include <stdio.h>
#include "types.h"
#include "settings.h"
#include "mod.h"
typedef struct {
u8 branch[4];
u8 module_memoffset[4];
} modf_start;
typedef struct
{
int haveread;
FILE* file;
const char* name;
u8* buffer;
settings* usersettings;
u64 offset;
u64 size;
mod_header* mod;
mod_meta meta;
u8* module;
u32 module_size;
u8* text;
u8* ro;
u8* data;
} modf_context;
void modf_init(modf_context* ctx);
void modf_set_file(modf_context* ctx, FILE* file);
void modf_set_name(modf_context* ctx, const char* name);
void modf_set_buffer(modf_context* ctx, u8* buffer);
void modf_set_offset(modf_context* ctx, u64 offset);
void modf_set_size(modf_context* ctx, u64 size);
void modf_set_usersettings(modf_context* ctx, settings* usersettings);
void modf_read(modf_context* ctx, u32 actions);
int modf_process(modf_context* ctx, u32 actions);
void modf_print(modf_context* ctx, u32 actions);
#endif // _MODF_H_