#include <String.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUITab.au3>
#include <ButtonConstants.au3>
#include <MsgBoxConstants.au3>
#include <EditConstants.au3>
#include <GuiListView.au3>
#include <WinAPIProc.au3>
#include <Misc.au3>
#include <Crypt.au3>
AutoItSetOption("GUICloseOnESC", 0) ;1=ESC closes, 0=ESC won't close
Global Const $g_AppWndTitle = "AdobeGenP", $g_AppVersion = "Original version by uncia - CGP Community Edition Jakeified - v3.4.2"
If _Singleton($g_AppWndTitle, 1) = 0 Then
Exit
EndIf
Global $MyLVGroupIsExpanded = True
Global $fInterrupt = 0
Global $FilesToPatch[0][1], $FilesToPatchNull[0][1]
Global $FilesToRestore[0][1], $fFilesListed = 0
Global $MyhGUI, $hTab, $hMainTab, $hLogTab, $idMsg, $idListview, $g_idListview, $idButtonSearch, $idButtonStop
Global $idButtonCustomFolder, $idBtnCure, $idBtnDeselectAll, $ListViewSelectFlag = 1
Global $idBtnBlockPopUp, $idBtnRunasTI, $idMemo, $timestamp, $idLog, $idBtnRestore, $idBtnCopyLog, $idFindACC
Global $idEnableMD5, $idOnlyAdobeFolders, $idBtnSaveOptions, $idUseCustomDomains, $idCustomDomainsInput
Global $hPopupTab, $idBtnDestroyAGS, $idBtnEditHosts, $idLabelEditHosts, $sEditHostsText, $idBtnRestoreHosts
Global $sDestroyAGSText, $idLabelDestroyAGS, $sCleanFirewallText, $idLabelCleanFirewall, $idBtnCleanFirewall, $idBtnOpenWF, $idBtnEnableDisableWF
Global $sINIPath = @ScriptDir & "\config.ini"
If Not FileExists($sINIPath) Then
FileInstall("config.ini", @ScriptDir & "\config.ini")
EndIf
Global $MyDefPath = IniRead($sINIPath, "Default", "Path", "C:\Program Files")
If Not FileExists($MyDefPath) Or Not StringInStr(FileGetAttrib($MyDefPath), "D") Then
IniWrite($sINIPath, "Default", "Path", "C:\Program Files")
$MyDefPath = "C:\Program Files"
EndIf
If (@UserName = "SYSTEM") Then
FileDelete(@WindowsDir & "\Temp\RunAsTI.exe")
EndIf
Global $MyRegExpGlobalPatternSearchCount = 0, $Count = 0, $idProgressBar
Global $aOutHexGlobalArray[0], $aNullArray[0], $aInHexArray[0]
Global $MyFileToParse = "", $MyFileToParsSweatPea = "", $MyFileToParseEaclient = ""
Global $sz_type, $bFoundAcro32 = False, $aSpecialFiles, $sSpecialFiles = "|"
Global $ProgressFileCountScale, $FileSearchedCount
Global $bFindACC = IniRead($sINIPath, "Options", "FindACC", "1")
Global $bEnableMD5 = IniRead($sINIPath, "Options", "EnableMD5", "1")
Global $bOnlyAdobeFolders = IniRead($sINIPath, "Options", "OnlyAdobeFolder", "1")
Global $bUseCustomDomains = IniRead($sINIPath, "Options", "UseCustomDomains", "0")
Global $sCustomDomains = IniRead($sINIPath, "Options", "CustomDomains", "'8eptecerpq.adobestats.io','xa8g202i4u.adobestats.io'")
If $sCustomDomains = "" Then
IniWrite($sINIPath, "Options", "CustomDomains", "'8eptecerpq.adobestats.io','xa8g202i4u.adobestats.io'")
$sCustomDomains = "'8eptecerpq.adobestats.io','xa8g202i4u.adobestats.io'"
EndIf
Local $tTargetFileList_Adobe = IniReadSection($sINIPath, "TargetFiles")
Global $TargetFileList_Adobe[0]
If Not @error Then
ReDim $TargetFileList_Adobe[$tTargetFileList_Adobe[0][0]]
For $i = 1 To $tTargetFileList_Adobe[0][0]
$TargetFileList_Adobe[$i - 1] = StringReplace($tTargetFileList_Adobe[$i][1], '"', "")
Next
EndIf
;_ArrayDisplay($TargetFileList_Adobe, "TargetFileList_Adobe")
$aSpecialFiles = IniReadSection($sINIPath, "CustomPatterns")
;_ArrayDisplay($aSpecialFiles)
For $i = 1 To UBound($aSpecialFiles) - 1
$sSpecialFiles = $sSpecialFiles & $aSpecialFiles[$i][0] & "|"
Next
;MsgBox(0, "", $sSpecialFiles)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
MainGui()
Local $bHostsbakExists = False
If FileExists("C:\Windows\System32\drivers\etc\hosts.bak") Then
GUICtrlSetState($idBtnRestoreHosts, $GUI_ENABLE)
$bHostsbakExists = True
EndIf
While 1
Local $bHostsbakExistsNow
If FileExists("C:\Windows\System32\drivers\etc\hosts.bak") Then
$bHostsbakExistsNow = True
Else
$bHostsbakExistsNow = False
EndIf
If $bHostsbakExistsNow <> $bHostsbakExists Then
If $bHostsbakExistsNow Then
GUICtrlSetState($idBtnRestoreHosts, $GUI_ENABLE)
Else
GUICtrlSetState($idBtnRestoreHosts, $GUI_DISABLE)
EndIf
$bHostsbakExists = $bHostsbakExistsNow
EndIf
$idMsg = GUIGetMsg()
Select
Case $idMsg = $GUI_EVENT_CLOSE
GUIDelete($MyhGUI)
_Exit()
Case $idMsg = $GUI_EVENT_RESIZED
ContinueCase
Case $idMsg = $GUI_EVENT_RESTORE
ContinueCase
Case $idMsg = $GUI_EVENT_MAXIMIZE
Local $iWidth
Local $aGui = WinGetPos($MyhGUI)
Local $aRect = _GUICtrlListView_GetViewRect($g_idListview)
If ($aRect[2] > $aGui[2]) Then
$iWidth = $aGui[2] - 75
Else
$iWidth = $aRect[2] - 25
EndIf
GUICtrlSendMsg($idListview, $LVM_SETCOLUMNWIDTH, 1, $iWidth)
Case $idMsg = $idButtonStop
$ListViewSelectFlag = 0 ; Set Flag to Deselected State
FillListViewWithInfo()
MemoWrite(@CRLF & "Path" & @CRLF & "---" & @CRLF & $MyDefPath & @CRLF & "---" & @CRLF & "Waiting for user action.")
GUICtrlSetState($idButtonStop, $GUI_HIDE)
GUICtrlSetState($idButtonSearch, $GUI_SHOW)
GUICtrlSetState($idButtonSearch, 64)
GUICtrlSetState($idBtnRestore, $GUI_HIDE)
GUICtrlSetState($idBtnBlockPopUp, $GUI_SHOW)
GUICtrlSetState($idBtnBlockPopUp, 64)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idBtnCure, 128)
Case $idMsg = $idButtonSearch
$fInterrupt = 0
GUICtrlSetState($idButtonSearch, $GUI_HIDE)
GUICtrlSetState($idButtonStop, $GUI_SHOW)
ToggleLog(0)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idBtnBlockPopUp, 128)
GUICtrlSetState($idListview, 128)
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idButtonCustomFolder, 128)
;Search through all files and folders in directory and fill ListView
_GUICtrlListView_DeleteAllItems($g_idListview)
_GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_AddItem($idListview, "", 0)
_GUICtrlListView_AddItem($idListview, "", 1)
_GUICtrlListView_AddItem($idListview, "", 2)
_GUICtrlListView_AddItem($idListview, "", 2)
_GUICtrlListView_RemoveAllGroups($idListview)
_GUICtrlListView_InsertGroup($idListview, -1, 1, "", 1) ; Group 1
_GUICtrlListView_SetGroupInfo($idListview, 1, "Info", 1, $LVGS_COLLAPSIBLE)
_GUICtrlListView_AddSubItem($idListview, 0, "", 1)
_GUICtrlListView_AddSubItem($idListview, 1, "Preparing...", 1)
_GUICtrlListView_AddSubItem($idListview, 2, "", 1)
_GUICtrlListView_AddSubItem($idListview, 3, "Be patient, please.", 1)
_GUICtrlListView_SetItemGroupID($idListview, 0, 1)
_GUICtrlListView_SetItemGroupID($idListview, 1, 1)
_GUICtrlListView_SetItemGroupID($idListview, 2, 1)
_GUICtrlListView_SetItemGroupID($idListview, 3, 1)
_Expand_All_Click()
_GUICtrlListView_SetGroupInfo($idListview, 1, "Info", 1, $LVGS_COLLAPSIBLE)
; Clear previous results
$FilesToPatch = $FilesToPatchNull
$FilesToRestore = $FilesToPatchNull
$timestamp = TimerInit()
Local $FileCount
If $bFindACC = 1 Then
Local $sAppsPanelDir = EnvGet('ProgramFiles(x86)') & "\Common Files\Adobe"
Local $aSize = DirGetSize($sAppsPanelDir, $DIR_EXTENDED) ; extended mode
If UBound($aSize) >= 2 Then
$FileCount = $aSize[1]
RecursiveFileSearch($sAppsPanelDir, 0, $FileCount) ;Search through all files and folders
ProgressWrite(0)
EndIf
EndIf
$aSize = DirGetSize($MyDefPath, $DIR_EXTENDED) ; extended mode
If UBound($aSize) >= 2 Then
$FileCount = $aSize[1]
$ProgressFileCountScale = 100 / $FileCount
$FileSearchedCount = 0
ProgressWrite(0)
RecursiveFileSearch($MyDefPath, 0, $FileCount) ;Search through all files and folders
Sleep(100)
ProgressWrite(0)
EndIf
FillListViewWithFiles()
If _GUICtrlListView_GetItemCount($idListview) > 0 Then
_Assign_Groups_To_Found_Files()
$ListViewSelectFlag = 1 ; Set Flag to Selected State
GUICtrlSetState($idButtonSearch, 128)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idBtnCure, 64)
GUICtrlSetState($idBtnCure, 256) ; Set focus
If UBound($FilesToRestore) > 0 Then
GUICtrlSetState($idBtnBlockPopUp, $GUI_HIDE)
GUICtrlSetState($idBtnRestore, 64)
GUICtrlSetState($idBtnRestore, $GUI_SHOW)
EndIf
Else
$ListViewSelectFlag = 0 ; Set Flag to Deselected State
FillListViewWithInfo()
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idButtonSearch, 64)
GUICtrlSetState($idButtonSearch, 256) ; Set focus
EndIf
;_Collapse_All_Click()
_Expand_All_Click()
GUICtrlSetState($idBtnDeselectAll, 64)
GUICtrlSetState($idBtnBlockPopUp, 64)
GUICtrlSetState($idListview, 64)
GUICtrlSetState($idButtonCustomFolder, 64)
GUICtrlSetState($idButtonSearch, $GUI_SHOW)
GUICtrlSetState($idButtonStop, $GUI_HIDE)
Case $idMsg = $idButtonCustomFolder ; Select Custom Path
ToggleLog(0)
MyFileOpenDialog()
_Expand_All_Click()
If $fFilesListed = 0 Then
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idButtonSearch, 64)
GUICtrlSetState($idButtonSearch, 256) ; Set focus
Else
GUICtrlSetState($idButtonSearch, 128)
GUICtrlSetState($idBtnDeselectAll, 64)
GUICtrlSetState($idBtnCure, 64)
GUICtrlSetState($idBtnCure, 256) ; Set focus
EndIf
Case $idMsg = $idBtnDeselectAll ; Deselect-Select All
ToggleLog(0)
If $ListViewSelectFlag = 1 Then
For $i = 0 To _GUICtrlListView_GetItemCount($idListview) - 1
_GUICtrlListView_SetItemChecked($idListview, $i, 0)
Next
$ListViewSelectFlag = 0 ; Set Flag to Deselected State
Else
For $i = 0 To _GUICtrlListView_GetItemCount($idListview) - 1
_GUICtrlListView_SetItemChecked($idListview, $i, 1)
Next
$ListViewSelectFlag = 1 ; Set Flag to Selected State
EndIf
Case $idMsg = $idBtnBlockPopUp ; Add firewall rule button
ToggleLog(0)
BlockPopUp()
Case $idMsg = $idBtnRunasTI ; Run as TrustedInstaller button
FileInstall("RunAsTI.exe", @WindowsDir & "\Temp\RunAsTI.exe")
Exit Run(@WindowsDir & '\Temp\RunAsTI.exe "' & @ScriptFullPath & '"')
Case $idMsg = $idBtnCure
ToggleLog(0)
GUICtrlSetState($idListview, 128)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idButtonSearch, 128)
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idBtnBlockPopUp, 128)
GUICtrlSetState($idBtnRestore, 128)
GUICtrlSetState($idButtonCustomFolder, 128)
_Expand_All_Click()
_GUICtrlListView_EnsureVisible($idListview, 0, 0)
Local $ItemFromList
For $i = 0 To _GUICtrlListView_GetItemCount($idListview) - 1
If _GUICtrlListView_GetItemChecked($idListview, $i) = True Then
_GUICtrlListView_SetItemSelected($idListview, $i)
$ItemFromList = _GUICtrlListView_GetItemText($idListview, $i, 1)
MyGlobalPatternSearch($ItemFromList)
ProgressWrite(0)
Sleep(100)
MemoWrite(@CRLF & "Path" & @CRLF & "---" & @CRLF & $ItemFromList & @CRLF & "---" & @CRLF & "medication :)")
LogWrite(1, $ItemFromList)
Sleep(100)
MyGlobalPatternPatch($ItemFromList, $aOutHexGlobalArray)
; Scroll control 10 pixels - 1 line
_GUICtrlListView_Scroll($idListview, 0, 10)
_GUICtrlListView_EnsureVisible($idListview, $i, 0)
Sleep(100)
EndIf
_GUICtrlListView_SetItemChecked($idListview, $i, False)
Next
_GUICtrlListView_DeleteAllItems($g_idListview)
_GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_RemoveAllGroups($idListview)
_GUICtrlListView_InsertGroup($idListview, -1, 1, "", 1) ; Group 1
_GUICtrlListView_SetGroupInfo($idListview, 1, "Info", 1, $LVGS_COLLAPSIBLE)
MemoWrite(@CRLF & "Path" & @CRLF & "---" & @CRLF & $MyDefPath & @CRLF & "---" & @CRLF & "waiting for user action")
GUICtrlSetState($idListview, 64)
GUICtrlSetState($idButtonSearch, 64)
GUICtrlSetState($idButtonCustomFolder, 64)
GUICtrlSetState($idBtnBlockPopUp, 64)
GUICtrlSetState($idBtnBlockPopUp, $GUI_SHOW)
GUICtrlSetState($idBtnRestore, $GUI_HIDE)
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idButtonSearch, 256) ; Set focus
FillListViewWithInfo()
If $bFoundAcro32 = True Then
MsgBox($MB_SYSTEMMODAL, "Information", "GenP does not patch the x32 bit version of Acrobat. Please use the x64 bit version of Acrobat.")
LogWrite(1, "GenP does not patch the x32 bit version of Acrobat. Please use the x64 bit version of Acrobat.")
EndIf
ToggleLog(1)
GUICtrlSetState($hLogTab, $GUI_SHOW)
Case $idMsg = $idBtnRestore
GUICtrlSetData($idLog, "Activity Log" & @CRLF)
ToggleLog(0)
GUICtrlSetState($idListview, 128)
GUICtrlSetState($idBtnDeselectAll, 128)
GUICtrlSetState($idButtonSearch, 128)
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idBtnBlockPopUp, 128)
GUICtrlSetState($idBtnRestore, 128)
GUICtrlSetState($idButtonCustomFolder, 128)
_Expand_All_Click()
_GUICtrlListView_EnsureVisible($idListview, 0, 0)
Local $ItemFromList, $iCheckedItems, $iProgress
For $i = 0 To _GUICtrlListView_GetItemCount($idListview) - 1
If _GUICtrlListView_GetItemChecked($idListview, $i) = True Then
_GUICtrlListView_SetItemSelected($idListview, $i)
$ItemFromList = _GUICtrlListView_GetItemText($idListview, $i, 1)
$iCheckedItems = _GUICtrlListView_GetSelectedCount($idListview)
$iProgress = 100 / $iCheckedItems
ProgressWrite(0)
RestoreFile($ItemFromList)
ProgressWrite($iProgress)
Sleep(100)
MemoWrite(@CRLF & "Path" & @CRLF & "---" & @CRLF & $ItemFromList & @CRLF & "---" & @CRLF & "restoring :)")
Sleep(100)
; Scroll control 10 pixels - 1 line
_GUICtrlListView_Scroll($idListview, 0, 10)
_GUICtrlListView_EnsureVisible($idListview, $i, 0)
Sleep(100)
EndIf
_GUICtrlListView_SetItemChecked($idListview, $i, False)
Next
_GUICtrlListView_DeleteAllItems($g_idListview)
_GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_RemoveAllGroups($idListview)
_GUICtrlListView_InsertGroup($idListview, -1, 1, "", 1) ; Group 1
_GUICtrlListView_SetGroupInfo($idListview, 1, "Info", 1, $LVGS_COLLAPSIBLE)
MemoWrite(@CRLF & "Path" & @CRLF & "---" & @CRLF & $MyDefPath & @CRLF & "---" & @CRLF & "waiting for user action")
GUICtrlSetState($idListview, 64)
GUICtrlSetState($idButtonCustomFolder, 64)
GUICtrlSetState($idBtnBlockPopUp, 64)
GUICtrlSetState($idBtnBlockPopUp, $GUI_SHOW)
GUICtrlSetState($idBtnRestore, $GUI_HIDE)
GUICtrlSetState($idBtnRestore, 64)
GUICtrlSetState($idBtnCure, 128)
GUICtrlSetState($idButtonSearch, 64)
GUICtrlSetState($idButtonSearch, 256) ; Set focus
FillListViewWithInfo()
ToggleLog(1)
Case $idMsg = $idBtnCopyLog
SendToClipBoard()
Case $idMsg = $idFindACC
If _IsChecked($idFindACC) Then
$bFindACC = 1
Else
$bFindACC = 0
EndIf
Case $idMsg = $idEnableMD5
If _IsChecked($idEnableMD5) Then
$bEnableMD5 = 1
Else
$bEnableMD5 = 0
EndIf
Case $idMsg = $idOnlyAdobeFolders
If _IsChecked($idOnlyAdobeFolders) Then
$bOnlyAdobeFolders = 1
Else
$bOnlyAdobeFolders = 0
EndIf
Case $idMsg = $idUseCustomDomains
GUICtrlSetState($idBtnBlockPopUp, 64)
If _IsChecked($idUseCustomDomains) Then
$bUseCustomDomains = 1
If Not StringInStr(GUICtrlRead($idCustomDomainsInput), ".adobestats.io") Then
GUICtrlSetData($idCustomDomainsInput, "8eptecerpq.adobestats.io" & @CRLF & "xa8g202i4u.adobestats.io")
EndIf
Else
$bUseCustomDomains = 0
EndIf
Case $idMsg = $idBtnSaveOptions
SaveOptionsToConfig()
Case $idMsg = $idBtnDestroyAGS
DestroyAGS()
Case $idMsg = $idBtnEditHosts
EditHosts()
Case $idMsg = $idBtnRestoreHosts
RestoreHosts()
Case $idMsg = $idBtnCleanFirewall
CleanFirewall()
Case $idMsg = $idBtnOpenWF
OpenWF()
Case $idMsg = $idBtnEnableDisableWF
EnableDisableWFRules()
EndSelect
WEnd
Func MainGui()
$MyhGUI = GUICreate($g_AppWndTitle, 595, 710, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $GUI_SS_DEFAULT_GUI))
$hTab = GUICtrlCreateTab(0, 1, 597, 710)
$hMainTab = GUICtrlCreateTabItem("Main")
$idListview = GUICtrlCreateListView("", 10, 35, 575, 555)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$g_idListview = GUICtrlGetHandle($idListview) ; get the handle for use in the notify events
_GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_CHECKBOXES))
; Add columns
_GUICtrlListView_SetItemCount($idListview, UBound($FilesToPatch))
_GUICtrlListView_AddColumn($idListview, "", 20)
_GUICtrlListView_AddColumn($idListview, "For collapsing or expanding all groups, please click here", 532, 2)
; Build groups
_GUICtrlListView_EnableGroupView($idListview)
_GUICtrlListView_InsertGroup($idListview, -1, 1, "", 1) ; Group 1
_GUICtrlListView_SetGroupInfo($idListview, 1, "Info", 1, $LVGS_COLLAPSIBLE)
FillListViewWithInfo()
$idButtonCustomFolder = GUICtrlCreateButton("Path", 10, 630, 80, 30)
GUICtrlSetTip(-1, "Select Path that You want -> press Search -> press Patch button")
GUICtrlSetImage(-1, "imageres.dll", -4, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idButtonSearch = GUICtrlCreateButton("Search", 110, 630, 80, 30)
GUICtrlSetTip(-1, "Let GenP find Apps automatically in current path")
GUICtrlSetImage(-1, "imageres.dll", -8, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idButtonStop = GUICtrlCreateButton("Stop", 110, 630, 80, 30)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetTip(-1, "Stop searching for Apps")
GUICtrlSetImage(-1, "imageres.dll", -8, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnDeselectAll = GUICtrlCreateButton("De/Select", 210, 630, 80, 30)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetTip(-1, "De/Select All files")
GUICtrlSetImage(-1, "imageres.dll", -76, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnCure = GUICtrlCreateButton("Patch", 305, 630, 80, 30)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetTip(-1, "Patch all selected files")
GUICtrlSetImage(-1, "imageres.dll", -102, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnBlockPopUp = GUICtrlCreateButton("Pop-up", 405, 630, 80, 30)
GUICtrlSetTip(-1, "Block Unlicensed Pop-up by creating Windows Firewall Rule")
GUICtrlSetImage(-1, "imageres.dll", -101, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnRestore = GUICtrlCreateButton("Restore", 405, 630, 80, 30)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetTip(-1, "Restore Original Files")
GUICtrlSetImage(-1, "imageres.dll", -113, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnRunasTI = GUICtrlCreateButton("Runas TI", 505, 630, 80, 30)
GUICtrlSetImage(-1, "imageres.dll", -74, 0)
If (@UserName = "SYSTEM") Then
GUICtrlSetState(-1, $GUI_DISABLE)
EndIf
GUICtrlSetTip(-1, "Run as Trusted Installer")
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idProgressBar = GUICtrlCreateProgress(10, 597, 575, 25, $PBS_SMOOTHREVERSE)
GUICtrlSetResizing(-1, $GUI_DOCKVCENTER)
GUICtrlCreateLabel($g_AppVersion, 10, 677, 575, 25, $ES_CENTER)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
GUICtrlCreateTabItem("")
$hOptionsTab = GUICtrlCreateTabItem("Options")
$idFindACC = GUICtrlCreateCheckbox("Always search for ACC", 10, 50, 300, 25, BitOR($BS_AUTOCHECKBOX, $BS_LEFT))
If $bFindACC = 1 Then
GUICtrlSetState($idFindACC, $GUI_CHECKED)
Else
GUICtrlSetState($idFindACC, $GUI_UNCHECKED)
EndIf
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idEnableMD5 = GUICtrlCreateCheckbox("Enable MD5 Checksum", 10, 90, 300, 25, BitOR($BS_AUTOCHECKBOX, $BS_LEFT))
If $bEnableMD5 = 1 Then
GUICtrlSetState($idEnableMD5, $GUI_CHECKED)
Else
GUICtrlSetState($idEnableMD5, $GUI_UNCHECKED)
EndIf
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idOnlyAdobeFolders = GUICtrlCreateCheckbox("Only find files in Adobe or Acrobat folders", 10, 130, 300, 25, BitOR($BS_AUTOCHECKBOX, $BS_LEFT))
If $bOnlyAdobeFolders = 1 Then
GUICtrlSetState($idOnlyAdobeFolders, $GUI_CHECKED)
Else
GUICtrlSetState($idOnlyAdobeFolders, $GUI_UNCHECKED)
EndIf
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idUseCustomDomains = GUICtrlCreateCheckbox("Only use domains below for pop-up blocker", 10, 170, 300, 25, BitOR($BS_AUTOCHECKBOX, $BS_LEFT))
If $bUseCustomDomains = 1 Then
GUICtrlSetState($idUseCustomDomains, $GUI_CHECKED)
Else
GUICtrlSetState($idUseCustomDomains, $GUI_UNCHECKED)
EndIf
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idCustomDomainsInput = GUICtrlCreateInput("Custom Domains", 10, 195, 288, 150, BitOR($ES_MULTILINE, $ES_LEFT, $ES_WANTRETURN))
GUICtrlSetResizing(-1, $GUI_DOCKVCENTER)
GUICtrlSetData($idCustomDomainsInput, StringReplace(StringReplace($sCustomDomains, ",", @CRLF), "'", ""))
$idBtnSaveOptions = GUICtrlCreateButton("Save Options", 247, 630, 100, 30)
GUICtrlSetTip(-1, "Save Options to config.ini")
GUICtrlSetImage(-1, "imageres.dll", 5358, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlCreateTabItem("")
$hPopupTab = GUICtrlCreateTabItem("Pop-up Tools")
$sDestroyAGSText = "ADOBE GENUINE SERVICES REMOVAL" & @CRLF & @CRLF & _
"Many times, the unlicensed pop-up you are getting is due to AGS." & @CRLF & _
"You really don't want it on your system spying on you. So, just nuke it!" & @CRLF & _
"This runs a quick script to stop and remove the services and files associated with AGS." & @CRLF & _
"Before you go blocking pop-ups, make sure you need to. Nuke AGS. See if pop-up is gone ;)"
$idLabelDestroyAGS = GUICtrlCreateLabel($sDestroyAGSText, 10, 50, 575, 90, $ES_CENTER)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnDestroyAGS = GUICtrlCreateButton("Destroy AGS", 235, 150, 140, 30)
GUICtrlSetTip(-1, "Totally remove AGS from your system.")
;GUICtrlSetImage(-1, "imageres.dll", 167, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$sEditHostsText = "EDIT HOSTS" & @CRLF & @CRLF & _
"Before running the pop-up blocker, you need a clean hosts file. (No adobe rules!)" & @CRLF & _
"Be very careful editing hosts file. You'll find it at C:\Windows\System32\drivers\etc\hosts." & @CRLF & _
"Disable rules by putting a # in front of the rule (# comments the rule out). If things work as expected, remove the rule." & @CRLF & _
"Be sure to save the hosts file when done editing. We make a backup just in case you mess up ;)"
$idLabelEditHosts = GUICtrlCreateLabel($sEditHostsText, 10, 200, 575, 90, $ES_CENTER)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnEditHosts = GUICtrlCreateButton("Edit Hosts", 155, 300, 140, 30)
GUICtrlSetTip(-1, "Open hosts file for editing in notepad.")
;GUICtrlSetImage(-1, "imageres.dll", 15, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnRestoreHosts = GUICtrlCreateButton("Restore Hosts", 315, 300, 140, 30)
GUICtrlSetState($idBtnRestoreHosts, $GUI_DISABLE)
GUICtrlSetTip(-1, "Restore hosts backup. Available after editing hosts file.")
;GUICtrlSetImage(-1, "imageres.dll", 15, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$sCleanFirewallText = "CLEAN WINDOWS FIREWALL" & @CRLF & @CRLF & _
"If you have used GenP in the past, or experience problems with internet access" & @CRLF & _
"this will remove any OUTBOUND BLOCK rules that GenP created." & @CRLF & _
"This enables you know you have a clean start, and allows ACC correct access for updates." & @CRLF & _
"You can always run pop-up blocker to add rules back if necessary ;)"
$idLabelCleanFirewall = GUICtrlCreateLabel($sCleanFirewallText, 10, 350, 575, 90, $ES_CENTER)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnCleanFirewall = GUICtrlCreateButton("Clean Firewall", 235, 450, 140, 30)
GUICtrlSetTip(-1, "Remove all Windows Firewall Rules created by GenP.")
;GUICtrlSetImage(-1, "imageres.dll", 15, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnOpenWF = GUICtrlCreateButton("Open Windows Firewall", 155, 500, 140, 30)
GUICtrlSetTip(-1, "Open Windows Firewall to check settings.")
;GUICtrlSetImage(-1, "imageres.dll", 15, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$idBtnEnableDisableWF = GUICtrlCreateButton("Enable/Disable Rules", 315, 500, 140, 30)
GUICtrlSetTip(-1, "Toggle state of Windows Firewall OUTBOUND BLOCK rules with ADOBE in their name.")
;GUICtrlSetImage(-1, "imageres.dll", 15, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlCreateTabItem("")
$hLogTab = GUICtrlCreateTabItem("Log")
$idMemo = GUICtrlCreateEdit("", 10, 35, 575, 555, BitOR($ES_READONLY, $ES_CENTER, $WS_DISABLED))
GUICtrlSetResizing(-1, $GUI_DOCKVCENTER)
$idLog = GUICtrlCreateEdit("", 10, 35, 575, 555, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY))
GUICtrlSetResizing(-1, $GUI_DOCKVCENTER)
GUICtrlSetState($idLog, $GUI_HIDE)
GUICtrlSetData($idLog, "Activity Log" & @CRLF)
$idBtnCopyLog = GUICtrlCreateButton("Copy", 257, 630, 80, 30)
GUICtrlSetTip(-1, "Copy log to the clipboard")
GUICtrlSetImage(-1, "imageres.dll", -77, 0)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlCreateLabel($g_AppVersion, 10, 677, 575, 25, $ES_CENTER)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
GUICtrlCreateTabItem("")
MemoWrite(@CRLF & "Path" & @CRLF & "---" & @CRLF & $MyDefPath & @CRLF & "---" & @CRLF & "Waiting for user action.")
GUICtrlSetState($idButtonSearch, 256) ; Set focus
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
EndFunc ;==>MainGui