Skip to content

Commit d5571a0

Browse files
committed
Fix formatting and links in client/hexing page
1 parent 9a2bdb4 commit d5571a0

File tree

3 files changed

+48
-53
lines changed

3 files changed

+48
-53
lines changed
1.8 KB
Loading
3.93 KB
Loading

docs/client/hexing.md

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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
37
modifications may require exact knowledge of the files' format for the modification to succeed, as opposed to a
48
high-level editing application such as an image editor.
59

@@ -10,8 +14,7 @@ add new items or features, to fix bugs and the like. This is also the client, wh
1014
Although it is possible to use an unmodified client with Hercules (up to 2010/08/04), it is typically modified using a
1115
DIFF patcher.
1216

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
1518
[xDiffPatcher](https://herc.ws/board/topic/852-xdiffpatcher-xdiffgen2-packet-parser-and-packet-extractor/).
1619

1720
### Diffing your client
@@ -54,25 +57,11 @@ Steps:
5457
2. Start your client in Windowed mode to check.
5558
3. After closing the client, load it inside the hex editor.
5659
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>![Editing a RagexeRE with HxD](assets/hxd_main.png)</center>
6561
5. Press **Ctrl+F** to open the Find window and input the window title. As the window title is usually stored at the
6662
beginning of the hexed client, a partial title will do.
6763
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>![Current window title](assets/hxd_custom_title.png)</center>
7665
7. Now, on the **right** side (ASCII text), start where the current Window Title starts and begin overwriting it with
7766
your NEW window title.
7867
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:
8170

8271
#### Custom data.ini
8372

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).
8574
Then, just edit your client with a Hex Editor. Find DATA.INI and replace with your new filename.
8675

8776
#### Custom clientinfo.xml
8877

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
9079
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.
9281

9382
## Find-Replace Hexing
9483

@@ -106,8 +95,9 @@ certain client versions[1](http://www.eathena.ws/board/index.php?showtopic=24932
10695

10796
### Application
10897

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>![Find and replace dialog in HxD, with a hex code ready.](./assets/hxd_find_replace.png)</center>
99+
100+
The first one is copied and pasted into hex editor
111101
find/replace window's *find* field, the latter is pasted into the *replace with* field. The search is set to be
112102
case-sensitive and then all occurrences are replaced.
113103

@@ -122,7 +112,7 @@ among clients (both lines). This kind of *wild card* is expressed with:
122112

123113
- XX - more common for adjustable values
124114
- ?? - 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
126116

127117
Example (vending max. sell price unlocking):
128118

@@ -150,7 +140,7 @@ someone without experience in assembly language would be incredibly confused abo
150140

151141
### Loading the Sakexe
152142

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
154144
parameters to launch (ex: 1sak1). Enter that parameter in *Arguments* field. Then press Open Button.
155145

156146
### Finding WinMain function
@@ -170,12 +160,14 @@ All clients before 2010-08-18aRagexeRE (this includes all Sakexe clients) are co
170160
WinMain can be found as a CALL after the first CALL to GetModuleHandle. You can find it by a scroll down 10 - 20 lines
171161
from current position after loading Sakexe.
172162

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+
```
179171

180172
Pressing Enter when **CALL Private.00694780** is highlighted, will make you to go to the WinMain function.
181173

@@ -185,30 +177,34 @@ Newer clients are compiled with Visual C++ 9.0, which is part of Visual Studio 2
185177
completely different and more complex than the one of the older clients. After loading the client, the position is set
186178
to a CALL which is followed by a JMP.
187179

188-
`CALL    Private.0074763E`
189-
`JMP     Private.00746D24`
180+
```ASM
181+
CALL    Private.0074763E
182+
JMP     Private.00746D24
183+
```
190184

191185
The CALL is not important, as it only contains compiler specific stuff. Selecting the JMP and pressing Enter will make
192186
you go the code position, where WinMain is located. Scroll down, until you find a PUSH 400000, which is an equivalent to
193187
the GetModuleHandle call in older clients. The CALL after it is the WinMain function.
194188

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+
```
205201

206202
Pressing Enter when **CALL Private.00745790** is highlighted, will make you to go to the WinMain function.
207203

208204
### Disable some instructions with NOP Instruction
209205

210206
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*.
212208

213209
### Changing instruction to other instruction
214210

@@ -218,16 +214,16 @@ completely make modifications to our Sakexe. Such as changing *jxx* to *jmp*.
218214
### Save our changes to Sakexe
219215

220216
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.
224220
OllyDbg will automatically backup our original Sakexe if we choose overwrite original file.
225221

226222
## See Also
227223

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)
231227

232228
## External Links
233229

@@ -236,4 +232,3 @@ OllyDbg will automatically backup our original Sakexe if we choose overwrite ori
236232
- [7zip](http://www.7-zip.org/download.html)
237233
- [Weetools Repository](http://subversion.assembla.com/svn/weetools/)
238234

239-
[Category:Client Configuration](Category:Client_Configuration "wikilink")

0 commit comments

Comments
 (0)