Retry: Rybka 1.0 Beta Node Count Patch

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

rfadden

Retry: Rybka 1.0 Beta Node Count Patch

Post by rfadden »

I posted the question on the Rybka Forum asking Vasic Rajlish if there was any objection to me posting this Patch for Rybka 1.0 Beta.

There are no objections and much time has passed so I'll post the information now.

---------

The Patch is given here as a text file which contains a simple encoding used by a Patch program to alter bytes in a .exe file.

The program that applies the patch is freeware that is available for download. This PC utility is called "DZA Patcher v1.3"

This program reads from a text file which contains a catenated set of strings that look like this:

"40939D/8B/0D*"

Translated to English this means at Virtual Address 40939D (hex), store the Byte 8B (hex) and for verification note that this byte contains the original value of 0D (hex). The final "*" ends this little record and the patch file that I include is simply a set of these records all together in one long string, stored with no <cr> carriage return characters in a text file.

The following is from a file where I attempted to document how to get and then use DZA Patcher to apply this Patch to Rybka 1.0 Beta.exe

The Patch changes Rybka 1.0 to remove the Node Count Obfuscation which has been in this program all along. After applying the patch to your own version of this program then you can run this chess engine and watch the actual Depth, Nodes, and NPS of this historic engine.

===============

Google search for and download the program called "DZA Patcher v1.3"

I currently see this tool available for Download at "http://programmerstools.org/node/282"

Author: +DzA
Version: 1.3
File: dzapatcher1.3.zip (55.63 KB)

Description:
If you were looking for a tool which can PATCH almost any kind of encrypted/compressed PE file, without using crap "loaders" or other kinds of memory patchers, without needing to spend so much time to do a direct patch in the exe using compressor/encryptor loader redirectioning methods, well you were looking for +DzA's Patcher. With this patcher you can even patch files which were encrypted with multiple layers.

The program is also available at:
"http://www.softpedia.com/get/Programmin ... cher.shtml"


Run DZA Patcher and you see a window with numerous buttons and at the top right you see a button with three dots "...". Press that button and a dialog box will pop up to prompt you for the file that you intend to patch. (Make sure you have previously created a duplicate copy of "Rybka v1.0 Beta.w32.exe")

So naturally select the program "Rybka v1.0 Beta.w32.exe", and click "open" on the dialog box. DZA Patcher will then show you the file that you have selected in a text box at the top of it's main interactive window.

Having saved these codes that specify the patches within a file such as "RybkaPatch9.txt" the next task is to specify that this file is to be used.

Within the box in DZA Patcher labeled "Patch editor" there is a button labeled "Load List." Press this button and another dialog box will pop up that allows you to select the text file which contains the encoding of the patches that you want to apply. So select "RybkaPatch9.txt" and select "Open".

At that time the program will display the full list of patches that are to be applied within its own scrolling region of the Patch editor box.

To complete the patching operation simply click on the button labeled "Patch application" which is near the top right of the window.

A Pop-up window then displays "DZA Patcher: Your file was patched without errors;) so just click on "OK" and the program will then exit.

At this time it is a good idea to rename the .exe file that was just patched so you know clearly which .exe has been modified. Note that the file size does change so you can tell that the file has been modified.

I typically rename this patched exe to something such as "Rybka v1.0 Patch9.exe"


The original file:
"Rybka v1.0 Beta.w32.exe" is 2,456 KB, and
"Rybka v1.0 Patch9.exe" is 2,460 KB.

After applying the patch then just run the program in the usual fashion. If you use Arena for example, then simply "Add a new Engine" the way you would for any other engine and specify the "Rybka v1.0 Patch9.exe" file as the program (use any program name that you want).

So then as you run this version of Rybka 1.0 Beta you will for the first time start seeing the accurate Depth, Node Count, and Nodes Per Second calculation. Also if you use the UCI command "go depth 12" for example this will work correctly, whereas the original Rybka 1.0 beta (and other versions of Rybka) will change this depth to 14 and then incorrectly report depth to seemingly be consistent. (Later versions of Rybka play a slightly different game with the Depth limit that is entered.)

