-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.h
38 lines (27 loc) · 778 Bytes
/
header.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
//
// Created by michal on 09.09.17.
//
#ifndef PROJECT_HEADER_H
#define PROJECT_HEADER_H
#include <cstdint>
#include <vector>
const int magic_number_length = 8;
const int header_param_number = 3;
const int header_param_length = 4;
const int header_length_in_bytes = magic_number_length + header_param_number * header_param_length;
class Header {
public:
Header();
void read_header(std::vector<char> &buffer);
uint32_t get_data_size();
int get_size_of_file();
uint32_t get_initial_data_size();
private:
char magic[8];
uint32_t code_size;
uint32_t data_size;
uint32_t initial_data_size;
void verify(std::vector<char> &buffer);
uint32_t extract_uint_32_value(std::vector<char> &buffer);
};
#endif //PROJECT_EVM_FILE_HEADER_H