-
Notifications
You must be signed in to change notification settings - Fork 2
/
kirk.hpp
75 lines (58 loc) · 1.59 KB
/
kirk.hpp
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
/* KIRK IDP hardware defines - (c) Proxima 2023
*/
#ifndef __KIRK_HPP
#define __KIRK_HPP
#pragma warning (disable : 4146)
#include <ida.hpp>
#include <idp.hpp>
#include <ua.hpp>
#include <name.hpp>
#include <auto.hpp>
#include <bytes.hpp>
#include <diskio.hpp>
#include <problems.hpp>
#include <frame.hpp>
#include <jumptable.hpp>
#include <lines.hpp>
#include <loader.hpp>
#include <offset.hpp>
#include <segment.hpp>
#include <segregs.hpp>
#include <kernwin.hpp>
#include "ins.hpp"
#include "../idaidp.hpp"
#include "../iohandler.hpp"
#define kirk_type specval_shorts.low
#define OPVAL_H_GR_BASE 0
#define OPVAL_H_CSR_BASE 32
#define REGS_COUNT 65
#define OPVAL_HW_H_SP 28
typedef enum kirk_operand_type {
KIRK_OPERAND_PC,
KIRK_OPERAND_MEM,
KIRK_OPERAND_IMM,
KIRK_OPERAND_UIMM,
KIRK_OPERAND_BRANCH,
} KIRK_OPERAND_TYPE;
/* Number of operands types. */
#define MAX_OPERANDS 7
/* Maximum number of operands referenced by any insn. */
#define MAX_OPERAND_INSTANCES 3
/* IDP exports */
DECLARE_PROC_LISTENER(idb_listener_t, struct kirk_t);
struct kirk_t : public procmod_t
{
netnode helper;
iohandler_t ioh = iohandler_t(helper);
idb_listener_t idb_listener = idb_listener_t(*this);
virtual ssize_t idaapi on_event(ssize_t msgid, va_list va) override;
int kirk_ana(insn_t* _insn);
int kirk_emu(const insn_t& insn);
bool kirk_is_switch(switch_info_t* si, const insn_t& insn);
void load_from_idb();
bool kirk_find_ioport_bit(outctx_t& ctx, int port, int bit);
};
#define PROCMOD_NODE_NAME "$ KIRK"
#define PROCMOD_NAME KIRK
extern int data_id;
#endif