• Welcome to Valhalla Legends Archive.
 

[VB] Function Integrity Checks at Runtime

Started by Permaphrost, March 08, 2006, 03:01 PM

Previous topic - Next topic

Permaphrost

I haven't been seriously working with Visual Basic for too long. An application that I am working on requires a check to ensure that certain functions and/or information have not been altered. I am aware that a competent cracker could make such a check obsolete, but am still interested in including it. I would be capable of doing something like this in assembly, but am not sure how to approach it from a higher level language like VB.

Any thoughts?

Projects: GenesisStarcraft Drawing | Fear | pLoader  | CECP

TheMinistered

If you would be 'comfortable doing this from assembly' you should have all the knowledge you need (except for perhaps vb syntax?) to do this.  But, since I highly doubt you know how to even do this in assembly, i'll send you on you're right way!

You make your application read itself (i.e. readfile) then you should hash the buffer that contains the contents of application.  Then you compare the runtime-generated hash with a pregenerated hash of the file (you can store this in a global var or append it to the end of the file, etc)  If they don't match, there has been an altercation...

This method is fairly simple and easy to crack though

l2k-Shadow

you could also store parts of the pregenerated hash in different places and put all sorts of other funky stuff on the program... of course if a good cracker REALLY wanted to crack it, he would be able to overcome such things but it would confuse the hell out of him.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

topaz

CRC check, encrypting important functions, doing simple checks like If strData <> Decrypt(EncryptedstrData) Then End, and using executable packers would likely foil an amateur cracker.
RLY...?

Permaphrost

Quote from: TheMinistered on March 08, 2006, 03:54 PM
You make your application read itself (i.e. readfile) then you should hash the buffer that contains the contents of application.  Then you compare the runtime-generated hash with a pregenerated hash of the file (you can store this in a global var or append it to the end of the file, etc)  If they don't match, there has been an altercation...

This method is fairly simple and easy to crack though

Thank you.

Quote from: TheMinistered on March 08, 2006, 03:54 PM
But, since I highly doubt you know how to even do this in assembly

Why?  ;)

Projects: GenesisStarcraft Drawing | Fear | pLoader  | CECP

RealityRipple

Hi Mike! My suggestion would be, since you said you could do it in assembley, get a copy of visual c++ (you probably already have it, though), compile the vb EXE, run it, open the process list, find the exe, debug it, and add the check through there.

Permaphrost

Quote from: RealityRipple on March 08, 2006, 07:18 PM
Hi Mike! My suggestion would be, since you said you could do it in assembley, get a copy of visual c++ (you probably already have it, though), compile the vb EXE, run it, open the process list, find the exe, debug it, and add the check through there.

Thanks Andy. And hi.

Projects: GenesisStarcraft Drawing | Fear | pLoader  | CECP

RealityRipple

Hey, guess what? Your e-girlfriend is my e-girlfriend's best friend IRL. :D

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Permaphrost

Quote from: RealityRipple on March 08, 2006, 08:21 PM
Hey, guess what? Your e-girlfriend is my e-girlfriend's best friend IRL. :D

...

Projects: GenesisStarcraft Drawing | Fear | pLoader  | CECP

l2k-Shadow

Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Mystical

Quote from: RealityRipple on March 08, 2006, 08:21 PM
Hey, guess what? Your e-girlfriend is my e-girlfriend's best friend IRL. :D

LOL


btw... End is a bad way to end your program -_-

RealityRipple

Indeed... And On Error Resume Next is a bad way to handle errors.

Permaphrost

Well no dur. But it is a quick way of handling errors if you want to test the functionality of your program briefly.

Projects: GenesisStarcraft Drawing | Fear | pLoader  | CECP

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?