<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Hexing</id>
		<title>Hexing - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Hexing"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Hexing&amp;action=history"/>
		<updated>2026-05-01T13:12:27Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Hexing&amp;diff=1095&amp;oldid=prev</id>
		<title>Ai4rei: Marked as outdated, does not reflect VC10 clients and Themida.</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Hexing&amp;diff=1095&amp;oldid=prev"/>
				<updated>2016-03-13T11:51:44Z</updated>
		
		<summary type="html">&lt;p&gt;Marked as outdated, does not reflect VC10 clients and Themida.&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:51, 13 March 2016&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Outdated}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Incomplete}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Incomplete}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As '''hexing''' is considered the process of modifying raw contents of a file on byte-level with a [[Hex Editor|hex editor]], regardless of the actual purpose of the file (text, image or another application). Such modifications may require exact knowledge of the files' format for the modification to succeed, as opposed to a high-level editing application such as an image editor.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As '''hexing''' is considered the process of modifying raw contents of a file on byte-level with a [[Hex Editor|hex editor]], regardless of the actual purpose of the file (text, image or another application). Such modifications may require exact knowledge of the files' format for the modification to succeed, as opposed to a high-level editing application such as an image editor.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ai4rei</name></author>	</entry>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Hexing&amp;diff=21&amp;oldid=prev</id>
		<title>Mysterious: Created page with &quot;{{Incomplete}} As '''hexing''' is considered the process of modifying raw contents of a file on byte-level with a hex editor, regardless of the actual purpose o...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Hexing&amp;diff=21&amp;oldid=prev"/>
				<updated>2013-01-13T02:58:00Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Incomplete}} As &amp;#039;&amp;#039;&amp;#039;hexing&amp;#039;&amp;#039;&amp;#039; is considered the process of modifying raw contents of a file on byte-level with a &lt;a href=&quot;/wiki/Hex_Editor&quot; title=&quot;Hex Editor&quot;&gt;hex editor&lt;/a&gt;, regardless of the actual purpose o...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Incomplete}}&lt;br /&gt;
As '''hexing''' is considered the process of modifying raw contents of a file on byte-level with a [[Hex Editor|hex editor]], regardless of the actual purpose of the file (text, image or another application). Such modifications may require exact knowledge of the files' format for the modification to succeed, as opposed to a high-level editing application such as an image editor.&lt;br /&gt;
&lt;br /&gt;
==Creating custom RagRE client using a DIFF patcher==&lt;br /&gt;
RagRE is the abbreviation for Ragnarok Renewal client (ragexeRE.exe), which is normally updated by Gravity weekly, to add new items or features, to fix bugs and the like. This is also the client, which is currently used for Hercules. Although it is possible to use an unmodified client with Hercules (up to 2010/08/04), it is typically modified using a DIFF patcher.&lt;br /&gt;
&lt;br /&gt;
Each new client requires [http://rathena.org/board/topic/53420-shins-diff-patcher/ Shin's Diff Patcher] and the [http://rathena.org/board/topic/53421-weediffgen/2 Wee Diff Gen plugin].&lt;br /&gt;
&lt;br /&gt;
===Diffing your client===&lt;br /&gt;
====Download your client====&lt;br /&gt;
Download a client from [http://subversion.assembla.com/svn/weetools/clients/ here]. Extract the executable from the zip file, extracting requires [http://www.7-zip.org/download.html 7zip]. I recommend making a folder and naming it &amp;quot;RagRe Exes&amp;quot; and in that folder create a folder with the name being your client's date. For example if my RagRe exe was &amp;quot;2011-04-27aRagexeRE&amp;quot;, I would name the folder I am extracting it to &amp;quot;2011-04-27a&amp;quot;, this is just to be organized and makes your exe easy to find. &lt;br /&gt;
&lt;br /&gt;
====Diffing====&lt;br /&gt;
Download Shin's Diff Patcher and the Wee Diff Gen plugin located above. If you did not download the Plain Diff Plugin, ignore the following sentence, as WeeDiffGenerator will be the main plugin. From the drop down menu under &amp;quot;Select patch engine&amp;quot; select &amp;quot;WeeDiffGenerator&amp;quot;. For &amp;quot;Source Executable&amp;quot; click &amp;quot;Select&amp;quot; and navigate to your RagRe exe's location, then select the executable. It will ask if you want it to auto-select recommended patches, click yes. Now a list of diffs will show up, with check boxes to the left. Simply decide what diff you would like to apply to your client, and click the check box. For some diffs like &amp;quot;Fix camera angles&amp;quot; you can select more than one, but its recommended that you only select one. This may change in the future. Some diffs like &amp;quot;Increase Headgear View ID&amp;quot; will have a text box pop up prompting you to enter a value. Once you are done selecting what diffs you would like to apply, make sure the &amp;quot;Output executable&amp;quot; location is alright with you, you only need to change it if you want the output executable to be saved somewhere other than the folder of the source executable's location. Click &amp;quot;Patch it!&amp;quot; and your diffed exe will now appear in either the folder where your source executable is, or where you chose to save it.&lt;br /&gt;
&lt;br /&gt;
===Follow-up modifications to diffed clients===&lt;br /&gt;
These modifications are usually applied to already DIFFed clients for finer customization, which is not possible with a DIFF by itself.&lt;br /&gt;
&lt;br /&gt;
====Custom Window Title====&lt;br /&gt;
Requires a client, which has been patched to allow custom window title and [http://mh-nexus.de/en/hxd/ HxD], or any other hex editor.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# First, you need to know what the current ''window title'' is.&lt;br /&gt;
# Start your client in Windowed mode to check.&lt;br /&gt;
# After closing the client, load it inside the hex editor.&lt;br /&gt;
# When the file loads, it should look something like this:&amp;lt;br&amp;gt;&amp;lt;center&amp;gt;[[Image:Hxd-main.png|Editing a ragexeRE with HxD]]&amp;lt;/center&amp;gt;&lt;br /&gt;
# Press '''Ctrl+F''' to open the Find window and input the window title. As the window title is usually stored at the beginning of the hexed client, a partial title will do.&lt;br /&gt;
# When you find the section, it will look something like this: &amp;lt;br&amp;gt;&amp;lt;center&amp;gt;[[Image:Hxd-custtitle.png|Current Window Title]]&amp;lt;/center&amp;gt;&lt;br /&gt;
# Now, on the '''right''' side (ASCII text), start where the current Window Title starts and begin overwriting it with your NEW window title.&lt;br /&gt;
# If there are leftover words after you have typed your NEW window title, switch to the '''left''' side (Hexadecimal) and over-write the rest of the title with 00 (zeros).&lt;br /&gt;
# Save.&lt;br /&gt;
&lt;br /&gt;
====Custom data.ini====&lt;br /&gt;
{{EntirePage|DATA.INI#Other Names}}&lt;br /&gt;
You can rename the [[DATA.INI]] file to any name that is 8 characters long (including the extension). Then, just edit your client with a Hex Editor. Find DATA.INI and replace with your new filename.&lt;br /&gt;
&lt;br /&gt;
====Custom clientinfo.xml====&lt;br /&gt;
You can rename the [[clientinfo.xml]] file to any name that is 15 characters long (including the extension). Then, just edit your client with a Hex Editor. Find clientinfo.xml and replace with your new filename. Note, that for newer and non-[[sakray]] clients, this file is called clientinfo.xml.&lt;br /&gt;
&lt;br /&gt;
==Find-Replace Hexing==&lt;br /&gt;
This technique is used for single features, rather than a collection of features, and is often applicable across different client versions. Such edits are distributed as a single or a set of two line edits, which specify what should be ''found'' and what should the found character sequence be ''replaced'' with, and mostly retain the length (both lines specify same amount of characters).&lt;br /&gt;
&lt;br /&gt;
The character sequences are applied using a hex editor and represented by hexadecimal values of bytes, optionally each byte (two hexadecimal numbers) separated by a space. A typical find-replace hex looks like this (anti-quake patch for certain client versions[http://www.eathena.ws/board/index.php?showtopic=249328]):&lt;br /&gt;
 F: C390909090558BEC8B4508568BF1894604&lt;br /&gt;
 R: C390909090C214008B4508568BF1894604&lt;br /&gt;
&lt;br /&gt;
===Application===&lt;br /&gt;
[[Image:Hxd-findreplace.png|thumb|359px|Find and replace dialog in HxD, with a hex code ready.]]The first one is copied and pasted into hex editor find/replace window's ''find'' field, the latter is pasted into the ''replace with'' field. The search is set to be case-sensitive and then all occurrences are replaced.&lt;br /&gt;
&lt;br /&gt;
The author of such '''hex''' may want to specify the correct amount of hits for verification. If the search does not yield any result, the hex is incompatible. The hex must '''never be applied partially''', such as omitting first two bytes, as that can lead to undefined behavior.&lt;br /&gt;
&lt;br /&gt;
===Variable Codes===&lt;br /&gt;
In some instances the hex requires some variable bytes, whose value is either adjustable (replace line only) or varying among clients (both lines). This kind of ''wild card'' is expressed with:&lt;br /&gt;
* XX - more common for adjustable values&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;??&amp;lt;/nowiki&amp;gt; - is recognized as wild card in some hex editors&lt;br /&gt;
* Description of the bytes in &amp;lt; &amp;gt;, such as 3-byte &amp;lt;BBGGRR&amp;gt; for little-endian RGB color values&lt;br /&gt;
&lt;br /&gt;
Example (vending max. sell price unlocking):&lt;br /&gt;
 F: 3DF1B9F505&lt;br /&gt;
 R: 3DXXXXXXXX&lt;br /&gt;
&lt;br /&gt;
==Low-Level Hexing==&lt;br /&gt;
Low-Level Hexing is an Ultimate Hexing Sakexe by using OllyDbg. This is Advanced technique. You need some x86 Assembly language knowledge for using this technique in order to discern the runtime order of the EXE you're looking at. The more Assembly you know, the better, as you'll be more adept at seeing what is going on. &lt;br /&gt;
&lt;br /&gt;
It's necessarily quite apt to point out that in more recent times, the EXEs Gravity has put out have made things a little harder. As an example, a recent EXE, 2012-10-17bRagexeRE includes [http://anonym.to/?http://www.oreans.com/themida.php Themida] protection, which includes anti-debugger measures. Fortunately, these anti-debugging measures aren't wholly preventative, but still provide an additional challenge; StrongOD and Phant0m allow for skipping of the anti-debug challenge, however, the other features of Themida mean that someone without experience in assembly language would be incredibly confused about the output. &lt;br /&gt;
&lt;br /&gt;
===Programs needed===&lt;br /&gt;
* [http://www.ollydbg.de/ OllyDbg]&lt;br /&gt;
* [http://tuts4you.com/download.php?view.2028 StrongOD]&lt;br /&gt;
* [http://tuts4you.com/download.php?view.1276 Phant0m]&lt;br /&gt;
&lt;br /&gt;
===Loading the Sakexe===&lt;br /&gt;
Run ''OLLYDBG.EXE'' and select menu File &amp;gt; Open. Then choose the Sakexe you want to Hex. If your Sakexe needs some parameters to launch (ex: 1sak1). Enter that parameter in ''Arguments'' field. Then press Open Button.&lt;br /&gt;
&lt;br /&gt;
===Finding WinMain function===&lt;br /&gt;
WinMain is an entry point in Windows GUI ('''G'''raphical '''U'''ser '''I'''nterface) applications, that is, where an application's code starts executing. This applies to the Ragnarok client as well, thus it is important to know it's location. Different compilers produce different WinMain locations.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If you have the Windows platform SDK installed, scan the import libraries first to resolve names of a lot of common functions, such as WinMain, before hexing. This will make things easier, because you do not have to deal with plain addresses. To scan the libraries, press '''Ctrl+O''', browse for the *.lib files, and then click scan. Analyze (Ctrl+A) the client afterwards, to apply the scan results.&lt;br /&gt;
&lt;br /&gt;
====2010-08-10aRagexeRE and older (Visual C++ 6.0)====&lt;br /&gt;
All clients before 2010-08-18aRagexeRE (this includes all Sakexe clients) are compiled with Visual C++ 6.0 and their WinMain can be found as a CALL after the first CALL to GetModuleHandle. You can find it by a scroll down 10 - 20 lines from current position after loading Sakexe.&lt;br /&gt;
&lt;br /&gt;
 PUSH    ESI&lt;br /&gt;
 CALL    DWORD PTR DS:[&amp;lt;&amp;amp;KERNEL32.GetModuleHandleA&amp;gt;]&lt;br /&gt;
 PUSH    EAX&lt;br /&gt;
 CALL    Private.00694780 &amp;lt;--- This is WinMain call.&lt;br /&gt;
 MOV     [LOCAL.24],EAX&lt;br /&gt;
 PUSH    EAX&lt;br /&gt;
&lt;br /&gt;
Pressing Enter when '''CALL Private.00694780''' is highlighted, will make you to go to the WinMain function.&lt;br /&gt;
&lt;br /&gt;
====2010-08-18aRagexeRE and newer (Visual C++ 9.0)====&lt;br /&gt;
Newer clients are compiled with Visual C++ 9.0, which is part of Visual Studio 2008. The structure of the entry point is completely different and more complex than the one of the older clients. After loading the client, the position is set to a CALL which is followed by a JMP.&lt;br /&gt;
&lt;br /&gt;
 CALL    Private.0074763E&lt;br /&gt;
 JMP     Private.00746D24&lt;br /&gt;
&lt;br /&gt;
The CALL is not important, as it only contains compiler specific stuff. Selecting the JMP and pressing Enter will make you go the code position, where WinMain is located. Scroll down, until you find a PUSH 400000, which is an equivalent to the GetModuleHandle call in older clients. The CALL after it is the WinMain function.&lt;br /&gt;
&lt;br /&gt;
 JMP     SHORT Private.00746E56&lt;br /&gt;
 PUSH    0A&lt;br /&gt;
 POP     EAX&lt;br /&gt;
 PUSH    EAX&lt;br /&gt;
 PUSH    ESI&lt;br /&gt;
 PUSH    0&lt;br /&gt;
 PUSH    400000&lt;br /&gt;
 CALL    Private.00745790 &amp;lt;--- This is WinMain call.&lt;br /&gt;
 MOV     DWORD PTR DS:[8AE16C],EAX&lt;br /&gt;
 CMP     DWORD PTR DS:[8AE160],0&lt;br /&gt;
&lt;br /&gt;
Pressing Enter when '''CALL Private.00745790''' is highlighted, will make you to go to the WinMain function.&lt;br /&gt;
&lt;br /&gt;
===Disable some instructions with NOP Instruction===&lt;br /&gt;
We can disable some instruction with NOP Instruction. By Right Click on the lines you want to replace by NOP. Then, Select ''Binary &amp;gt; Fill with NOPs''. You can also replace more one line in once ''Fill with NOPs''.&lt;br /&gt;
&lt;br /&gt;
===Changing instruction to other instruction===&lt;br /&gt;
We can change an instruction to other instruction by pressing ''Space Bar''. With the power of ''Space bar''. We can completely make modifications to our Sakexe. Such as changing ''jxx'' to ''jmp''.&lt;br /&gt;
&lt;br /&gt;
===Save our changes to Sakexe===&lt;br /&gt;
All changes in OllyDbg is not affected on our Sakexe until we save these changes. You can ''Right Click'' on anywhere in CPU Window. Then select ''Copy to executable &amp;gt; All modifications''. Dialog ''Copy selection to executable file'' will appear. Press ''Copy all'' and other window will appear. Right Click on anywhere in this window and select ''Save file'' and ''Save file as'' dialog will appear. Type desired file name and press ''Save'' Button. You can overwrite original file. OllyDbg will automatically backup our original Sakexe if we choose overwrite original file.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Loading Screens]]&lt;br /&gt;
* [[DATA.INI]]&lt;br /&gt;
* [[clientinfo.xml]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
* [http://rathena.org/board/topic/53421-weediffgen/ WeeDiffGen Plugin]&lt;br /&gt;
* [http://rathena.org/board/topic/53420-shins-diff-patcher/ Shin's Diff Patcher]&lt;br /&gt;
* [http://www.7-zip.org/download.html 7zip]&lt;br /&gt;
* [http://subversion.assembla.com/svn/weetools/ Weetools Repository]&lt;br /&gt;
&lt;br /&gt;
[[Category:Client Configuration]]&lt;/div&gt;</summary>
		<author><name>Mysterious</name></author>	</entry>

	</feed>