Note that your GUI may be sending the command to limit depth during search and the main point is that the Patched version of Rybka will for the first time actually do what you specify.

On my Athlon XP 2400+ I am seeing between 700,000 to 1,200,000 Nodes Per Second.

Note that this counting of Nodes and Nodes per second is a straightforward counting of the number of times the Make_Move function is called. Some computer chess experts have suggested that counting the calls to Make_Move is a valid way to count nodes during search.

Note that Null Moves are not counted with this technique.
rfadden

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by rfadden »

Here's another attempt to give the Patch file. I'm including <cr> carriage return in this text so it doesn't "freak out" the formatting/display of the forum. If you place these codes into a file in order to try out this patch you may need to remove the <cr> characters since all I have tested is a .txt file with these codes but with no extra characters inserted in this string.

Code: Select all

40939D/8B/8D*40939E/F2/34*40939F/90/D0*4096DD/00/02*
409700/00/02*40A774/E8/C3*40A775/D7/CC*40A776/02/CC*
40A777/01/CC*40A778/00/CC*40A779/C3/CC*40C040/01/05*
40C045/00/FE*40C6BB/83/A1*40C6BC/C4/6C*40C6BD/08/7A*
40C6BE/E9/66*40C6BF/86/00*40C6C0/FB/83*40C6C1/FF/E8*
40C6C2/FF/01*40C716/4B/2F*40C717/E3/FB*40C718/00/FF*
40C719/00/FF*40C723/3E/22*40C724/E3/FB*40C725/00/FF*
40C726/00/FF*40D611/01/05*40D798/8B/8D*40D799/F2/34*
40D79A/90/D0*40D7CB/00/FE*40D8D5/01/05*40D900/8B/8D*
40D901/F2/34*40D902/90/D0*40D927/00/FE*41AA50/A1/00*
41AA51/6C/00*41AA52/7A/00*41AA53/66/00*41AA54/00/00*
41AA55/83/00*41AA56/E8/00*41AA57/01/00*41AA58/85/00*
41AA59/C0/00*41AA5A/A3/00*41AA5B/6C/00*41AA5C/7A/00*
41AA5D/66/00*41AA5E/00/00*41AA5F/0F/00*41AA60/8E/00*
41AA61/6E/00*41AA62/1C/00*41AA63/FF/00*41AA64/FF/00*
41AA65/C3/00*661FFF/32/2D*661FFE/33/32*661FFD/20/33*
661FFC/68/20*661FFB/63/61*661FF9/61/65*661FF8/50/42*$
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by Matthias Gemuh »

Thanks, Rick !

Patch works great :D

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
User avatar
GenoM
Posts: 910
Joined: Wed Mar 08, 2006 9:46 pm
Location: Plovdiv, Bulgaria

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by GenoM »

when trying to load patch file I receive a message telling me that a file or either corrupted or read-only or invalid
Can you send me pure .txt file with patches?
Thanks
take it easy :)
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by Matthias Gemuh »

GenoM wrote:when trying to load patch file I receive a message telling me that a file or either corrupted or read-only or invalid
Can you send me pure .txt file with patches?
Thanks

I copied the one line in the other thread and saved it as one line without any empty line in the file.

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by ernest »

rfadden wrote:Here's another attempt to give the Patch file.
As Matthias said, the one line patch in the other thread works better with the dza_patcher.exe tool.

Here is the infinite analysis of the patched Rybka, on the start_position:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -

