Au3Encode加密前后的部分源代码(完整的贴不下)
_ScriptPretreatment($sPath, $Flag = 0, $EncodeMode = 512) ;脚本预处理
If $StopFlag = True Then Return SetError(1, 0, False)
If $Flag Then _GUICtrlListView_SetItemText($hTab3_ListView1, 1, '正在执行', 2)
If $LogFlag Then _Log('正在进行脚本预处理...')
Local $hFile = FileOpen($sPath)
Local $sSource = FileRead($hFile)
FileClose($hFile)
Local $TempLineStr = $sSource
Local $Pattern3 = '(?<!\r)\n' ;处理换行
Local $Pattern1 = '(' & "'|" & '")(.*?)(\1)' ;成对引号
Local $Pattern2 = '([\x1c|\x1d]+)(\x02\x22|\x02\x27)'
Local $Pattern4 = '(\[[^\[\],]*)(,)' ;中括号内的逗号替换为chr(1)
$TempLineStr = StringRegExpReplace($TempLineStr, $Pattern3, @CRLF)
$TempLineStr = StringReplace(StringReplace($TempLineStr, Chr(39) & Chr(39), Chr(29)), Chr(34) & Chr(34), Chr(28)) ;相邻双引号或单引号替换其它符号,为下步做准备
$TempLineStr = StringRegExpReplace($TempLineStr, $Pattern1, Chr(2) & '${1}${2}${3}' & Chr(3)) ;加入字符串起止标志
$TempLineStr = StringRegExpReplace($TempLineStr, $Pattern2, '${2}${1}') ;将起始标志前的成对相邻双引号或成对相邻单引号移动到起始标志后
Local $n = 0
Do
$n += 1
If $StopFlag = True Then Return SetError(1, 0, False)
$TempLineStr = StringRegExpReplace($TempLineStr, $Pattern4, '${1}' & Chr(1)) ;中括号内的逗号替换为chr(1)
Until @error = 0 And @extended = 0
Local $hFile = FileOpen($sPath, 2 + $EncodeMode)
FileWrite($hFile, $TempLineStr)
FileClose($hFile)
If $Flag Then _GUICtrlListView_SetItemText($hTab3_ListView1, 1, '已完成', 2)
EndFunc ;==>_ScriptPretreatment
Func _RemoveFromScript($sOutPath, $Flag = 0, $EncodeMode = 512)
If $StopFlag = True Then Return SetError(1, 0, False)
_FilePretreatment($sOutPath, $Flag, $EncodeMode, 0) ;去除注释
If $StopFlag = True Then Return SetError(1, 0, False)
_FilePretreatment($sOutPath, $Flag, $EncodeMode, 1) ;去除空行
If $StopFlag = True Then Return SetError(1, 0, False)
EndFunc ;==>_RemoveFromScript
Func _FilePretreatment($sInPutFilePath, $MFlag, $EncodeMode, $Flag)
If $StopFlag = True Then Return SetError(1, 0, False)
Local $hFile = FileOpen($sInPutFilePath)
Local $sStr = FileRead($hFile)
FileClose($hFile)
Switch $Flag
Case 0 ;去除注释
If $MFlag Then _GUICtrlListView_SetItemText($hTab3_ListView1, 2, '正在执行', 2)
If $LogFlag Then _Log('正在清除区域注释...')
GUICtrlSetData($Label1, '正在清除区域注释...')
Local $Pattern1 = '(?m)(?<=^)\h*;.*(\r\n)|(?<=^)\h*;.*' ;开头是";"的行去除
$sStr = StringRegExpReplace($sStr, $Pattern1, '')
Local $aRead = StringSplit($sStr, @CRLF, 1 + 2)
Local $Pattern2 = '(.*?)(\h*;.*)'
Local $Pattern3 = '\x02[^\x02\x03]+?\x03'
Local $Pattern4 = '(\.|\||\*|\?|\+|\(|\)|\{|\}|\[|\]|\^|\$|\\)'
Local $Pattern5 = '(?s)(?i)(?:\r?\n\h*#cs|\r?\n\h*#comments-start).+?(?:(?:\r?\n\h*#cs|\r?\n\h*#comments-start).+?(?:\r?\n\h*#ce|\r?\n\h*#comments-end))*(?:\s*(?:\r?\n\h*#ce|\r?\n\h*#comments-end))+[^\r\n]*\r?\n' ;区域注释
Local $CountLine = UBound($aRead)
For $i = 0 To UBound($aRead) - 1
If $StopFlag = True Then Return SetError(1, 0, False)
Local $TempLineStr = $aRead[$i], $TempStr, $SerchStr = ''
If StringRegExp($TempLineStr, $Pattern3) Then
$TempLineStr = StringRegExpReplace($TempLineStr, $Pattern4, '\\${1}') ;转义特殊字符
$TempLineStr = StringRegExpReplace($TempLineStr, $Pattern3, '\\x02.+?\\x03') ;替换为表达式
$SerchStr = StringRegExpReplace($TempLineStr, $Pattern2, '${2}')
If @extended Then $aRead[$i] = StringRegExpReplace($aRead[$i], $SerchStr, '')
Else
$SerchStr = StringRegExpReplace($aRead[$i], $Pattern2, '${2}')
If @extended Then $aRead[$i] = StringReplace($aRead[$i], $SerchStr, '', -1, 1)
EndIf
If $MFlag And Mod($i, 50) = 0 Then _GUICtrlListView_SetItemText($hTab3_ListView1, 2, '已完成' & Chr(32) & $i & '/' & $CountLine, 2)
Next
$hFile = FileOpen($sInPutFilePath, 2 + $EncodeMode)
FileWriteLine($hFile, $sHead)
For $i = 0 To UBound($aRead) - 1
FileWriteLine($hFile, $aRead[$i])
Next
FileClose($hFile)
_GUICtrlListView_SetItemText($hTab3_ListView1, 2, '正在清除区域注释...', 2)
Local $hFile = FileOpen($sInPutFilePath)
Local $sStr = FileRead($hFile)
FileClose($hFile)
$sStr = StringRegExpReplace(@CRLF & $sStr, $Pattern5, @CRLF)
$hFile = FileOpen($sInPutFilePath, 2 + $EncodeMode)
FileWrite($hFile, $sStr)
FileClose($hFile)
If $MFlag Then _GUICtrlListView_SetItemText($hTab3_ListView1, 2, '已完成', 2)
GUICtrlSetData($Label1, '清除完成...')
Case 1 ;去除空行
If $MFlag Then _GUICtrlListView_SetItemText($hTab3_ListView1, 3, '正在执行', 2)
If $LogFlag Then _Log('正在清除空行及行首行未空白字符...')
GUICtrlSetData($Label1, '正在清除空行及行首行未空白字符...')
Local $Pattern1 = '(?m)(?<=^)\h*(.+)'
Local $Pattern2 = '(?<!\r)\n' ;处理换行
Local $Pattern3 = '\r\n(?=\r\n)|\r\n$'
Local $Pattern4 = '^\r\n'
$sStr = StringRegExpReplace($sStr, $Pattern1, '${1}') ;删除行首空白符
$sStr = StringRegExpReplace($sStr, $Pattern2, @CRLF)
$sStr = StringRegExpReplace(@CRLF & $sStr, $Pattern3, '') ;删除空行
$sStr = StringRegExpReplace($sStr, $Pattern4, '') ;删除空行
$hFile = FileOpen($sInPutFilePath, 2 + $EncodeMode)
FileWrite($hFile, $sStr)
FileClose($hFile)
If $MFlag Then _GUICtrlListView_SetItemText($hTab3_ListView1, 3, '已完成', 2)
GUICtrlSetData($Label1, '清除完成...')
EndSwitch
EndFunc ;==>_FilePretreatment
Func Q7CEL390V4Q7($LU5ALT1X896P, $C16T39UZ4E28 = $Z748J708YCQ9, $N9040N00EWSR = $GHF59PQ7I82I)
If $D0O373W558MQ = True Then Return SetError($N5P5YST7S73K, $KGL4N810697Z, False)
If $C16T39UZ4E28 Then G0LLUZKLCJ38($LJ8JURHU0VR2, $U8QQ84835QG5, JTJ889124807($LH5QOQO9U9ID, $T79H44QCE75S), $ZP8DGM021IL1)
If $OVX4P22S42D1 Then KD7S7W4V2EG8(JTJ889124807($QB31P1F3H704, $WZ396KO8L556))
Local $C5ARS6TFOJH4 = FileOpen($LU5ALT1X896P)
Local $AYA87RW80S9P = FileRead($C5ARS6TFOJH4)
FileClose($C5ARS6TFOJH4)
Local $VU0C0CHG3PV8 = $AYA87RW80S9P
Local $AZ1376T49Q7G = $O62NS1T65217
Local $UM5A72U7ZZ58 = $C804TXU547U4 & $RL9BAH0K3520 & $M1284C9RCT26
Local $U9E547DIG8SG = $GP1MWN44J42F
Local $C98PC6015685 = $GQFL0N9Z4V78
$VU0C0CHG3PV8 = StringRegExpReplace($VU0C0CHG3PV8, $AZ1376T49Q7G, @CRLF)
$VU0C0CHG3PV8 = StringReplace(StringReplace($VU0C0CHG3PV8, Chr($M2E08793UL8G) & Chr($CMWA8NN1SGYN), Chr($JN4AN41GMC43)), Chr($D53CEVCLK7N6) & Chr($SPJ4MO9508S1), Chr($MV0D5BCN2US7))
$VU0C0CHG3PV8 = StringRegExpReplace($VU0C0CHG3PV8, $UM5A72U7ZZ58, Chr($SV39HCW3K636) & $T96KP7J3OE4A & Chr($JJ34F1IS70RA))
$VU0C0CHG3PV8 = StringRegExpReplace($VU0C0CHG3PV8, $U9E547DIG8SG, $XAGY21PZ5414)
Local $ST8H68U9265I = $MR9LIQ30BVKC
Do
$ST8H68U9265I += $HJE56PXDUU87
If $D0O373W558MQ = True Then Return SetError($I02YRW7TJ5WO, $YCN0TH9K5YWT, False)
$VU0C0CHG3PV8 = StringRegExpReplace($VU0C0CHG3PV8, $C98PC6015685, $I0VA5P45F545 & Chr($HOL46HNK272N))
Until @error = $ZD7REJ21BOJ6 And @extended = $PY3C0MISONX2
Local $C5ARS6TFOJH4 = FileOpen($LU5ALT1X896P, $G9NKW354VW92 + $N9040N00EWSR)
FileWrite($C5ARS6TFOJH4, $VU0C0CHG3PV8)
FileClose($C5ARS6TFOJH4)
If $C16T39UZ4E28 Then G0LLUZKLCJ38($LJ8JURHU0VR2, $F582YY4LQMU7, JTJ889124807($K8R063W7V312, $B3QL174G6MG7), $YFQH62FTX9C3)
EndFunc
Func W2X4K03Z0JW1($HF7R0P06IMJ9, $C16T39UZ4E28 = $F34KLHJ77472, $N9040N00EWSR = $S0985PG11Y87)
If $D0O373W558MQ = True Then Return SetError($RJ537ETL606K, $D57P8VCN24KC, False)
HX7MVMU9I3H6($HF7R0P06IMJ9, $C16T39UZ4E28, $N9040N00EWSR, $GITX67UD9418)
If $D0O373W558MQ = True Then Return SetError($CTT6MH479DZ1, $D34H4844H96S, False)
HX7MVMU9I3H6($HF7R0P06IMJ9, $C16T39UZ4E28, $N9040N00EWSR, $WV1DK7268422)
If $D0O373W558MQ = True Then Return SetError($A1B8Z2B03652, $NH71EJD0BRHM, False)
EndFunc
Func HX7MVMU9I3H6($JSMP5Q0NE59D, $AKED27MRMQJW, $N9040N00EWSR, $C16T39UZ4E28)
If $D0O373W558MQ = True Then Return SetError($I58G4Y8AUX6E, $PN18ZNG74O94, False)
Local $C5ARS6TFOJH4 = FileOpen($JSMP5Q0NE59D)
Local $FT49HPUCG1AN = FileRead($C5ARS6TFOJH4)
FileClose($C5ARS6TFOJH4)
Switch $C16T39UZ4E28
Case $YY1RI54L0147
If $AKED27MRMQJW Then G0LLUZKLCJ38($LJ8JURHU0VR2, $C4E592QCZ64U, JTJ889124807($C1691NCFV5Z3, $GA97N3906ZHY), $WL69208A61TV)
If $OVX4P22S42D1 Then KD7S7W4V2EG8(JTJ889124807($DBK41DPQU820, $ECZSR6XIAXD9))
GUICtrlSetData($B0U55BS2K5NB, JTJ889124807($N4M3TMHBKQ6R, $F7Z77155N926))
Local $UM5A72U7ZZ58 = $ZYN20VH0EUN8
$FT49HPUCG1AN = StringRegExpReplace($FT49HPUCG1AN, $UM5A72U7ZZ58, '')
Local $O6IRK929IC69 = StringSplit($FT49HPUCG1AN, @CRLF, $D087R1W5F460 + $BFXU0BJ4RTM4)
Local $U9E547DIG8SG = $AN3E6BI3W687
Local $AZ1376T49Q7G = $DWM7X550X816
Local $C98PC6015685 = $P1404V5F4675
Local $Y025Z1X0AU90 = $I5C914OH5TWU
Local $PG4521UQP650 = UBound($O6IRK929IC69)
For $N860MYZZ0Z8H = $NI0Z9XJFE6A6 To UBound($O6IRK929IC69) - $W520WK3R31X2
If $D0O373W558MQ = True Then Return SetError($VJY9O00B82UU, $AM1Z484C802G, False)
Local $VU0C0CHG3PV8 = $O6IRK929IC69[$N860MYZZ0Z8H], $NKRY16787ND8, $ECT2ABTXZ9Q1 = ''
If StringRegExp($VU0C0CHG3PV8, $AZ1376T49Q7G) Then
$VU0C0CHG3PV8 = StringRegExpReplace($VU0C0CHG3PV8, $C98PC6015685, $BR57VIFKAOP4)
$VU0C0CHG3PV8 = StringRegExpReplace($VU0C0CHG3PV8, $AZ1376T49Q7G, $KO197VS3ZFKW)
$ECT2ABTXZ9Q1 = StringRegExpReplace($VU0C0CHG3PV8, $U9E547DIG8SG, $ZJKJG4AYBMY6)
If @extended Then $O6IRK929IC69[$N860MYZZ0Z8H] = StringRegExpReplace($O6IRK929IC69[$N860MYZZ0Z8H], $ECT2ABTXZ9Q1, '')
Else
$ECT2ABTXZ9Q1 = StringRegExpReplace($O6IRK929IC69[$N860MYZZ0Z8H], $U9E547DIG8SG, $HEI88G68TWN8)
If @extended Then $O6IRK929IC69[$N860MYZZ0Z8H] = StringReplace($O6IRK929IC69[$N860MYZZ0Z8H], $ECT2ABTXZ9Q1, '', -$M7M47L2MR6Y3, $H1CF2WU2BX9M)
EndIf
If $AKED27MRMQJW And Mod($N860MYZZ0Z8H, $O0V3X6I86ZW9) = $IHSUD56OCO42 Then G0LLUZKLCJ38($LJ8JURHU0VR2, $BVE8E09WCGY3, JTJ889124807($V3C7GZGK45V5, $HDNK658N6A71) & Chr($UE9W4M8Q2558) & $N860MYZZ0Z8H & $VQ9JGC266KS0 & $PG4521UQP650, $NQTPJM1XW6O9)
Next
$C5ARS6TFOJH4 = FileOpen($JSMP5Q0NE59D, $KRBHWDT3MQY4 + $N9040N00EWSR)
FileWriteLine($C5ARS6TFOJH4, $S6P8643SO6PE)
For $N860MYZZ0Z8H = $J77Z3U58LS6K To UBound($O6IRK929IC69) - $GHU2F10QI0F8
FileWriteLine($C5ARS6TFOJH4, $O6IRK929IC69[$N860MYZZ0Z8H])
Next
FileClose($C5ARS6TFOJH4)
G0LLUZKLCJ38($LJ8JURHU0VR2, $Y68331G927V7, JTJ889124807($R1A92S7T18U2, $A8F172603845), $G37E5C168A16)
Local $C5ARS6TFOJH4 = FileOpen($JSMP5Q0NE59D)
Local $FT49HPUCG1AN = FileRead($C5ARS6TFOJH4)
FileClose($C5ARS6TFOJH4)
$FT49HPUCG1AN = StringRegExpReplace(@CRLF & $FT49HPUCG1AN, $Y025Z1X0AU90, @CRLF)
$C5ARS6TFOJH4 = FileOpen($JSMP5Q0NE59D, $CVDE8498H5LV + $N9040N00EWSR)
FileWrite($C5ARS6TFOJH4, $FT49HPUCG1AN)
FileClose($C5ARS6TFOJH4)
If $AKED27MRMQJW Then G0LLUZKLCJ38($LJ8JURHU0VR2, $U1A1I70OE782, JTJ889124807($C348GTZ2E4YQ, $V24BN0E1PN1H), $KTFX7A4K243N)
GUICtrlSetData($B0U55BS2K5NB, JTJ889124807($WS4354DZX7IU, $EQ2104VK5701))
Case $KI8176FZ01BE
If $AKED27MRMQJW Then G0LLUZKLCJ38($LJ8JURHU0VR2, $U326708U77EA, JTJ889124807($A5YVN6QU4635, $J593B1WT8229), $U7PQ0E2KY1N2)
If $OVX4P22S42D1 Then KD7S7W4V2EG8(JTJ889124807($GEA9BT2C55O5, $G7D1QI410M69))
GUICtrlSetData($B0U55BS2K5NB, JTJ889124807($MA5698L8TLNY, $A0FR9UYI6X5X))
Local $UM5A72U7ZZ58 = $T56FO8Z08754
Local $U9E547DIG8SG = $H7607XW4S79X
Local $AZ1376T49Q7G = $UN285K6AO6N3
Local $C98PC6015685 = $SIH7HK5SLGP2
$FT49HPUCG1AN = StringRegExpReplace($FT49HPUCG1AN, $UM5A72U7ZZ58, $K8NQEGL39L9E)
$FT49HPUCG1AN = StringRegExpReplace($FT49HPUCG1AN, $U9E547DIG8SG, @CRLF)
$FT49HPUCG1AN = StringRegExpReplace(@CRLF & $FT49HPUCG1AN, $AZ1376T49Q7G, '')
$FT49HPUCG1AN = StringRegExpReplace($FT49HPUCG1AN, $C98PC6015685, '')
$C5ARS6TFOJH4 = FileOpen($JSMP5Q0NE59D, $O78HA8RVFF52 + $N9040N00EWSR)
FileWrite($C5ARS6TFOJH4, $FT49HPUCG1AN)
FileClose($C5ARS6TFOJH4)
If $AKED27MRMQJW Then G0LLUZKLCJ38($LJ8JURHU0VR2, $OH0ZR770L276, JTJ889124807($I73FU534GY09, $LA27AZIEBP0Y), $Y749301X6047)
GUICtrlSetData($B0U55BS2K5NB, JTJ889124807($W40E45BBUA08, $X1TYKJ3O68ER))
EndSwitch
EndFunc
|