Jump to content

Recommended Posts

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

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
×
×
  • Create New...