-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux.h
More file actions
32 lines (22 loc) · 693 Bytes
/
Copy pathlinux.h
File metadata and controls
32 lines (22 loc) · 693 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
27
28
29
30
31
32
#ifndef linux_h
#define linux_h
#include "../lcall.h"
// load dynamically link library
hlibrary lib_load(const char* libname);
// load a function of a loaded library
hprocedure lib_get(hlibrary h, const char* proc_name);
//////////////////////////////////////////////////////////////////////////
// set argument to a function, according byte order and call protocol
#define arg_set(_mword)\
__asm{push _mword}
// get return value. not implemented
#define ret_get(_mword_ret)\
__asm{mov _mword_ret, eax}
// call the function
#define proc_call(_proc)\
__asm{call _proc}
#define stack_save(_mword)\
__asm{mov _mword, esp}
#define stack_rewind(_mword)\
__asm{mov esp, _mword}
#endif