forked from Noice2k/NsisDecompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSISEmulator.h
90 lines (60 loc) · 1.86 KB
/
NSISEmulator.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
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
#pragma once
#include "GlobalVars.h"
#include <vector>
#include <string>
#include "NsisFile.h"
#include "Header.h"
#ifndef NSISCALL
# define NSISCALL __stdcall
#endif
typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
typedef struct {
exec_flags_t *exec_flags;
int (NSISCALL *ExecuteCodeSegment)(int, HWND);
void (NSISCALL *validate_filename)(TCHAR *);
int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
} extra_parameters;
typedef struct _stack_t
{
struct _stack_t *next;
WCHAR text[NSIS_MAX_STRLEN];
} stack_t;
/************************************************************************/
// êëàññ ýìóëÿöèè âûïîëíåíèÿ NSIS
/************************************************************************/
class CNSISEmulator
{
public:
CNSISEmulator(void);
~CNSISEmulator(void);
void Init();
void Run();
void Execute();
// the main file header, this header in compressed
std::vector<std::string> _function_call_stack;
std::vector<std::string> _stack;
int CNSISEmulator::GetIntFromParm(int id);
HKEY CNSISEmulator::myRegOpenKey(entry ent,REGSAM samDesired);
HKEY CNSISEmulator::GetRegRootKey(int hRootKey);
CNsisFile * file;
stack_t *g_st;
WCHAR *g_usrvars;
void CopyStrToWstr(char * in,WCHAR *out);
CListCtrl *_source_code_view;
CListCtrl *_stack_view;
CListCtrl *_variables_vew;
CListCtrl *_call_stack_view;
std::string state_output_directory;
int GetCompressedDataFromDataBlock(int off,HANDLE hfile);
int CNSISEmulator::resolveaddr(int v);
void CNSISEmulator::PushPopExch(entry _ent);
int ExecuteCodeSegment(std::string FunctionName,int entry_id);
int ExecuteEntry(int entry_id);
bool _breakByStep;
bool _runtoPoint;
void CreateStack();
void DeleteStack();
exec_flags_t g_exec_flags;
extra_parameters plugin_extra_parameters;
HRESULT g_hres;
};