Sign in to follow this  
Followers 0
MvGulik

Obfuscated_SplitLineMerge

1 post in this topic

#1 ·  Posted (edited)

;; suggested filename: "SplitLineMerge.au3"
;; Just run(build) it on it self to test it. (SciTe4AutoIt3)
;; Generally tested. (possible rare exceptions ignored.)
;; ... Not intended to be used on none Obfuscated au3 files.

;; include these 3 lines in your source code. (with <foobar> parts adjusted to your situation.)
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/so
#AutoIt3Wrapper_Run_After=<Filespec_To_AutoIt3.exe, (not accepting quotes:?)> /AutoIt3ExecuteScript "<Path_To>\SplitLineMerge.au3" "%in%"

DebugOut('>Running: Obfuscated_SplitLineMerge,  CMD: ' & $CmdLineRaw)
If Not $CmdLine[0] Then DebugOut_Exit('!>No CmdLine input.', 1)
If Not IsFile($CmdLine[1]) Then DebugOut_Exit('!>Target source file not found.', 3)
_SplitLineMerge($CmdLine[1])
Exit

Func _SplitLineMerge($sFile_Au3)
    If StringRight($sFile_Au3, 4) <> '.au3' Then _
            DebugOut_Exit('!>Target file not a ".au3" file.', 4)

    Local $sFile_Source = StringTrimRight($sFile_Au3, 4) & '_Obfuscated.au3'
    If Not IsFile($sFile_Source) Then _
            DebugOut_Exit('!>Target "*_Obfuscated.au3" file not found.', 5)

    Local $sCode = FileRead($sFile_Source)
    $sCode = StringReplace($sCode, ' _' & @CRLF, ' ', 0, 2)
    Local $iCount = @extended

    Local $sFile_Target = StringTrimRight($sFile_Source, 4) & '_MergedSplitLines.au3'
    If FileExists($sFile_Target) And Not FileExists($sFile_Target & '\') And Not FileDelete($sFile_Target) Then _
            DebugOut_Exit('!>FileDelete "' & $sFile_Target & '" failed.', 6)
    If Not FileWrite($sFile_Target, $sCode) Then _
            DebugOut_Exit('!>FileWrite "' & $sFile_Target & '" failed.', 7)

    DebugOut('+>"' & $sFile_Target & '" file written, ' & $iCount & ' lines merged.')
EndFunc
Func IsFile($sFile)
    Return FileExists($sFile) And Not FileExists($sFile & '\')
EndFunc
;; ---
Func DebugOut($1, $2 = 'fOObAr')
    If Not ($2 == 'fOObAr') Then $1 &= ' = ' & String($2)
    Return ConsoleWrite($1 & @CRLF)
EndFunc
Func DebugOut_Exit($1, $2 = 0)
    ConsoleWrite($1 & @CRLF)
    Exit $2
EndFunc

(Edits: Title adjust, Title adjust 2, ...)

Edited by iEvKI3gv9Wrkd41u

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • careca
      By careca
      Hi, having an issue with an application i did, seems to crash randomly, and can take hours to do so.
      Simply says in the error msgbox:
      AutoIt Error
      Line 16392 (whatevermyapppath.exe)
      Error: The requested action with this object has failed.
       
      Recent changes to the script include this:
       
      ObjGet("winmgmts:\\localhost\root\CIMV2") $oSelect_active_network_cards = $objWMIService.ExecQuery('SELECT ProductName FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2 OR NetConnectionStatus = 9', "WQL") For $oSelect_active_network_card In $oSelect_active_network_cards $Adapter = $oSelect_active_network_card.ProductName Next Is the only thing i can see that can be related to an "object"
      This lines run only once at the top of the script.
      When i run the script itself and wait for a crash, it doesn't, or at least yet i didn't.
      What do you think this error could be?
      UPDATE: Runing the script eventually output this:
      "C:\script.au3" (894) : ==> The requested action with this object has failed.:
      $oNetwork_cards = $objWMIService.ExecQuery('SELECT BytesReceivedPerSec, BytesSentPerSec FROM Win32_PerfFormattedData_Tcpip_NetworkInterface WHERE name LIKE "' & $Adapter & '"', "WQL")
      $oNetwork_cards = $objWMIService^ ERROR
    • WoodGrain
      By WoodGrain
      Hi All,
      I'm using UseTraySetIcon("shell32.dll", xx) to set my tray icon to a specific icon while running, is there a way I can specify this icon when I compile my script into an exe so my exe icon is the same?
      Thanks!
    • argumentum
      By argumentum
      UDF to intercept the error window of AutoIt, showing more details about the error, including ability to save and send by email!
    • SkysLastChance
      By SkysLastChance
      I get this error, Whenever I try to find a date. Does anyone have any idea why? I saw some post from 2015, However I would imagine this is fixed by now. @water
      >"J:\Temporary Files\XXXXXXXXX\AutoIt\AutoIt\AutoIt\SciTe\..\autoit3.exe" /ErrorStdOut "C:\Users\XXXXXX\Desktop\Call Report Automation.au3"     "J:\Temporary Files\XXXXXXXX\AutoIt\AutoIt\AutoIt\Include\Excel.au3" (656) : ==> The requested action with this object has failed.: $aResult[$iIndex][1] = $oMatch.Name.Name $aResult[$iIndex][1] = $oMatch^ ERROR >Exit code: 1    Time: 5.791 #include <Excel.au3> Global $sExcelFile1 = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "(*.xlsm)") Global $sExcelFile2 = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "Excel Sheet (*.xlsx;*.xls)|All (*.*)") If FileExists($sExcelFile2) Then Global $oExcel2 = _Excel_Open () $oExcel2 = _Excel_BookOpen($oExcel2,$sExcelFile2) EndIF If FileExists($sExcelFile1) Then Global $oExcel1 = _Excel_Open () $oExcel1 = _Excel_BookOpen($oExcel1,$sExcelFile1,Default,Default,"2007") EndIF $oRead = _Excel_RangeRead ($oExcel2,Default,"A2",3) _Excel_RangeWrite ($oExcel1,"Calls Handled",$oRead,"BY7") Sleep (1000) _Excel_RangeFind ($oExcel1,$oRead,"E4:FD92") MsgBox (0,"Test",$oRead) UPDATE:
      If I take out this line it works. By works I mean I don't get the error. :/  However, I need it. I am just confused.
      _Excel_RangeWrite ($oExcel1,"Calls Handled",$oRead,"BY7")  
      UPDATE 2: I also get this error when trying to use the helpfile examples. I have version 3.3.14.2
      \AutoIt\AutoIt\AutoIt\Include\Excel.au3" (670) : ==> The requested action with this object has failed.: $oSheet = $oWorkbook.Sheets($iIndexSheets) $oSheet = $oWorkbook^ ERROR >Exit code: 1 Time: 0.8931  
    • SkysLastChance
      By SkysLastChance
      How would I go about writing a IF Then statement if the conrol send fails?
      Run ("Notepad.exe") WinWaitActive ("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "Edit1", ("Provider Practice Record")) I have been running into lag alot. So my script has been missing input. I would like to be able to have it retry to put in "Provider Practice Record" if it misses. 
      I am assuming  a if then statement is what I need but I am not sure what ControlSend will return if it tries to send to Edit1 and it is not there. 
      Or do I need to just add a timeout?