Jump to content

Obfuscator (discontinued)


Jos
 Share

Recommended Posts

  • Developers

Hello Jos,

just downloaded and installed the latest SciTE version. Now I have a problem related to obfuscator I hadnt before :).

Following example was obfuscated with Obfuscator build on 2008-Dec-08 (1.0.25?) without any problems. The new build of Obfuscator doesn't work anymore.

Thanks for you efforts!

Found the issue. This is was a clear case of fixing one thing and breaking another :party:

Please try the current Beta v 1.0.26.13 available to see if that fixes it also for you.

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

Link to comment
Share on other sites

This script causes errors-

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=0 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1

If $CmdLine[0] <> 0 Then ConsoleWrite("argh" & @CRLF)

Errors-

C:\Users\Erik\Desktop\test_Obfuscated.au3(1,41) : WARNING: $Os: possibly used before declaration.

global $A2A00304415=A5000202637($Os[0x1])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Users\Erik\Desktop\test_Obfuscated.au3(1,41) : ERROR: $Os: undeclared global variable.

global $A2A00304415=A5000202637($Os[0x1])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Users\Erik\Desktop\test_Obfuscated.au3(1,41) : ERROR: A5000202637(): undefined function.

global $A2A00304415=A5000202637($Os[0x1])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

The errors do not occurr if I change either /cs=1 or /cn=0. I found this by accident cause /cs=1 was tripping my antivirus. Edited by wraithdu
Link to comment
Share on other sites

  • Developers

This script causes errors-

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=0 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1

If $CmdLine[0] <> 0 Then ConsoleWrite("argh" & @CRLF)

Errors-

The errors do not occurr if I change either /cs=1 or /cn=0. I found this by accident cause /cs=1 was tripping my antivirus.

Fixed in the version 1.0.26.14 available in the Beta directory.

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

  • 2 weeks later...

I'm having a problem with the obfuscator. It gives me the following error message.

### Obfuscation Error: Found Call() statement using unsolvable Func, which will/could lead to problems running your obfuscated script.

>### current Func: Reset_Defaults

H:\settings\Settings.au3(65,1) Warning for line:Call($arrFunctions[$i][0])

I have been trying to troubleshoot this issue on my own for several weeks already, but have not been able to resolve it.

I've stripped my script down to a bare minimum for you to have a look.

#removed

The script compiles and functions fine if I choose to ignore the error message but I'd rather deal with it than ignore it.

Please offer some advice to avoid the error message.

Edited by Shark007
Link to comment
Share on other sites

I'm assuming Obsfuscator already has code in it that builds a list of all referenced variables within a script so that the /StripOnly function will know which chunks of #includes can be omitted.

I find, after going through multiple revisions of a large script, that I'll end up with some user-defined variables that are now no longer referenced within the script. Would it be difficult to enable obfuscator to remove, or at least list, unreferenced user-defined variables? It is a pain-in-the-rear to manually do cleanup by reviewing all dim/local/global statements and doing searches on every variable to see if they are being used.

Thanks.

Link to comment
Share on other sites

  • Moderators

I'm assuming Obsfuscator already has code in it that builds a list of all referenced variables within a script so that the /StripOnly function will know which chunks of #includes can be omitted.

I find, after going through multiple revisions of a large script, that I'll end up with some user-defined variables that are now no longer referenced within the script. Would it be difficult to enable obfuscator to remove, or at least list, unreferenced user-defined variables? It is a pain-in-the-rear to manually do cleanup by reviewing all dim/local/global statements and doing searches on every variable to see if they are being used.

Thanks.

If you're using full SciTe - Put this at the top:
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'm a relative noob when it comes to AutoIt scripting.

My original script is almost 1300 lines which I stripped down to what is posted here so that I could demonstrate the error.

I do not yet have the skills to solve this issue on my own.

Is there anything I could do to sidestep this error from manifesting itself during obfuscation?

EDIT: Just saw the post from SmOke_N... will try it.

Nope, adding SmOke_N suggestion to the script caused multiple errors.

Edited by Shark007
Link to comment
Share on other sites

@Shark007

No. Did you read the post linked by KaFu? Obfuscator cannot obfuscate a Call() to a function in a variable. There is no way for Obfuscator to know what the name of the function is at runtime. It still works when compiled because the variable / array is valid, and presumably the string translates correctly during runtime to the function name. This will likely not always be the case. You'll have to live with the error during obfuscation.

Edited by wraithdu
Link to comment
Share on other sites

bug:

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/Convert_Strings=0 /Convert_Numerics=1 /showconsoleinfo=1 /Beta
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

$ni = Execute("1+1")
MsgBox(0, "", $ni)

Essayez de compiler ce script avec options.

Si on fait juste Obfuscator cela donne:

global $A6100204D51=A6100000434($Os[0x1])
$A2400105442 = Execute("1+1")
MsgBox(Number($A6100204D51), "", $A2400105442)

Obfuscator utilise la fonction A6100000434() qui n'existe pas .... hum BUG !

