executable protector in pb???

Everything else that doesn't fall into one of the other PB categories.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

executable protector in pb???

Post by thefool »

Hi!

I dont want to make an exe protector, but would this be possible? The size of the pb exec isnt that big, so the size wont be a problem. A lot of asm is going to be needed, but can it be done? Playing with the memory of itself and stuff.

again, this question isnt "can i do that" its "can anyone do that".


a non-usable question, but interesting to know :P
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: executable protector in pb???

Post by Rings »

thefool wrote:Hi!

I dont want to make an exe protector, but would this be possible? The size of the pb exec isnt that big, so the size wont be a problem. A lot of asm is going to be needed, but can it be done? Playing with the memory of itself and stuff.

again, this question isnt "can i do that" its "can anyone do that".


a non-usable question, but interesting to know :P
ItCanBeDone
SPAMINATOR NR.1
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post by Kris_a »

A pretty simple way is to have a few other variables that should 'match' the one you want to prevent from being hacked. EG:

Code: Select all

Money = 5000

repeat
  a = money * 12052 ; random number
  b = money * 195

  ; Do money-related stuff

  ; If a trainer has changed the value of Money, this 'if' should trigger
  if a <> money * 12052 or b <> money * 195
    debug "Money has been hacked!"
  endif
forever
I'm not sure if this works, but I would guess that it'd be more reliable if you put it inside a thread, since you don't know what part of execution your program will be at when the values are changed.

I think it's also possible to register certain security measures that tell Windows not to give any other programs access to the memory of yours. No idea how, though :oops:
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

The simplest way is to increase or decrease all internal values by 1.

So you display 256 to the user but in fact the value is 255 :P
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

@kris-a: Hmm like the program checks itself. Interesting!
@num3: i used that before! You could also xor the value.
@rings : ok


:D
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post by Kris_a »

num3, certain programs (I think TSearch is one of them) get around this by checking 'one more or one less', so maybe you should add 5/10/3/etc instead :D
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

How does that protect the code?

* Feeling Thick - natural state *
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> certain programs (I think TSearch is one of them) get around this by
> checking 'one more or one less', so maybe you should add 5/10/3/etc
> instead

I think TSearch also lets you check for "higher" or "lower" than the last
match, so it doesn't matter if you add 1, 5 or 50 -- it can still find it. :)
Post Reply