-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCryPlaceIATHookWindow.cpp
53 lines (45 loc) · 1.42 KB
/
CryPlaceIATHookWindow.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
#include "CryPlaceIATHookWindow.h"
#include "BackendGlobalDef.h"
// CryPlaceIATHookWindow default constructor.
CryPlaceIATHookWindow::CryPlaceIATHookWindow(SIZE_T* const pAddress, const Image& icon) : CryDialogTemplate(icon)
{
this->mAddress = pAddress;
this->Title("Set IAT Hook").SetRect(0, 0, 300, 75);
this->mOk <<= THISBACK(DialogOkay);
this->mCancel <<= THISBACK(DialogCancel);
*this
<< this->mAddressDescription.SetLabel("Detour Address:").HSizePos(5, 5).TopPos(5, 25)
<< this->mAddressInput.HSizePos(130, 5).TopPos(5, 25)
<< this->mOk.Ok().SetLabel("OK").RightPos(5, 70).BottomPos(5, 25)
<< this->mCancel.SetLabel("Cancel").RightPos(80, 70).BottomPos(5, 25)
;
}
// CryPlaceIATHookWindow default destructor.
CryPlaceIATHookWindow::~CryPlaceIATHookWindow()
{
}
// Executed when the user accepts the dialog input.
void CryPlaceIATHookWindow::DialogOkay()
{
// Check whether the input is not empty or retarded.
String text = this->mAddressInput.GetText().ToString();
if (!text.IsEmpty() || (text.GetLength() > 0 && text.GetLength() <= 16))
{
#ifdef _WIN64
*this->mAddress = ScanInt64(text, NULL, 16);
#else
*this->mAddress = ScanInt(text, NULL, 16);
#endif
}
else
{
Prompt("Input error", CtrlImg::error(), "Please enter an address", "OK");
return;
}
this->AcceptBreak(10);
}
// Executed when the user closes the dialog without accepting the input.
void CryPlaceIATHookWindow::DialogCancel()
{
this->Close();
}