Edited by terminatorn
Link to comment
Share on other sites

  • Moderators

terminatorn,

Il n'y a pas de bug.

Obfuscator te previens que tu risques avoir un probleme parcequ'il y a un statement "Execute" - c'est normal. Mais si tu continue, la compilation passe sans probleme et le fichier executable marche parfaitement.

Le script apres compilation n'est pas pour les yeux des humains - c'est le principe d'Obfuscation de rendre le script quasiment illisible!

M23

Trans:

There is no bug.

Obfuscator warns you of a possible problem because of the "Execute" statement - this is normal. But if you ignore this, the compile process completes without problems and the .exe works perfectly.

The obfuscated script is not for human eyes - the whole point of Obfuscator is to render the script unreadable!

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

im a little confused, i have variables that i need to prevent from being removed but i dont understand how, and i thought that #Obfuscator_Off would do the trick for the section of variables, but it prevents the section from being included, instead of just including it "as is"

update: could i be seeing a bug? when i look at the _Obfuscated source i still has the #Obfuscator_Off and #Obfuscator_On directives shown, and the code in the middle was infact included, but still obfuscated

Edited by JohnMC
Link to comment
Share on other sites

  • Developers

im a little confused, i have variables that i need to prevent from being removed but i dont understand how, and i thought that #Obfuscator_Off would do the trick for the section of variables, but it prevents the section from being included, instead of just including it "as is"

update: could i be seeing a bug? when i look at the _Obfuscated source i still has the #Obfuscator_Off and #Obfuscator_On directives shown, and the code in the middle was infact included, but still obfuscated

Show me a example short scriptlet that shows what you mean.

Also indicate the used Obfuscator version.

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

Show me a example short scriptlet that shows what you mean.

Also indicate the used Obfuscator version.

Jos

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

;Obfuscator 1.0.26.13

#Obfuscator_off
Global  $OPTION_1_SHORT="HOST"
Global  $OPTION_HOST=""
Global  $OPTION_2_SHORT="PORT"
Global  $OPTION_PORT="5500"
#Obfuscator_on
msgbox(0,"Test",Eval("OPTION_PORT"))

produces:

#Obfuscator_off
#Obfuscator_on
msgbox(0,"Test",Eval("OPTION_PORT"))

i know this example doesnt explain why im using eval, but id rather make the compiler work for what i need then re structure my program, i hope im not just being a noob here, sorry if i am :D

Link to comment
Share on other sites

  • Developers

I understand why this examples doesn't work, but am wondering why you are putting the #Obfuscator_off & #Obfuscator_on in there.

Take them out and you will see it works perfectly.

This is what is happening: The lines between #Obfuscator_off/on are not processed thus the variables in there are not put into the available Variables table. Then when the Eval() statement is encounter, obfuscator checks the table for variable $OPTION_PORT which isn't in the table and thus they are all stripped.

I understand that one could expect that the stripping is not performed between the #Obfuscator_off/on and will see if that should be changed, but these directives were introduced to stop Obfuscator to "translate/obfuscate" these lines.

EDIT: Uploaded a new Obfuscator version to the Beta download area which will skip stripping any line between these directives.

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

I understand why this examples doesn't work, but am wondering why you are putting the #Obfuscator_off & #Obfuscator_on in there.

Take them out and you will see it works perfectly.

This is what is happening: The lines between #Obfuscator_off/on are not processed thus the variables in there are not put into the available Variables table. Then when the Eval() statement is encounter, obfuscator checks the table for variable $OPTION_PORT which isn't in the table and thus they are all stripped.

I understand that one could expect that the stripping is not performed between the #Obfuscator_off/on and will see if that should be changed, but these directives were introduced to stop Obfuscator to "translate/obfuscate" these lines.

EDIT: Uploaded a new Obfuscator version to the Beta download area which will skip stripping any line between these directives.

Jos

very awesome, it would of been tough to explain my real use of eval, but basicly the obfuscator wouldnt of had anyway to get a variable because the variable string was variables that were initialized at runtime, this is great! thankyou very much!

Link to comment
Share on other sites

I start testing and me Obfuscator so I am newbie ..

I start a exemple with this code ....

#include <GuiConstants.au3>

; GUI
GuiCreate("Sample GUI", 400, 400)
GuiSetIcon(@SystemDir & "\mspaint.exe", 0)


; MENU
GuiCtrlCreateMenu("Menu&One")
GuiCtrlCreateMenu("Menu&Two")
GuiCtrlCreateMenu("MenuTh&ree")
GuiCtrlCreateMenu("Menu&Four")

; CONTEXT MENU
$contextMenu = GuiCtrlCreateContextMenu()
GuiCtrlCreateMenuItem("Context Menu", $contextMenu)
GuiCtrlCreateMenuItem("", $contextMenu);separator
GuiCtrlCreateMenuItem("&Properties", $contextMenu)

; PIC
GuiCtrlCreatePic("logo4.gif",0,0, 169,68)
GuiCtrlCreateLabel("Sample pic", 75, 1, 53, 15)
GuiCtrlSetColor(-1,0xffffff)


