-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathida_plugin.cpp
More file actions
76 lines (65 loc) · 1.72 KB
/
Copy pathida_plugin.cpp
File metadata and controls
76 lines (65 loc) · 1.72 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <json/json.h>
#include <fstream>
#include "ida_plugin.h"
#include "ida_settings.h"
#include "ps4.h"
#include <idp.hpp>
#include <loader.hpp>
//--------------------------------------------------------------------------
// the main function of the plugin
static bool idaapi run(size_t)
{
CIDASettings settings;
std::string jsonpath = settings.getAsString("path");
if(jsonpath.empty())
{
qstring path;
if(ask_str(&path, HIST_DIR, "ps4libdoc path:"))
{
jsonpath = path.c_str();
settings.setValue("path", jsonpath.c_str());
}
else
{
return false;
}
}
settings.Save();
char buf[255]; size_t size = 255;
get_input_file_path(buf, size);
CPS4 ps4(buf);
ps4.LoadLibNames(settings.getAsBool("loadlibname"));
ps4.LoadJsonPath(settings.getAsString("path"));
ps4.LoadHeader();
ps4.LoadJsonSym();
ps4.LoadSym();
return true;
}
int idaapi init(void)
{
msg("PS4_NID_RESOVLER loaded.\n");
return PLUGIN_KEEP;
}
//--------------------------------------------------------------------------
//
// PLUGIN DESCRIPTION BLOCK
//
//--------------------------------------------------------------------------
plugin_t PLUGIN =
{
//IDP_INTERFACE_VERSION,
IDP_INTERFACE_VERSION,
0, // plugin flags
init, // initialize
NULL, // terminate. this pointer may be NULL.
run, // invoke plugin
// long comment about the plugin
// it could appear in the status line
// or as a hint
"This is a sample plugin that resolve PS4 NID.",
// multiline help about the plugin
"This is a sample plugin that resolve PS4 NID.",
// the preferred short name of the plugin
"PS4 NID Resolver",
"Ctrl-F10" // the preferred hotkey to run the plugin
};