-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
49 lines (40 loc) · 1.42 KB
/
main.c
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
45
46
47
48
49
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vm/vm.h"
uint8_t data[] = {
//programListOffset = 0x00 -> 0x04
//programsList->programsCnt = 0x04 -> 0x01
//programsList->program = 0x06
//program[0] = 0x06
//program[0]->id = 0x06 -> 0x10
//program[0]->offset = 0x08 -> 0x10
// 0 1 2 3 4 5 6 7
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, //0x00
0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, //0x08
0x40, 0x00, 0xFF, 0x11, 0x11, 0x00, 0x00, 0x41, //0x10
0x00, 0xFF, 0x00, 0x11, 0x00, 0x00, 0x42, 0x00, //0x18
0xFF, 0x02, 0x00, 0x00, 0x00, 0x44, 0x00, 0xFF, //0x20
0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, //0x28
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x30
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x38
};
#define VM_BUFFER_SIZE 1000000
int main()
{
FILE *file_data = fopen("C:\\Miki\\priv\\Repos\\cVM\\VMcompiler\\compiled.bin", "rb");
uint8_t data[VM_BUFFER_SIZE];
memset(data, 0, sizeof(data));
fread(data, 1, sizeof(data), file_data);
S_VM *vm = VM_Init();
vm->VMData = (S_VMdata*) data;
VM_ENGINE(vm,
1234,
0,
0);
VM_ENGINE(vm,
1111,
0,
0);
return 0;
}