Page 1 of 2
Hidden text trick no longer works
Posted: Sat Jan 01, 2005 9:02 am
by PB
@Fred: This trick used to work, but doesn't work anymore with v3.92... is
there any way to do the same trick again (to hide text in a compiled exe)?
Code: Select all
; The text "hidden" should NOT appear in a hex editor.
a$=Chr('h')+Chr('i')+Chr('d')+Chr('d')+Chr('e')+Chr('n')
Posted: Sat Jan 01, 2005 11:16 am
by thefool
otherwise encrypt your text.
if you encrypt some text with the number 1 or 2 or so, you cant just
list it with a debugger.
Posted: Sat Jan 01, 2005 11:43 am
by blueznl
pb, that's called 'optimization'... it's what we all want... most of the time

Posted: Sat Jan 01, 2005 11:52 am
by PB
> otherwise encrypt your text
I know, but that was the easiest way to do it for non-important text.
I don't need to encrypt with 128-bit protection or RC4, etc -- just a quick
and easy way to stop casual snooping, and the Chr() method was perfect.
Now I have to write a procedure to decrypt the text.

Posted: Sat Jan 01, 2005 11:56 am
by thefool
look in the "Asprotect and purebasic" topic, i just posted a crackme.
In that i have made a small "Xor with password" procedure, you can just take that for simple protections. its rather fast and nearly doesnt use any space
edit:
for making it easier for you, i have cuttet it out for ya:
Code: Select all
Procedure.s dEnc(string.s,pass.s)
If string.s=""
ProcedureReturn ""
Else
For a=1 To Len(pass.s)
charval=Asc(Mid(pass.s,i,1))
myarr=myarr+charval
Next a
For i=1 To Len(string.s)
myenc=Asc(Mid(string.s,i,1)) ! myarr
mystr.s=mystr.s+Chr(myenc)
Next i
ProcedureReturn mystr
EndIf
EndProcedure
btw take a look at my crackme anyway..
Posted: Sat Jan 01, 2005 12:38 pm
by PB
> i have cuttet it out for ya
Thanks, but I'm really trying to avoid using a procedure.
I've found the following is a bit of a compromise...
Code: Select all
a$=Chr(Asc("h"))+Chr(Asc("i"))+Chr(Asc("d"))+Chr(Asc("d"))+Chr(Asc("e"))+Chr(Asc("n"))
...because in a hex viewer it appears as
h.i.d.e.n (with each
. representing
a 0-byte character; and note that it doesn't show both
d's, which is good).
At least this way you can't directly search the hex view for the word
hidden,
although you can visually see it if you scan the view with your eyes.
I'll come up with something.

Posted: Sat Jan 01, 2005 1:12 pm
by Pupil
Can't you just make an array with the characters in them and add them like you did with Chr()?
Posted: Sat Jan 01, 2005 1:30 pm
by thefool
but either way will be easly readden if i use ollydbg and views the memory of the program.. Or just another program. lot of them. But if you are using "Decrypt on demand" like in my crackme you need to execute the decryption first.. look at my crackme plz

Posted: Sat Jan 01, 2005 1:36 pm
by PB
> will be easly readden if i use ollydbg and views the memory of the program
I don't care about the memory being viewed; I only care about the exe itself.
Basically, it's just for hiding some text so nobody will casually notice that it's
there, like an Easter Egg. Using a procedure is too much hassle for what I'm
doing.

A simple one-liner like at the top of this thread is what I long for.
> look at my crackme plz
Okay, I will.

Re: Hidden text trick no longer works
Posted: Sat Jan 01, 2005 1:38 pm
by Psychophanta
PB wrote:@Fred: This trick used to work, but doesn't work anymore with v3.92... is
there any way to do the same trick again (to hide text in a compiled exe)?
Code: Select all
; The text "hidden" should NOT appear in a hex editor.
a$=Chr('h')+Chr('i')+Chr('d')+Chr('d')+Chr('e')+Chr('n')
Hi, don't complain. It seems a fixed bug

Posted: Sat Jan 01, 2005 1:44 pm
by thefool
hehe well actually if i really want to try get text out of an exe i use my trusted Ollydbg and not any hex editor.
i use a hex editor too, but only for other things..

thanks for looking at my cracke
@psycopanta: thats another way to look at it

Re: Hidden text trick no longer works
Posted: Sat Jan 01, 2005 1:57 pm
by PB
Psychophanta wrote:
It seems a fixed bug
It wasn't a bug, but an optimization (like blueznl said). I know this because
Fred used to have this done a different way originally, but then changed it.
Originally you'd use Chr(65)+Chr(66) etc, which would hide the text in the
compiled exe, but then a version of PureBasic made it visible again. So
Fred told me to use Chr('a')+Chr('b') instead, which again hid it, but now
v3.92 has it showing again.

Fred is playing cat-and-mouse with me.
TheFool wrote:
[to] get text out of an exe i use my trusted Ollydbg
It's not that I'm trying hard to disguise the text. It's mainly for safety
reasons, and Easter Eggs. For example, if the user clicks a web link, I
want it to open to a specific site, and not let the user change the URL by
editing the exe with a hex editor. As an Easter Egg example, I'm writing
an app that takes command arguments and I want some of these to be
unknown to the casual user (and not mentioned in my docs either).
Posted: Sat Jan 01, 2005 2:39 pm
by thefool
ah ok that way. i thought you wanted to really hide something so they couldnt see it
Posted: Sat Jan 01, 2005 3:03 pm
by Psychophanta
Aha! Sorry, I said nothing,

Posted: Sat Jan 01, 2005 5:25 pm
by Pupil
As i said earlier, do it like this, if you want to obscure the text:
Code: Select all
Dim Char.s(255)
Restore Characters
Read a$
For i = 1 To Len(a$)
b$ = Mid(a$, i, 1)
Char(Asc(b$)) = b$
Next
b$ = Char('H')+Char('e')+Char('l')+Char('l')+Char('o')
Debug b$
End
DataSection
Characters:
Data.s "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234546789"
EndDataSection