About the code of strelka

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Uri Blass
Posts: 10312
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

About the code of strelka

Post by Uri Blass »

I find that Strelka is using some tricks to make it harder to understand
when the only reason that I can find for these tricks is if the target is to make reverse engineering harder.

Strelka has arrays of bitboards in const.c and I find that strelka simply xor the arrays in the beginning with some random numbers and never change them later.

The only reason that I can think for this behaviour is to make strelka harder to understand by reverse engineering because the person who tries to reverse engineer strelka may get array of constants that he does not understand their meaning when without xoring with some random numbers the person may use common sense to understand the meaning of the constants.

Uri
Harald
Posts: 318
Joined: Thu Mar 09, 2006 1:07 am

Re: About the code of strelka

Post by Harald »

Uri Blass wrote:I find that Strelka is using some tricks to make it harder to understand
when the only reason that I can find for these tricks is if the target is to make reverse engineering harder.

Strelka has arrays of bitboards in const.c and I find that strelka simply xor the arrays in the beginning with some random numbers and never change them later.

The only reason that I can think for this behaviour is to make strelka harder to understand by reverse engineering because the person who tries to reverse engineer strelka may get array of constants that he does not understand their meaning when without xoring with some random numbers the person may use common sense to understand the meaning of the constants.

Uri
This protection may work or not. It depends on the enthusiasm of the hacker.
Many years ago I was curious how the binary help texts of the Turbo-C compiler
on AtariST worked. They had a word index and hyperlinks in it.
I wrote a basic program to print out everything I did guess and find out.
Looks like a table? Print the differences as possible offsets and look for
data starting with this delta. In the end I had discovered the text token
table, the look backward packing and the hyperlink format and I could
print out the whole help system texts. In a few evenings of one week.
Later they changed the format and xored it with some byte.
I just guessed that right, tried 256 possibilities and stopped when the texts
were readable again. I never looked at the assembler code.

I got my current job by showing the company how to pack lots of names
in a list. :-)

Harald
Tony

Re: About the code of strelka

Post by Tony »

Uri Blass wrote:I find that Strelka is using some tricks to make it harder to understand
when the only reason that I can find for these tricks is if the target is to make reverse engineering harder.

Strelka has arrays of bitboards in const.c and I find that strelka simply xor the arrays in the beginning with some random numbers and never change them later.

The only reason that I can think for this behaviour is to make strelka harder to understand by reverse engineering because the person who tries to reverse engineer strelka may get array of constants that he does not understand their meaning when without xoring with some random numbers the person may use common sense to understand the meaning of the constants.

Uri
So he changes the tables befor he uses them ? So the tables can't be compared with data tables from another program ?

Now why would somebody do that ? I really wonder. Could it be meant to hide something ? No, it couldn't.

Tony
Uri Blass
Posts: 10312
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: About the code of strelka

Post by Uri Blass »

If he wanted to hide them then I see no reason for him to give me the source.

Maybe the tables in strelka are copied from rybka and Vas wanted to hide the bitboards that he is using by xoring them with random numbers.

I do not know the tables that are used in rybka beta and I do not know to analyze exe file to find tables of numbers so someone else will need to give an opinion about it.

Uri
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: About the code of strelka

Post by Christopher Conkie »

Tony wrote:
Uri Blass wrote:I find that Strelka is using some tricks to make it harder to understand
when the only reason that I can find for these tricks is if the target is to make reverse engineering harder.

Strelka has arrays of bitboards in const.c and I find that strelka simply xor the arrays in the beginning with some random numbers and never change them later.

The only reason that I can think for this behaviour is to make strelka harder to understand by reverse engineering because the person who tries to reverse engineer strelka may get array of constants that he does not understand their meaning when without xoring with some random numbers the person may use common sense to understand the meaning of the constants.

Uri
So he changes the tables befor he uses them ? So the tables can't be compared with data tables from another program ?

Now why would somebody do that ? I really wonder. Could it be meant to hide something ? No, it couldn't.

Tony
PawnStruScore0 and PawnStruScore1

I would like to know what Yuri thinks these two arrays do.

Regards

Christopher
Norm Pollock
Posts: 1056
Joined: Thu Mar 09, 2006 4:15 pm
Location: Long Island, NY, USA

Re: About the code of strelka

Post by Norm Pollock »

Why are people so suspicious of a program that immediately starts out above the level of long time super programs like Shredder, Fritz, Hiarcs, ..., and written by a programmer no one knew before? Hasn't anybody ever heard of "Beginner's Luck"?
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: About the code of strelka

Post by Christopher Conkie »

Norm Pollock wrote:Why are people so suspicious of a program that immediately starts out above the level of long time super programs like Shredder, Fritz, Hiarcs, ...,
No idea Norm. Why would someone be suspicious of a program that was created by disassembling the strongest chess engine?

:D
.....and written by a programmer no one knew before?
No idea Norm. Why would anyone be surprised when a programmer who uses a pseudonym does this? I just can't think of a reason......

:D
Hasn't anybody ever heard of "Beginner's Luck"?
Yes Norm......it must be that.......

:D

Regards

Christopher
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: About the code of strelka

Post by bob »

Norm Pollock wrote:Why are people so suspicious of a program that immediately starts out above the level of long time super programs like Shredder, Fritz, Hiarcs, ..., and written by a programmer no one knew before? Hasn't anybody ever heard of "Beginner's Luck"?
No.
Uri Blass
Posts: 10312
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: About the code of strelka

Post by Uri Blass »

The reason is simply similiarity to rybka and not playing strength.

I think that strelka code can be better tool for learning chess programs than other sources.

I did not read most of it but unlike free source programs like fruit that seem too big to me to learn, strelka is relatively small so I already started to learn it and I hope that I can learn it in some months unlike fruit and other sources that I guess that I may need years to learn so I gave up trying.

Note that I do not promise to learn strelka and I may decide also to give up learning strelka at some point in the future.

I am not interested in the evaluation (I do not think that evaluation is relatively the strongest part of strelka) but mainly in the data structure and the search so I will probably not try to learn the meaning of PawnStruScore0 and PawnStruScore1 that seem to me to be about evaluation.

Uri
Christopher Conkie
Posts: 6073
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Urika!

Post by Christopher Conkie »

Uri Blass wrote:The reason is simply similiarity to rybka and not playing strength.

I think that strelka code can be better tool for learning chess programs than other sources.

I did not read most of it but unlike free source programs like fruit that seem too big to me to learn, strelka is relatively small so I already started to learn it and I hope that I can learn it in some months unlike fruit and other sources that I guess that I may need years to learn so I gave up trying.

Note that I do not promise to learn strelka and I may decide also to give up learning strelka at some point in the future.

I am not interested in the evaluation (I do not think that evaluation is relatively the strongest part of strelka) but mainly in the data structure and the search so I will probably not try to learn the meaning of PawnStruScore0 and PawnStruScore1 that seem to me to be about evaluation.

Uri
So you are going to learn Rybka's search (but no promises)?

This must be what they mean by a "Urika" moment.....

:wink:

Christopher

btw We cracked it Uri.