Re: Clever ways to hide a compare



jonathon wrote:
> Suppose you are writing a protection scheme, and need to compare 2
> values. Is there a clever way to do this without an outright 'cmp'

It doesn't matter how clever it is, as the person disassembling the
code will be just as clever.

I was wading through an old game the other day and found a section of
code that grabbed two values and XOR'd them, then kept track of the
zero flag through a series of convaluted steps designed to obscure what
he was doing. (When you XOR two identical bytes, the result is zero.)
Took me about 10 minutes to figure it out the purpose of the code, and
honestly, the code was so bad in other places it really could have used
the speed of a REP SCAS :-)

.



Relevant Pages

  • Re: white girlz have no ballz( things u cant say in the Bible study)
    ... Adroitness [synonym see CLEVER, DEXTEROUS] ... Thus reading 'CLEVER, arguments and debate' ... What compare views?...do not talk so silly, folks do it all the time, ... 'compare views' when reading different posts on the same subject. ...
    (uk.religion.christian)
  • Re: BBC closing Whats On section of their website
    ... a very clever idea if you want to be taken seriously, ... Style over substance. ... The only data that spans all TV channels is now/next data, whereas on the old site you could compare a whole day's TV across all channels. ...
    (uk.media.tv.misc)
  • Re: Lukasenko and chess
    ... He is more clever than you. ... I could compare you and Mr. ... Richerby with pair Neil Brennen and Mr. Spinrad. ...
    (rec.games.chess.misc)
  • Re: Fortran templates
    ... Very clever, not translatable into Fortran. ... integer function compare ...
    (comp.lang.fortran)
  • Re: read ahead or before
    ... The underlying problem is, the file is huge; its close to 15g and I ... What I am trying to do is, compare the current line to the next like ... I don't know if that can be considered more clever, ... nonstandard features. ...
    (comp.lang.awk)