Jump to content

Obfuscator (discontinued)


Jos
 Share

Recommended Posts

What do you get when you run this

MsgBox(4096, "TEST", FileExists("C:\Program Files\AutoIt3\SciTE\Obfuscator\Obfuscator.Log"))

If it doesn't return 1 then try to create an empty Obfuscator.Log file first.

FileWrite("C:\Program Files\AutoIt3\SciTE\Obfuscator\Obfuscator.Log", "")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

What do you get when you run this

MsgBox(4096, "TEST", FileExists("C:\Program Files\AutoIt3\SciTE\Obfuscator\Obfuscator.Log"))

If it doesn't return 1 then try to create an empty Obfuscator.Log file first.

FileWrite("C:\Program Files\AutoIt3\SciTE\Obfuscator\Obfuscator.Log", "")
GeoSoft,

Thanks for your reply. I actually chuckled because your "thinking" shows you've been around these things we call computers for a while. :) Like you, I "know" how to determine, without doubt, if a file exists in a given directory, BUT, also like you I expect, I know better than to think I know FOR SURE. So, with intrigue, I did exactly as you suggested. The results were what we would expect. The first time, zero was returned. The FileWrite was successful -- I could see the file in Explorer and the second time the FileExists returned 1.

It's not a problem with the file system. In fact, since the days of FAT, I began to believe NTFS was impeccable -- until just a short while ago I managed to create a link (0.lnk) which I can't see (even with hidden files / show operating system files) and I can't delete. Moreover, Chkdsk does not even wince!

Back to Obfuscator -- I just would like to strip out all those globals and functions not used. I bang my head against the wall and try to tell myself it doesn't really matter -- but I guess it's just the old days haunting me of programming mainframe computers with 256K!

With large scripts (10,000 or more lines) the number of unused globals and functions becomes quite large (assuming such a script has depth of function, implying a large number of includes). The problem (for me anyway because I frequently programatically use the interpreted) is that the "stripping" programs I've seen on the forum operate on the file AFTER include processing. Therefore, they cannot distinguish a function in the original source from one in an AutoIt-provided include and provide the option of NOT stripping non-included functions (I have many functions which are only called via Call or Execute).

What I need is program that would strip only unused functions if included from the AutoIT include directory. Stripping unused Globals seems more straight-forward...

I mentioned all of this for three reasons: 1) in the future perhaps Jos may consider incorporating this functionality into Obfuscator, 2) I noted your post in the AutoItWrappers thread using regular expressions to return an array of all the functions in a program -- slick, and 3) to give you the opportunity to reply and tell me to stop fretting over 30 or 40K!!

Thanks again,

Paul

Link to comment
Share on other sites

Sounds like we may be almost in the same age group and from the same school.

GeoSoft,

3) to give you the opportunity to reply and tell me to stop fretting over 30 or 40K!!

Thanks again,

Paul

A search of my posts will show that I'm the wrong person to expect that from and if you don't find those there are a few experienced AutoIt scripters that can testify to my feelings in the subject of wasted bytes.

This started as a long post but I've removed the rest so we don't clutter Jos' thread too much. I'll PM it to you instead.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Developers

What I need is program that would strip only unused functions if included from the AutoIT include directory. Stripping unused Globals seems more straight-forward...

I mentioned all of this for three reasons: 1) in the future perhaps Jos may consider incorporating this functionality into Obfuscator, 2) I noted your post in the AutoItWrappers thread using regular expressions to return an array of all the functions in a program -- slick, and 3) to give you the opportunity to reply and tell me to stop fretting over 30 or 40K!!

Thats what Obfuscator does when you specify this directive:

#Obfuscator_Parameters=/striponly

You were going to send me your script so I can see if things work for me or not so we can determine if its just you having the problem? :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi Jos,

I need help. Is there anyway to customise the rename variable names function in obfuscator?

I mean eg.

$var1=testing999

$var2=testing777

I mean set the way obfuscator change the values testing999 and testing777 to obfuscator codes.

Currently using the latest autoit beta, scite and obfuscator beta.

Thanks.

Link to comment
Share on other sites

  • Developers

Hi Jos,

I need help. Is there anyway to customise the rename variable names function in obfuscator?

I mean eg.

$var1=testing999

$var2=testing777

I mean set the way obfuscator change the values testing999 and testing777 to obfuscator codes.

Currently using the latest autoit beta, scite and obfuscator beta.

Thanks.

Nope, they are randomly generated and to be honest I can't see any need for this as its purpose is the make it as unreadble as possible,

Why would you want this?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Because its readable. :)

Huh?

Am I correct you want to make an obfuscated script more readble?

Doesn't that defeat the sole purpose of Obfuscator?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Huh?

Am I correct you want to make an obfuscated script more readble?

Doesn't that defeat the sole purpose of Obfuscator?

I mean after obfuscation and compiled into exe.

If you google for a tool(Im not going to mention what tool, you should know). It manage to get to the real values of the variables.

But too bad, the most important part of my script were the values in the variables. :)

So if there is a way to change how the obfuscator scribble my variable values, it'll made my script more secure.

Thanks. :)

