-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
42 lines (30 loc) · 942 Bytes
/
main.cpp
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
#include "CmdlineParser.h"
#include "csxfile.h"
int main(int argc, char *argv[])
{
bool export_csx, imp;
std::string input, output;
CmdlineParser cmds(argc, argv);
cmds.add_bool_param("export", &export_csx, false, "Export data from archive");
cmds.add_bool_param("import", &imp, false, "");
cmds.add_string_param("input", &input, "", "Input file (directory)");
cmds.add_string_param("output", &output, "", "Output directory (file)");
cmds.parse();
CSXFile* csx = new CSXFile();
if (export_csx)
{
csx->load_from_file(input);
csx->read_offsets();
//csx->print_offsets();
csx->read_conststr();
//csx->print_conststr();
csx->read_linkinf();
csx->read_global();
csx->print_global();
csx->export_all_sections(output);
csx->decompile();
csx->listing_to_file(output);
}
delete csx;
return 0;
}