; AVI
GuiCtrlCreateAvi("sampleAVI.avi",0, 180, 10, 32, 32, $ACS_AUTOPLAY)
GuiCtrlCreateLabel("Sample avi", 170, 50)


; TAB
GuiCtrlCreateTab(240, 0, 150, 70)
GuiCtrlCreateTabItem("One")
GuiCtrlCreateLabel("Sample Tab with tabItems", 250, 40)
GuiCtrlCreateTabItem("Two")
GuiCtrlCreateTabItem("Three")
GuiCtrlCreateTabItem("")

; COMBO
GuiCtrlCreatecombo("Sample Combo", 250, 80, 120, 100)

; PROGRESS
GuiCtrlCreateProgress(60, 80, 150, 20)
GuiCtrlSetData(-1, 60)
GuiCtrlCreateLabel("Progress:", 5, 82)

; EDIT
GuiCtrlCreateEdit(@CRLF & "  Sample Edit Control", 10, 110, 150, 70)

; LIST
GuiCtrlCreateList("", 5, 190, 100, 90)
GuiCtrlSetData(-1, "a.Sample|b.List|c.Control|d.Here", "b.List")

; ICON
GuiCtrlCreateIcon("shell32.dll", 1, 175, 120)
GuiCtrlCreateLabel("Icon", 180, 160, 50, 20)

; LIST VIEW
$listView = GuiCtrlCreateListView("Sample|ListView|", 110, 190, 110, 80)
GuiCtrlCreateListViewItem("A|One", $listView)
GuiCtrlCreateListViewItem("B|Two", $listView)
GuiCtrlCreateListViewItem("C|Three", $listView)

; GROUP WITH RADIO BUTTONS
GuiCtrlCreateGroup("Sample Group", 230, 120)
GuiCtrlCreateRadio("Radio One", 250, 140, 80)
GuiCtrlSetState(-1, $GUI_CHECKED)
GuiCtrlCreateRadio("Radio Two", 250, 165, 80)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

; UPDOWN
GuiCtrlCreateLabel("UpDown", 350, 115)
GuiCtrlCreateInput("42", 350, 130, 40, 20)
GuiCtrlCreateUpDown(-1)

; LABEL
GuiCtrlCreateLabel("Green" & @CRLF & "Label", 350, 165, 40, 40)
GuiCtrlSetBkColor(-1, 0x00FF00)

; SLIDER
GuiCtrlCreateLabel("Slider:", 235, 215)
GuiCtrlCreateSlider(270, 210, 120, 30)
GuiCtrlSetData(-1, 30)

; INPUT
GuiCtrlCreateInput("Sample Input Box", 235, 255, 130, 20)

; DATE
GuiCtrlCreateDate("", 5, 280, 200, 20)
GuiCtrlCreateLabel("(Date control expands into a calendar)", 10, 305, 200, 20)

; BUTTON
GuiCtrlCreateButton("Sample Button", 10, 330, 100, 30)

; CHECKBOX
GuiCtrlCreateCheckbox("Checkbox", 130, 335, 80, 20)
GuiCtrlSetState(-1, $GUI_CHECKED)

; TREEVIEW ONE
$treeOne = GuiCtrlCreateTreeView(210, 290, 80, 80)
$treeItem = GuiCtrlCreateTreeViewItem("TreeView", $treeOne)
GuiCtrlCreateTreeViewItem("Item1", $treeItem)
GuiCtrlCreateTreeViewItem("Item2", $treeItem)
GuiCtrlCreateTreeViewItem("Foo", -1)
GuiCtrlSetState($treeItem, $GUI_EXPAND)

; TREEVIEW TWO
$treeTwo = GuiCtrlCreateTreeView(295, 290, 103, 80, $TVS_CHECKBOXES)
GuiCtrlCreateTreeViewItem("TreeView", $treeTwo)
GuiCtrlCreateTreeViewItem("With", $treeTwo)
GuiCtrlCreateTreeViewItem("tvs_checkboxes", $treeTwo)
GuiCtrlSetState(-1, $GUI_CHECKED)
GuiCtrlCreateTreeViewItem("Style", $treeTwo)


; GUI MESSAGE LOOP
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd

But the uotput Line I have "Can't open file c:\Documents and Settings\more\Desktop\" and can not obfucate the code .. where i mistake .?

And for another code that worck to obfuscate , when i compile to exe ,, and execute the exe she get me a Global$ var error and not worck the Program .....

Link to comment
Share on other sites

  • Developers

I start testing and me Obfuscator so I am newbie ..

I start a exemple with this code ....

But the uotput Line I have "Can't open file c:\Documents and Settings\more\Desktop\" and can not obfucate the code .. where i mistake .?

And for another code that worck to obfuscate , when i compile to exe ,, and execute the exe she get me a Global$ var error and not worck the Program .....

There are errors in this code. first test it by running it and make sure its error free before trying to Obfuscate it.

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...