1
- As ** hexing** is considered the process of modifying raw contents of a file on byte-level with a [ hex
2
- editor] ( Hex_Editor " wikilink ") , regardless of the actual purpose of the file (text, image or another application). Such
1
+ !!! warning
2
+ This page is outdated and incomplete. If you have the knowledge about it, consider [ contributting] ( ../contributing/editing-the-docs.md ) to this page.
3
+
4
+
5
+ As ** hexing** is considered the process of modifying raw contents of a file on byte-level with a
6
+ [ hex editor] ( ./hex-editor.md ) , regardless of the actual purpose of the file (text, image or another application). Such
3
7
modifications may require exact knowledge of the files' format for the modification to succeed, as opposed to a
4
8
high-level editing application such as an image editor.
5
9
@@ -10,8 +14,7 @@ add new items or features, to fix bugs and the like. This is also the client, wh
10
14
Although it is possible to use an unmodified client with Hercules (up to 2010/08/04), it is typically modified using a
11
15
DIFF patcher.
12
16
13
- Each new client requires [ Wee Diff Gen plugin/Shins Diff
14
- Patcher] ( https://herc.ws/board/topic/827-weediff-aka-shins-diff-patcher-weediffgen-continuation/ ) OR
17
+ Each new client requires [ Wee Diff Gen plugin/Shins Diff Patcher] ( https://herc.ws/board/topic/827-weediff-aka-shins-diff-patcher-weediffgen-continuation/ ) OR
15
18
[ xDiffPatcher] ( https://herc.ws/board/topic/852-xdiffpatcher-xdiffgen2-packet-parser-and-packet-extractor/ ) .
16
19
17
20
### Diffing your client
@@ -54,25 +57,11 @@ Steps:
54
57
2 . Start your client in Windowed mode to check.
55
58
3 . After closing the client, load it inside the hex editor.
56
59
4 . When the file loads, it should look something like this:
57
- <center >
58
-
59
- <figure >
60
- <img src =" Hxd-main.png " title =" Editing a ragexeRE with HxD " />
61
- <figcaption >Editing a ragexeRE with HxD</figcaption >
62
- </figure >
63
-
64
- </center >
60
+ <center ></center >
65
61
5 . Press ** Ctrl+F** to open the Find window and input the window title. As the window title is usually stored at the
66
62
beginning of the hexed client, a partial title will do.
67
63
6 . When you find the section, it will look something like this:
68
- <center >
69
-
70
- <figure >
71
- <img src =" Hxd-custtitle.png " title =" Current Window Title " />
72
- <figcaption >Current Window Title</figcaption >
73
- </figure >
74
-
75
- </center >
64
+ <center ></center >
76
65
7 . Now, on the ** right** side (ASCII text), start where the current Window Title starts and begin overwriting it with
77
66
your NEW window title.
78
67
8 . If there are leftover words after you have typed your NEW window title, switch to the ** left** side (Hexadecimal)
@@ -81,14 +70,14 @@ Steps:
81
70
82
71
#### Custom data.ini
83
72
84
- You can rename the [ DATA.INI] ( DATA.INI " wikilink " ) file to any name that is 8 characters long (including the extension).
73
+ You can rename the [ DATA.INI] ( ./data-ini.md ) file to any name that is 8 characters long (including the extension).
85
74
Then, just edit your client with a Hex Editor. Find DATA.INI and replace with your new filename.
86
75
87
76
#### Custom clientinfo.xml
88
77
89
- You can rename the [ clientinfo.xml] ( clientinfo.xml " wikilink " ) file to any name that is 15 characters long (including
78
+ You can rename the [ clientinfo.xml] ( ./ clientinfo.md ) file to any name that is 15 characters long (including
90
79
the extension). Then, just edit your client with a Hex Editor. Find clientinfo.xml and replace with your new filename.
91
- Note, that for newer and non-[ sakray] ( sakray " wikilink " ) clients, this file is called clientinfo.xml.
80
+ Note, that for newer and non-[ sakray] ( ../basics/ sakray.md ) clients, this file is called clientinfo.xml.
92
81
93
82
## Find-Replace Hexing
94
83
@@ -106,8 +95,9 @@ certain client versions[1](http://www.eathena.ws/board/index.php?showtopic=24932
106
95
107
96
### Application
108
97
109
- <img src="Hxd-findreplace.png" title="Find and replace dialog in HxD, with a hex code ready." width="359"
110
- alt="Find and replace dialog in HxD, with a hex code ready." />The first one is copied and pasted into hex editor
98
+ <center ></center >
99
+
100
+ The first one is copied and pasted into hex editor
111
101
find/replace window's * find* field, the latter is pasted into the * replace with* field. The search is set to be
112
102
case-sensitive and then all occurrences are replaced.
113
103
@@ -122,7 +112,7 @@ among clients (both lines). This kind of *wild card* is expressed with:
122
112
123
113
- XX - more common for adjustable values
124
114
- ?? - is recognized as wild card in some hex editors
125
- - Description of the bytes in \< \> , such as 3-byte <BBGGRR > for little-endian RGB color values
115
+ - Description of the bytes in ` < > ` , such as 3-byte ` <BBGGRR> ` for little-endian RGB color values
126
116
127
117
Example (vending max. sell price unlocking):
128
118
@@ -150,7 +140,7 @@ someone without experience in assembly language would be incredibly confused abo
150
140
151
141
### Loading the Sakexe
152
142
153
- Run * OLLYDBG.EXE* and select menu File \ > Open. Then choose the Sakexe you want to Hex. If your Sakexe needs some
143
+ Run * OLLYDBG.EXE* and select menu ` File > Open ` . Then choose the Sakexe you want to Hex. If your Sakexe needs some
154
144
parameters to launch (ex: 1sak1). Enter that parameter in * Arguments* field. Then press Open Button.
155
145
156
146
### Finding WinMain function
@@ -170,12 +160,14 @@ All clients before 2010-08-18aRagexeRE (this includes all Sakexe clients) are co
170
160
WinMain can be found as a CALL after the first CALL to GetModuleHandle. You can find it by a scroll down 10 - 20 lines
171
161
from current position after loading Sakexe.
172
162
173
- ` PUSH ESI `
174
- ` CALL DWORD PTR DS:[<&KERNEL32.GetModuleHandleA>] `
175
- ` PUSH EAX `
176
- ` CALL Private.00694780 <--- This is WinMain call. `
177
- ` MOV [LOCAL.24],EAX `
178
- ` PUSH EAX `
163
+ ``` ASM
164
+ PUSH ESI
165
+ CALL DWORD PTR DS:[<&KERNEL32.GetModuleHandleA>]
166
+ PUSH EAX
167
+ CALL Private.00694780 <--- This is WinMain call.
168
+ MOV [LOCAL.24],EAX
169
+ PUSH EAX
170
+ ```
179
171
180
172
Pressing Enter when ** CALL Private.00694780** is highlighted, will make you to go to the WinMain function.
181
173
@@ -185,30 +177,34 @@ Newer clients are compiled with Visual C++ 9.0, which is part of Visual Studio 2
185
177
completely different and more complex than the one of the older clients. After loading the client, the position is set
186
178
to a CALL which is followed by a JMP.
187
179
188
- ` CALL Private.0074763E `
189
- ` JMP Private.00746D24 `
180
+ ``` ASM
181
+ CALL Private.0074763E
182
+ JMP Private.00746D24
183
+ ```
190
184
191
185
The CALL is not important, as it only contains compiler specific stuff. Selecting the JMP and pressing Enter will make
192
186
you go the code position, where WinMain is located. Scroll down, until you find a PUSH 400000, which is an equivalent to
193
187
the GetModuleHandle call in older clients. The CALL after it is the WinMain function.
194
188
195
- ` JMP SHORT Private.00746E56 `
196
- ` PUSH 0A `
197
- ` POP EAX `
198
- ` PUSH EAX `
199
- ` PUSH ESI `
200
- ` PUSH 0 `
201
- ` PUSH 400000 `
202
- ` CALL Private.00745790 <--- This is WinMain call. `
203
- ` MOV DWORD PTR DS:[8AE16C],EAX `
204
- ` CMP DWORD PTR DS:[8AE160],0 `
189
+ ``` ASM
190
+ JMP SHORT Private.00746E56
191
+ PUSH 0A
192
+ POP EAX
193
+ PUSH EAX
194
+ PUSH ESI
195
+ PUSH 0
196
+ PUSH 400000
197
+ CALL Private.00745790 ; <--- This is WinMain call.
198
+ MOV DWORD PTR DS:[8AE16C],EAX
199
+ CMP DWORD PTR DS:[8AE160],0
200
+ ```
205
201
206
202
Pressing Enter when ** CALL Private.00745790** is highlighted, will make you to go to the WinMain function.
207
203
208
204
### Disable some instructions with NOP Instruction
209
205
210
206
We can disable some instruction with NOP Instruction. By Right Click on the lines you want to replace by NOP. Then,
211
- Select * Binary \ > Fill with NOPs* . You can also replace more one line in once * Fill with NOPs* .
207
+ Select ` Binary > Fill with NOPs ` . You can also replace more one line in once * Fill with NOPs* .
212
208
213
209
### Changing instruction to other instruction
214
210
@@ -218,16 +214,16 @@ completely make modifications to our Sakexe. Such as changing *jxx* to *jmp*.
218
214
### Save our changes to Sakexe
219
215
220
216
All changes in OllyDbg is not affected on our Sakexe until we save these changes. You can * Right Click* on anywhere in
221
- CPU Window. Then select * Copy to executable \ > All modifications* . Dialog * Copy selection to executable file* will
222
- appear. Press * Copy all* and other window will appear. Right Click on anywhere in this window and select * Save file* and
223
- * Save file as* dialog will appear. Type desired file name and press * Save* Button. You can overwrite original file.
217
+ CPU Window. Then select ` Copy to executable > All modifications ` . Dialog ` Copy selection to executable file ` will
218
+ appear. Press ` Copy all ` and other window will appear. Right Click on anywhere in this window and select ` Save file ` and
219
+ ` Save file as ` dialog will appear. Type desired file name and press ` Save ` Button. You can overwrite original file.
224
220
OllyDbg will automatically backup our original Sakexe if we choose overwrite original file.
225
221
226
222
## See Also
227
223
228
- - [ Loading Screens] ( Loading_Screens " wikilink " )
229
- - [ DATA.INI] ( DATA.INI " wikilink " )
230
- - [ clientinfo.xml] ( clientinfo.xml " wikilink " )
224
+ - [ Loading Screens] ( ./loading-screens.md )
225
+ - [ DATA.INI] ( ./data-ini.md )
226
+ - [ clientinfo.xml] ( ./ clientinfo.md )
231
227
232
228
## External Links
233
229
@@ -236,4 +232,3 @@ OllyDbg will automatically backup our original Sakexe if we choose overwrite ori
236
232
- [ 7zip] ( http://www.7-zip.org/download.html )
237
233
- [ Weetools Repository] ( http://subversion.assembla.com/svn/weetools/ )
238
234
239
- [ Category: Client Configuration] ( Category:Client_Configuration " wikilink ")
0 commit comments