-
Notifications
You must be signed in to change notification settings - Fork 13
/
ps4.h
50 lines (42 loc) · 1.06 KB
/
ps4.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
45
46
47
48
49
50
#pragma once
#include <ctype.h>
#include <string>
#include <vector>
#include <map>
class CPS4
{
public:
CPS4(char*);
~CPS4();
void LoadLibNames(bool val);
void LoadJsonPath(std::string path);
bool LoadHeader();
bool LoadJsonSymFile(std::string filename, bool = true);
bool LoadJsonSym(bool = true);
void LoadSym();
bool isLoaded();
private:
int LoadFile(char*);
static int isDirectory(const char *path);
bool FindJsonSym(const char* path, const char* name, std::string* res);
std::map<std::string, std::string> nidmap;
std::map<std::string, std::string> libmap;
std::string _jsonpath;
std::string sprxfilename;
bool _isLoaded = false;
int addr_off = 0, data_addr_off = 0;
int symbol_table_offset = 0, symbol_table_size = 0, string_table_offset = 0, string_table_size = 0;
int pltrela_table_offset = 0, pltrela_table_size = 0;
int _libname_count = 0;
char* text_buf;
bool _displayLibName = false;
struct StringTable
{
const char* buffer;
size_t length;
const char* get(size_t offset)
{
return offset < length ? &buffer[offset] : 0;
}
};
};