Jump to content

Recommended Posts

  • 3 weeks later...
Posted (edited)

My Input:

MsgBox(0, "", "lol""lol")
Global Enum Step -2 $e1var1, $e1var2 = 13, $e1var3

What I get:

global $A0D00103156=A5C00001342($Os[0x1]),$A2900202B1E=A5C00001342($Os[0x2]),$A4D00303A03=A5C00001342($Os[0x3]),$A5B00604555=A5C00001342($Os[0x4])
MsgBox(Number($A0D00103156), "", $A2900202B1E)
Global Enum Step -Number($A4D00303A03) $A3C00400532, $A0D00506036 = Number($A5B00604555), $A5400703D09

With .au3.tbl being the following:

203020[BAA43t6C6F6C22226C6F6C[BAA43t203220[BAA43t20313320[BAA43t

Which is equal to:

0 
lol""lol
 2 
 13

Note:

1. Numbers have a leading and trailing space

2. The string still has the double quote escaped (two times) although it won't get processed

3. The enum's stepvalue got replaced which is erroneous and should have already been fixed according to the changelog

Is it normal like this or am I doing something wrong?

I used the newest version available (1.0.29) by clicking it twice and selecting my file..

Edited by PieceOfIce
  • Developers
Posted

How did you get to the "Which is equal to:" results as the posted script doesn't produce that?

When I run this line in both original and obfuscated versions it produces the same result without any extra spaces:

MsgBox(0, "", "lol""lol")
MsgBox(0, "", "!" & 1 & "!")

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

Posted

out of the .tbl-file, just used some javascript to convert it back to ascii

e.g. the first entry is "203020" which is " 0 ", strangely padded with spaces

there is only one zero in the script means it's from "MsgBox(0,..." but there actually weren't any spaces therefore I wonder why it's padded, additionally they aren't of any need there, so they just waste some bytes ("203020" vs "30")..

When I run this line in both original and obfuscated versions it produces the same result without any extra spaces:

I don't quite understand..

I did it like this:

1. I saved my script which is like I wrote above in some .au3-file

2. I downloaded your obfuscator.zip

3. I executed it and selected my .au3-file

4. I compiled the outcoming Sample_Obfuscated.au3 with Aut2Exe

And when executing Sample_Obfuscated.exe I receive the following MessageBox:

---------------------------

---------------------------
lol""lol

(instead of >lol"lol<)

and afterwards this error:

---------------------------
AutoIt Error
---------------------------
Line 5  (File "C:\AutoIt\Sources\Obfuscator Test\Sample_Obfuscated.exe"):


Error: Badly formated Enum statement
  • 2 weeks later...
Posted

Hi Jos,

thanks again for this great tool, can't say it often enough :D .

But of course this is not the only reason why I post :oops:...

I'm obfuscating my tool SMF with the following switches: "/sf /sv /om /cs=0 /cn=0". I do this to speed up the overall script execution (just done a replace of all $ and had some 48.000 hits in my script). Looking at the obfuscated script itself I've noticed the following:

Variables always start with an "a" and have at least 3 characters => $aXX

Functions are always at least 4 characters long, underscore "_" being the first and the last one => _XX_

Would it be possible to implement an iteration through all valid characters for variables and functions? This would shorten up my script by a good and measurable amount. E.g. when $az is reached start over with $b1?

I did an iteration once myself. I've found no restrictions to rename a var to anything of the 37 elements long array, and the restrictions I've found for functions could be avoided with something like this ("pseudocode"):

Global $_BCaddlNums[37] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "_", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

Dim $aFuncs_Skip[24]=["do", "in","if","or","to","abs","and","asc","chr","cos","dec","dim","exp","for","hex","int","log","mod","not","opt","ptr","run","sin","tan"]

$sFuncsNew = _BasetoBase($i + $var_offset, 10, 37)

If Asc(StringLeft($sFuncsNew,1)) < 58 Or _StringInArray($sFuncsNew, $aFuncs_Skip) Then ; numbers are no good as first letter for functions

ContinueLoop

EndIf

Would be great if you could take a look into this how hard it would be to further optimize the /om switch :rip:...

Best Regards

  • 3 weeks later...
Posted

i'm using Yashied's HotKey 2.0b function which i really like, but i'm having problems when obfuscating my script (switches don't seem to matter)...

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: HK_WM_HOTKEY

ok, fine, so then i add...

#Obfuscator_Ignore_Funcs=HK_WM_HOTKEY

and i get the same warning as above, which, from what i've read here, is to be expected apparently, but my script is still broken (the hot-keys i set with _HotKey_Assign() don't work)

i also tried adding "_HotKey_Assign" and "_GUICtrlHKI_GetHotKey" as well as my entire function from which the hot-keys are set (a configuration UI) and the results are the same in that the hot-keys never work

all works fine without obfuscating, but i'd like to chop the output size ( i usually use /sf /sv /om /cs=0 /cn=0)

this is with Obfuscator 1.0.29.0 and i tried both with and without the /beta switch

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Posted

You could make a dummy call to that function at the start of the script. Just add HK_WM_HOTKEY() somewhere in the script and you won't have to worry about it being stripped. As long as this function returns immediately and you're not affecting anything by calling it randomly in the script, it should get rid of the issue.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

i don't understand why #Obfuscator_Ignore_Funcs=HK_WM_HOTKEY is not working though

the only "Call()'s" are in the "HK_WM_HOTKEY" func

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Posted (edited)

The problem is not where it's called, but what it calls... it calls $hkTb[$lParam][1], which is set in the function _HotKey_Assign() to $hkTb[$Index][1] = $sFunction... which is exactly the string I've already mentioned in the HotKey UDF post... e.g.:

_HotKey_Assign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') => #Obfuscator_Ignore_Funcs=Quit

Edited by KaFu
Posted

ok, now i got it working properly. i was ignoring the wrong funcs. thanks again KaFu

btw, i moved this here because i realized this an obfuscator issue and not a HotKey issue

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

  • Developers
Posted

Hi Jos,

thanks again for this great tool, can't say it often enough :D .

But of course this is not the only reason why I post :oops:...

I'm obfuscating my tool SMF with the following switches: "/sf /sv /om /cs=0 /cn=0". I do this to speed up the overall script execution (just done a replace of all $ and had some 48.000 hits in my script). Looking at the obfuscated script itself I've noticed the following:

Variables always start with an "a" and have at least 3 characters => $aXX

Functions are always at least 4 characters long, underscore "_" being the first and the last one => _XX_

Would it be possible to implement an iteration through all valid characters for variables and functions? This would shorten up my script by a good and measurable amount. E.g. when $az is reached start over with $b1?

Is there really so much gained by also changing the Func names?

Variables I can imagine the gain can be substantial having seen your project and I can have a look at that.

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

Posted (edited)

Is there really so much gained by also changing the Func names?

Variables I can imagine the gain can be substantial having seen your project and I can have a look at that.

Just did an obfuscation of my latest dev version ("/sf /sv /om /cs=0 /cn=0") and found 1.074 functions in the obfuscator.log to be replaced. It's quite hard to count all occurrences, but I assume them to be at least some 10.000. So the number is lower than for variables (not really surprising :oops: ), on the other hand vars in /om have a minimum length of 3, funcs of 4, so more potential there :rip:. Like you mentioned the total gain in size reduction and speed improvement is relative to the overall size of the project. Glad you took the request :D... Edited by KaFu
  • Developers
Posted (edited)

Have a go with the current Beta v1.0.29.4 It will create shorter Var and Func names and sequences them individually.

v1.0.29.4:
- Fixed issues with relative includes using .. in the filename.
- Changed the /OM variable length
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.
  :)

Posted
Posted

Same as well, I've seen a nice 5% decrease in filesize. Thanks Jos.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

  • Moderators
Posted

Jos,

Same 5% decrease here and no problems encountered so far. :D

Dank je wel. :oops:

M23

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

 

Posted (edited)

Edit:

The new obfuscator is crashing when the previous beta (1.0.29.3) does not.

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

Faulting application name: Obfuscator.exe, version: 1.0.29.4, time stamp: 0x4edbe7a4

Faulting module name: Obfuscator.exe, version: 1.0.29.4, time stamp: 0x4edbe7a4

Exception code: 0xc00000fd

Fault offset: 0x0000f227

Faulting process id: 0x1358

Faulting application start time: 0x01ccb431f36e0059

Faulting application path: C:Program Files (x86)AutoIt3SciTEObfuscatorObfuscator.exe

Faulting module path: C:Program Files (x86)AutoIt3SciTEObfuscatorObfuscator.exe

Report Id: 3208236f-2025-11e1-9b66-005056c00008

Edited by archrival
  • Developers
Posted

Edit:

The new obfuscator is crashing when the previous beta (1.0.29.3) does not.

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

could be, but i really need a script to replicate this unless you are telling me it always crashes.

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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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