Engine: Rybka 1.0 Patch 32bit (512 MB) by Vasik Rajlich / Rick Fadden patch
13.01 0:01 +0.07 1.Nc3 Nf6 2.d4 d5 3.Nf3 Nc6 4.e3 Qd6 (1.834.138) 1519
14.01 0:02 +0.05 1.Nc3 Nf6 2.d4 e6 3.Nf3 Nc6 4.d5 Nb4 5.e4 (3.492.135) 1567
15.01 0:04 +0.06 1.Nc3 Nf6 2.d4 e6 3.Nf3 Nc6 4.e3 d5 5.Bd3 Bd6 (7.754.636) 731
16.01 0:12 +0.04 1.Nc3 Nf6 2.d4 d5 3.Nf3 Nc6 4.e3 e6 5.Bd3 Bd6 (20.459.096) 1704
17.01 0:42 +0.05 1.Nc3 e5 2.Nf3 Nc6 3.d4 exd4 4.Nxd4 Nf6 5.Bf4 Bc5 (67.100.558) 1636
17.04 0:59 +0.07 1.d4 Nf6 2.Nf3 d5 3.Nc3 Nc6 4.g3 g6 5.Ne5 Bf5 (94.938.138) 1665
18.01 1:34 +0.07 1.d4 Nf6 2.Nf3 d5 3.Nc3 Nc6 4.g3 g6 5.Ne5 Bf5 (151.999.423) 1652
best move: d2-d4 time: 1:47.312 min n/s: 1.650.215 nodes: 171.622.400

Engine: Rybka 1.0 Beta 32-bit (512 MB) by Vasik Rajlich
11.01 0:01 +0.07 1.Nc3 Nf6 2.d4 d5 3.Nf3 Nc6 4.e3 Qd6 (268.104) 225
12.01 0:02 +0.05 1.Nc3 Nf6 2.d4 e6 3.Nf3 Nc6 4.d5 Nb4 5.e4 (488.862) 220
13.01 0:04 +0.06 1.Nc3 Nf6 2.d4 e6 3.Nf3 Nc6 4.e3 d5 5.Bd3 Bd6 (1.036.211) 214
14.01 0:12 +0.04 1.Nc3 Nf6 2.d4 d5 3.Nf3 Nc6 4.e3 e6 5.Bd3 Bd6 (2.580.659) 215
15.01 0:41 +0.05 1.Nc3 e5 2.Nf3 Nc6 3.d4 exd4 4.Nxd4 Nf6 5.Bf4 Bc5 (7.892.424) 197
15.04 0:59 +0.07 1.d4 Nf6 2.Nf3 d5 3.Nc3 Nc6 4.g3 g6 5.Ne5 Bf5 (11.110.998) 194
16.01 1:34 +0.07 1.d4 Nf6 2.Nf3 d5 3.Nc3 Nc6 4.g3 g6 5.Ne5 Bf5 (17.427.649) 189
best move: d2-d4 time: 1:45.609 min n/s: 190.905 nodes: 19.472.384
Hart

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by Hart »

After being patched Rybka immediately crashes when executed.

Solutions? Running Vista 32-Bit...
rfadden

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by rfadden »

Yes we just found out that DZA Patcher does not work under Vista.

Oops, very sorry about that. I had no idea...


So if you have a Win2K or WinXP machine available, it seems that the Patched .exe will work there. My machine here is Win2K.

On the issue of running under Vista... I do have a Vista machine at home that I can mess with (my wife's computer). We might need to search for a different patch utility for Vista and then very likely the patch file could be changed to feed the values into the new program.

Sorry for the problem with Vista.

If anyone knows of a Patch utility that does run under Vista, then please post the info here.

Thanks
User avatar
GenoM
Posts: 910
Joined: Wed Mar 08, 2006 9:46 pm
Location: Plovdiv, Bulgaria

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by GenoM »

where is this 'one-line' patch? Can't find it... :(

PS:
ok, ok, I finally got it :) thanks all
take it easy :)
Al G. L.

Re: Retry: Rybka 1.0 Beta Node Count Patch

Post by Al G. L. »

rfadden wrote:Yes we just found out that DZA Patcher does not work under Vista.

Oops, very sorry about that. I had no idea...


So if you have a Win2K or WinXP machine available, it seems that the Patched .exe will work there. My machine here is Win2K.

On the issue of running under Vista... I do have a Vista machine at home that I can mess with (my wife's computer). We might need to search for a different patch utility for Vista and then very likely the patch file could be changed to feed the values into the new program.

Sorry for the problem with Vista.

If anyone knows of a Patch utility that does run under Vista, then please post the info here.

Thanks
Rick thanks! the patch worked great!
instead of DZA patcher, how about the powerful HIEW? its not as userfriendly as DZA patcher though.

did you do this alone? what disassembler did you use?