Link to comment
Share on other sites

  • Developers

I mean after obfuscation and compiled into exe.

If you google for a tool(Im not going to mention what tool, you should know). It manage to get to the real values of the variables.

But too bad, the most important part of my script were the values in the variables. :)

So if there is a way to change how the obfuscator scribble my variable values, it'll made my script more secure.

Thanks. :)

What ever I do, it will be possible to "partly" translate things back for the simple reason that the script still must be executed everytime it runs.

There is nothing that is going to change that.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

If you google for a tool(Im not going to mention what tool, you should know). It manage to get to the real values of the variables.

But too bad, the most important part of my script were the values in the variables. :)

So if there is a way to change how the obfuscator scribble my variable values, it'll made my script more secure. :)

@MyDream

An approach to consider would be to encrypt your variable values, that way the real value of the variables are only computed during program execution and are not stored "raw" in the exe.

At the end of the day if someone really wants to work out how your program works, it is virtually impossible to prevent that, but you can at least make it difficult.

VW

Link to comment
Share on other sites

What ever I do, it will be possible to "partly" translate things back for the simple reason that the script still must be executed everytime it runs.

There is nothing that is going to change that.

Awww. o:)

@MyDream

An approach to consider would be to encrypt your variable values, that way the real value of the variables are only computed during program execution and are not stored "raw" in the exe.

At the end of the day if someone really wants to work out how your program works, it is virtually impossible to prevent that, but you can at least make it difficult.

VW

Sorry, cant understand what you mean by that? :)

Any examples on how to do it?

Thanks. :)

Link to comment
Share on other sites

Sorry, cant understand what you mean by that? :)

If the value of some of the variables has meaning and you want to keep that value hidden or at least obscured, then rather than storing the value, calculate the value during the execution of your program.

You could encrypt your variables in advance and store them in a text file, and then decrypt the file when your script runs to retrieve the values using AES or some other form of encryption. Here is an example.

Alternatively you could use a simpler approach which would probably be just as effective for your purposes.

Say the value of important variable was 15.

Rather than

$Val = 15

Use

$Val = ((10 * 17) - 5 )/11

Same result, but in the second case the value of the variable is calculated during program execution.

VW

Link to comment
Share on other sites

  • Developers

This is not going to make it any more secure. Something similar is already done for you automatically by Obfuscator today, but you will always need the original "value" or "text" at the time the Function is performed.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 2 weeks later...

Is there any alternative my app refuses to run after obfuscation it has some object error.

I am using a couple adlibs would that affect this?

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

I'm not sure if this is a known problem, but it's a bit difficult to search/read through 24 pages of discussion for this particular problem (I did try searching for the word underscore), so I'll ask away. Hopefully, it hasn't already been brought up :o

Test()
Func Test()
    Local $a_
EndFunc

Place this in its own script file, and try obfuscating it with /StripOnly as the only option. You would expect that it doesn't do anything too particularly interesting to the file, but you'll find that it ends up stripping the entire function. What's the problem here? That the last line in the function (before EndFunc) ends with an underscore. But if you look at it, you'll find that it's a perfectly valid underscore. Obfuscator is stripping this function when it shouldn't be.

The above snippet is completely contrived -- obviously, my real script does more than that, but that's the source of my problem after a long investigation. It took forever to narrow it down to this, since the function that was stripped was buried deep inside several other function calls.

In my function, I was actually returning a variable whose name ends with an underscore. Now, I can easily fix this problem by either naming the variable differently, or simply wrapping the returned value in parentheses, but then I'd have to wonder: why is the Obfuscator even stripping perfectly valid code? :)

Edit: Also note that even if you set it so that the Obfuscator is supposed to only strip comments and whitespace (/CV=0 /CF=0 /CS=0 /CN=0), it decides to strip the function anyway. Essentially, it's doing more than it's told to do.

Edit: Hm, the problem was actually a bit worse than I described. It turns out the Obfuscator is wiping out all lines following the function until another function is declared. So something like:

Func Test1()
    Local $a_
EndFunc

MsgBox(0, "Hello 1", "Hello World")
MsgBox(0, "Hello 2", "Hello World")
MsgBox(0, "Hello 3", "Hello World")
MsgBox(0, "Hello 4", "Hello World")
MsgBox(0, "Hello 5", "Hello World")

Func Test2()
    MsgBox(0, "Test2", "5 messageboxes should have popped up before this")
EndFunc
Test2()
Test1()

When passed through Obfuscator using "/CV=0 /CF=0 /CS=0 /CN=0" as the options, ends up returning:

Func Test2()
MsgBox(0, "Test2", "5 messageboxes should have popped up before this")
EndFunc
Test2()
Test1()
Edited by -Ultima-

[ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ]

Link to comment
Share on other sites

  • Developers

I'm not sure if this is a known problem, but it's a bit difficult to search/read through 24 pages of discussion for this particular problem (I did try searching for the word underscore), so I'll ask away. Hopefully, it hasn't already been brought up :)

I have uploaded a updated version (v1.0.26.1) of Obfuscator to the Beta directory that fixes this false detection of a continuation line when a underscore is used at the end of a variable name.

Thanks!

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...