Re: Clever ways to hide a compare
- From: "Jim Leonard" <spamtrap@xxxxxxxxxx>
- Date: Mon, 26 Sep 2005 18:22:55 +0000 (UTC)
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 :-)
.
- Follow-Ups:
- Re: Clever ways to hide a compare
- From: jonathon
- Re: Clever ways to hide a compare
- References:
- Clever ways to hide a compare
- From: jonathon
- Clever ways to hide a compare
- Prev by Date: Re: Figuring out table based encryption in assembly
- Next by Date: Re: Clever ways to hide a compare
- Previous by thread: Re: Clever ways to hide a compare
- Next by thread: Re: Clever ways to hide a compare
- Index(es):
Relevant Pages
|