-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathplugin.cpp
102 lines (82 loc) · 2.54 KB
/
plugin.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright (C) 2014 oct0xor
//
// This program is free software : you can redistribute it and / or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
// GNU General Public License 2.0 for more details.
//
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http ://www.gnu.org/licenses/
#include <ida.hpp>
#include <area.hpp>
#include <idd.hpp>
#include <dbg.hpp>
#include <loader.hpp>
#include <idp.hpp>
extern debugger_t debugger;
static bool init_plugin(void);
bool plugin_inited;
//--------------------------------------------------------------------------
// Initialize debugger plugin
static int idaapi init(void)
{
if (init_plugin())
{
dbg = &debugger;
plugin_inited = true;
return PLUGIN_KEEP;
}
return PLUGIN_SKIP;
}
//--------------------------------------------------------------------------
// Terminate debugger plugin
static void idaapi term(void)
{
if (plugin_inited)
{
//term_plugin();
plugin_inited = false;
}
}
//--------------------------------------------------------------------------
// The plugin method - usually is not used for debugger plugins
static void idaapi run(int /*arg*/)
{
}
//--------------------------------------------------------------------------
// Initialize PPC debugger plugin
static bool init_plugin(void)
{
if (ph.id != PLFM_PPC)
return false;
return true;
}
//--------------------------------------------------------------------------
char comment[] = "DECI3 debugger plugin by oct0xor.";
char help[] =
"DECI3 debugger plugin by oct0xor.\n"
"\n"
"This module lets you debug programs running in Playstation 3.\n";
//--------------------------------------------------------------------------
//
// PLUGIN DESCRIPTION BLOCK
//
//--------------------------------------------------------------------------
plugin_t PLUGIN =
{
IDP_INTERFACE_VERSION,
PLUGIN_DBG, // plugin flags
init, // initialize
term, // terminate. this pointer may be NULL.
run, // invoke plugin
comment, // long comment about the plugin
// it could appear in the status line
// or as a hint
help, // multiline help about the plugin
"DECI3 debugger plugin", // the preferred short name of the plugin
"" // the preferred hotkey to run the plugin
};