-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.cpp
More file actions
129 lines (124 loc) · 7.58 KB
/
data.cpp
File metadata and controls
129 lines (124 loc) · 7.58 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
* Diablo Hacking Utility
*
* Copyright (C)1997 Trojan Consulting Ltd.
*
* andy@trojanco.demon.co.uk
*
* $Header: /diabhack/data.cpp 1 2/03/99 21:21 Andy $
*/
#include "diabhack.h"
char g_szCreatingDatfiles[] =
"DiabHack is designed to be extensible, in that the hacks it knows "
"about are not hard-coded into the executable. Instead DiabHack reads "
"the hack definitions from a .DAT file. The .DAT file contains zero "
"or more hacks, each of which contains one or more modifications to "
"the Diablo process in memory. Each hack definition is started in the "
".DAT file using the \"start\" keyword, followed by information about "
"the hack:\r\n\r\n"
"start <version> <description>\r\n\r\n"
"The <version> information contains the version of Diablo that the hack is known "
"to work with. It must be a single word (delimited by whitespace) but "
"may contain any information; for example \"V1.02\" or \"V1.02-V1.05\". "
"DiabHack does not attempt to interpret the version information, let alone "
"check that the currently running version of Diablo conforms to the version "
"information.\r\n"
"The <description> information describe the hack, and may be one or more words "
"upto the end of the line; for example \"Townkill -- really cool\".\r\n"
"The hack definition is ended in the .DAT file using the \"end\" keyword:\r\n\r\n"
"end\r\n\r\n"
"Each hack modification line must lie between the hack-start line and hack-end "
"line and takes the following form:\r\n\r\n"
"<offset> <olddata> <newdata>\r\n\r\n"
"The <offset> definition is the virtual address within the Diablo process at which "
"to apply the modification. The offset need not apply to the diablo.exe process "
"pages, and may apply to a .DLL loaded, either directly or indirectly, by "
"diablo.exe; as long as the virtual address is valid within the context of "
"the Diablo process, it should be OK. One added bonus of using the methods "
"that DiabHack uses to apply the hacks to Diablo, over using SoftICE, is that "
"the Win32 subsystem will page-in any non-present pages within the Diablo "
"process while applying the hack; SoftICE cannot do this so you must rely on "
"the pages you wish to hack being present.\r\n"
"The <olddata> definition contains the bytes that should be present within the "
"Diablo process before the modification is applied. It has two important purposes; "
"firstly it means that modifications can be dynamically undone (deactivated), and "
"secondly it means that DiabHack is able to validate the modification before "
"applying it.\r\n"
"The <newdata> definition contains the bytes that are used to modify the "
"Diablo process.\r\n"
"The <olddata> and <newdata> definitions should contain a stream of hex bytes, "
"without delimiters, and they must be 1) the same length as each other, and 2) "
"an even number (insert a leading 0 as necessary); for example "
"\"64ee345343435343\".\r\n\r\n"
"Below is a sample .DAT file showing the various elements I have described:\r\n\r\n"
"start V1.02 Invulnerable from monsters\r\n"
"45de9b 75 eb\r\n"
"45dfae 75 eb\r\n"
"405cbc 75 eb\r\n"
"end\r\n\r\n"
"Enjoy... Andy.\r\n";
char g_szSofticeCodes[] =
"Many Diablo Web sites contain codes for hacking Diablo using the SoftICE "
"debugger. Many of these codes can be either converted to .DAT file hacks "
"(see \"Help\\How To Create .DAT Files\" menu item for details) or entered "
"directly using DiabHack. Only those codes that use the \"e\" (edit) SoftICE "
"command can be successfully used, and those that require searching and other "
"advanced procedures will not work.\r\n\r\n"
"To convert a SoftICE code to a .DAT file hack, the only additional information "
"you require is the original contents of the memory being \"edited\" (this is "
"so DiabHack is able to verify the hack will work with the currently running "
"version of Diablo and to allow it to deactivate the hack). The original "
"memory contents can be obtained by selecting \"Read Diablo Memory\" from the "
"\"Utility\" menu. Enter the memory offset and length of the edit and DiabHack "
"will return the data that should be entered into the <olddata> field of the "
".DAT file hack.\r\n\r\n"
"As an example say you had the following SoftICE codes that you wanted to "
"convert to a .DAT file hack (these are garbage codes BTW):\r\n\r\n"
" E 405343 78 23 2 53 34 f\r\n"
" E 48f2f2 23 90 23 0 0\r\n\r\n"
"The offset for each modification is the second (large) value and the newdata "
"value is the stream of bytes following, which is represented in the .DAT file by "
"converting all characters to two digit ('2' -> '02', 'f' -> '0f', etc.) and "
"removing the spaces (or commas if they are written that way). So you can enter "
"the following into the .DAT file:\r\n\r\n"
"start V1.99 Some hack or other\r\n"
"405343 X 78230253340f\r\n"
"48f2f2 X 2390230000\r\n"
"end\r\n\r\n"
"The 'X' characters are just temporary place-holders and will be replaced in a "
"second. So you have the offsets and the newdata values, but DiabHack also "
"expects olddata values, which represents the current data in the program (this is "
"so DiabHack can deactivate the hack by restoring the previous value, and also "
"validate that the hack is compatible with the currently running version of "
"Diablo). You can get these values by asking DiabHack to read them from the "
"Diablo process using the \"Read Diablo Memory\" command, so enter the offset "
"and the number of bytes (in hex), which in "
"our example are 6 for the first line and 5 for the second. Suppose DiabHack "
"returned the values \"652f85e903e1\" and \"8a0b872305\" respectively, you can "
"complete the .DAT file hack by inserting those values in place of the 'X' "
"place-holder characters, thus:\r\n\r\n"
"start V1.99 Some hack or other\r\n"
"405343 652f85e903e1 78230253340f\r\n"
"48f2f2 8a0b872305 2390230000\r\n"
"end\r\n\r\n"
"All that remains is to load the .DAT file into DiabHack and check that it works.\r\n\r\n"
"SoftICE codes can be entered directly using DiabHack by selecting \"Write "
"Diablo Memory\" from the \"Utility\" menu. Enter the offset and the data "
"and DiabHack will write the data into the "
"Diablo process. As with the data specifications in .DAT files, the data should "
"be a hex stream, without delimiters, and must be a multiple of two. "
"Be warned that this is an extremely dangerous thing to do, "
"and can very easily (I mean VERY easily) result in the Diablo process crashing "
"(not because of DirectX this time) and possibly the whole system.\r\n\r\n"
"Other things to note when using the Read/Write Diablo Memory commands are that "
"all fields expect hex, so don't try to read 1000000 bytes from some offset, "
"thinking that less than a meg of data should not be a problem as you will find "
"that 1000000 (hex) = 16,777,216 (16 megs) the hard way.\r\n\r\n"
"Actually you're at no more risk from these command than you are from dodgy "
".DAT file values, so don't worry about them too much.\r\n";
char g_szDiabloNotRunningMsg[] =
"Diablo is not running. Some items in the Hack menu and some toolbar buttons "
"will be disabled until Diablo starts.";
char g_szDangerousCommandMsg[] =
"This command is very dangerous and can EASILY cause Diablo to crash.\r\n"
"Are you sure you know what you are doing ?";