News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

rol

Started by ic2, November 06, 2006, 12:22:07 AM

Previous topic - Next topic

ic2

rol
I am trying to hide a DWORD value.  I know I can use a encryption tool and  known encrypt code but this is something i want to do before using anything else, if possible.  I been reading about encryption for about a week now.  Not the code but members opions and ideas.

At start up, I do something like this:

.Data

My_Value     dd  0 ; }‰"&  Value at start-up
                                   ; "&}‰ Unmarked New value

mov eax, My_Value

ror eax, 16


Latter when needed, I tried all kinds of ways similar to this.  All day long and never even stumbled on anything that would work:  I know this may not be correct but it may give you're a good idea of what im trying to do.  Masm32 help files are really great.  I never did rol before.  I just played with the basics.   That was really fun!!!

mov eax, My_Value

rol eax, 16


The funny thing is rol ( and most everything i tried) worked during start-up but NOT when i called on it  while the program was up and running, like at the click of a button...

Hope someone can help

Thanks in advance


sluggy

Quote from: ic2 on November 06, 2006, 12:22:07 AM
The funny thing is rol ( and most everything i tried) worked during start-up but NOT when i called on it  while the program was up and running, like at the click of a button...
I don't quite understand what your problem is here - at startup you are not doing a rol, you are doing a ror, maybe that is why the results are different. rol / ror are mnemonics, they work regardless of where you are in the application, so if it isn't working then check that the data you start with is correct, a different starting value will produce a different result.

And in the second piece of code, you are setting eax to a value, then partially overwriting it, doing the rol, then overwriting it completely before doing the call - either you haven't posted the correct (or all of the) code, or your code is real dodgy  :P

ic2

Hello sluggy

Thanks for the information.  I figure i must be doing something stupid .  The code is dodgy  Tongue

Well if im trying to hide code i guest sooooo  Tongue

I honestly just stripped it from my project where there were 20 ways i tried commented out and i just start pulling out stuff for the example and piece it togerther the best i could.  I been to hell trying. You know what i mean.  You don't want to ask but sometime you feel you have no choice.   Anyway, I need to hear what you told me, so back to the drawing board.  Im doing something wrong somewhere,

Thanks alot partner

ic2

sluggy, I got it running on my machine.  I fixed the code above,  I did'nt think it was that simple to code the same line latter to bring it back where it was.  I did the oppsite in a hundreds ways.  I been screwing up since yesterday morning trying to figure it out.  Now my app is a tiny bit more safe.

Thanks for the wake-up-call

sluggy

Quote from: ic2 on November 06, 2006, 04:25:29 AM
Thanks for the wake-up-call
No worries, i've done the same before myself - chopped up code, added and removed stuff, introduced an annoying bug only to find out later it was related to something stupid i did while carving up the code :U