Advertisement
Guest User

Untitled

a guest
May 8th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 17.99 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=icon.ico
  3. #AutoIt3Wrapper_Outfile=SIM32.exe
  4. #AutoIt3Wrapper_UseUpx=y
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6. #include <ButtonConstants.au3>
  7. #include <EditConstants.au3>
  8. #include <GUIConstantsEx.au3>
  9. #include <GUIListBox.au3>
  10. #include <GUIEdit.au3>
  11. #include <WindowsConstants.au3>
  12. #include <Inet.au3>
  13. #include "P2P.au3"
  14. #include "DARTIS.au3"
  15. #include <array.au3>
  16. #include <misc.au3>
  17. #include <WindowsConstants.au3>
  18. #include <Memory.au3>
  19. #include <GDIPlus.au3>
  20. #include <MsgBoxConstants.au3>
  21. #include <IE.au3>
  22. #include "Toast.au3"
  23.  
  24. Global $precision = TimerInit(), $hGUI
  25. Global $kbp, $gtimer = TimerInit()
  26.  
  27. Global $session = "NULL", $username, $recipient, $last
  28. Dim $conversations[100][3]
  29. $conversations[0][0] = 0
  30. _login()
  31.  
  32. $oIE = _IECreateEmbedded()
  33.  
  34. $Form2 = GUICreate("Secure Interface Module", 612, 476, -1, -1, $WS_SIZEBOX+$WS_MAXIMIZEBOX)
  35. $List2 = GUICtrlCreateList("", 0, 0, 145, 435)
  36. GUICtrlSetResizing(-1, 257)
  37. GUICtrlCreateObj($oIE, 146, 0, 465, 401)
  38. GUISetBkColor(0xFFFFFF)
  39. GUICtrlSetResizing(-1, 102)
  40. _IENavigate($oIE, "https://pdglobal.net")
  41. ;$Edit2 = GUICtrlCreateEdit("", 146, 0, 465, 401, $WS_VSCROLL + $ES_AUTOVSCROLL)
  42. GUICtrlSetData(-1, "")
  43. $Input2 = GUICtrlCreateInput("", 152, 408, 377, 21)
  44. GUICtrlSetResizing(-1, 582)
  45. $Button2 = GUICtrlCreateButton("Send", 536, 405, 75, 25, $BS_DEFPUSHBUTTON)
  46. GUICtrlSetResizing(-1, 512+256+64+4)
  47. ;_GUICtrlEdit_SetReadOnly($Edit2, True)
  48. _getcontacts()
  49. ;~ _P2P_Start_Node($username, 6667, 25, 1, 25, 1, "0.0.0.0")
  50. ;~ _P2P_Register_Event($P2P_MESSAGE, "recv")
  51. ;~ _getpeers()
  52. Local $idcontacts = GUICtrlCreateMenu("&Contacts")
  53. Local $managecontacts = GUICtrlCreateMenuItem("Manage Contacts", $idcontacts)
  54. Local $idFilemenu = GUICtrlCreateMenu("&Encryption")
  55. Local $generatekey = GUICtrlCreateMenuItem("Generate Keyfile", $idFilemenu)
  56. Local $selectkey = GUICtrlCreateMenuItem("Select KeyFile", $idFilemenu)
  57. Local $clearkey = GUICtrlCreateMenuItem("Clear KeyFile", $idFilemenu)
  58. GUISetState(@SW_SHOW)
  59. GUIDelete($hGUI)
  60. $peers = TimerInit()
  61. While 1
  62.     $nMsg = GUIGetMsg()
  63.     Switch $nMsg
  64.         Case $List2
  65.             $current = _GUICtrlListBox_GetText($List2, _GUICtrlListBox_GetCurSel($List2))
  66.             $recipient = $current ;update last to current
  67.             _IEDocWriteHTML($oIE, "")
  68.             $oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)
  69.             ;_GUICtrlEdit_SetText($Edit2, "")
  70.             For $i = 0 To $conversations[0][0]
  71.                 If $conversations[$i][0] = $current Then
  72.                     _IEDocWriteHTML($oIE, $conversations[$i][1])
  73.                     $oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)
  74.                     ;GUICtrlSetData($Edit2, _Formattext($conversations[$i][1]))
  75.                     ExitLoop
  76.                 EndIf
  77.             Next
  78.         Case $managecontacts
  79.             ShellExecute("https://pdglobal.net/?pid=settings#settings")
  80.         Case $clearkey
  81.             $current = _GUICtrlListBox_GetText($List2, _GUICtrlListBox_GetCurSel($List2))
  82.             $recipient = $current ;update last to current
  83.             ;_GUICtrlEdit_SetText($Edit2, "")
  84.             For $i = 0 To $conversations[0][0]
  85.                 If $conversations[$i][0] = $current Then
  86.                     $conversations[$i][2] = "NA"
  87.                     ExitLoop
  88.                 EndIf
  89.             Next
  90.             IniWrite(@ScriptDir & "\settings.ini", "userkeys", $current, "NA")
  91.  
  92.         Case $selectkey
  93.             $keyfile = FileOpenDialog("Select KeyFile for this user", @ScriptDir, "*.kbf(*.kbf)")
  94.             $localkey = FileRead($keyfile)
  95.             IniWrite(@ScriptDir & "\settings.ini", "userkeys", $current, $keyfile)
  96.             For $i = 0 To $conversations[0][0]
  97.                 If $conversations[$i][0] = $current Then
  98.                     $conversations[$i][2] = _bang($localkey)
  99.                     ExitLoop
  100.                 EndIf
  101.             Next
  102.         Case $generatekey
  103.             $saveas = FileSaveDialog("Generate Keyfile", @ScriptDir, "*.kbf(*.kbf)")
  104.             $key = _generate_keyFile()
  105.             If Not StringLeft($saveas, 3) = "kbf" Then
  106.                 $saveas &= "kbf"
  107.             EndIf
  108.             FileWrite($saveas, $key)
  109.         Case $GUI_EVENT_CLOSE
  110.             Local $confirm = MsgBox($MB_OKCANCEL, "Exit now?", "Are you sure you want to exit the Secure Interface Module?") ; MsgBox must be a variable, so we can check the return value
  111.             If $confirm = $IDOK Then Exit ; If they pushed ok, exit.
  112.         Case $Button2
  113.             If StringStripWS(GUICtrlRead($Input2), $STR_STRIPALL) <> "" Then ; Strip all whitespace from the input, and check that it's not "NULL" or "" (empty string)
  114.                 $current = _GUICtrlListBox_GetText($List2, _GUICtrlListBox_GetCurSel($List2))
  115.  
  116.                 $recipient = $current ;update last to current
  117.  
  118.                     _IEDocWriteHTML($oIE, "")
  119.                     $oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)
  120.                 ;_GUICtrlEdit_SetText($Edit2, "")
  121.                 For $i = 0 To $conversations[0][0]
  122.                     If $conversations[$i][0] = $current Then
  123.                         $conversations[$i][1] &= "<div style='float: right;width: 90%;border: 3px solid #888888;padding: 10px;text-align:right;margin-bottom:10px;' >Me: " & _Formattext(GUICtrlRead($Input2))& "<br/></div><br/>"
  124.                         ;GUICtrlSetData($Edit2, _Formattext($conversations[$i][1]))
  125.                         _IEDocWriteHTML($oIE, $conversations[$i][1])
  126.                         $oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)
  127.                         ExitLoop
  128.                     EndIf
  129.                 Next
  130.  
  131.                 If UBound($conversations[$i][2]) > 2 Then
  132.                     ;~  _p2p_send_message($recipient, _inject($conversations[$i][2], GUICtrlRead($input2)),$username)
  133.                     _sendwebmsg($recipient, _inject($conversations[$i][2], GUICtrlRead($Input2)))
  134.                 Else
  135.                     ;~  _p2p_send_message($recipient, GUICtrlRead($input2),$username)
  136.                     _sendwebmsg($recipient, GUICtrlRead($Input2))
  137.                 EndIf
  138.  
  139.                 GUICtrlSetData($Input2, "")
  140.             EndIf
  141.     EndSwitch
  142.     If TimerDiff($peers) > 3000 Then
  143.         _getmsg()
  144.         $peers = TimerInit()
  145.     EndIf
  146. WEnd
  147.  
  148. func _Formattext($text)
  149.         $text = StringReplace($text, "<", "&lt;")
  150. $text = StringReplace($text, ">", "&gt;")
  151.     $text = StringReplace($text, ":|", "<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/24/Emotes-face-plain-icon.png' />")
  152.     $text = StringReplace($text, ":(", "<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/24/Emotes-face-sad-icon.png' />")
  153.     $text = StringReplace($text, ":)", "<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/24/Emotes-face-smile-icon.png' />")
  154.     $text = StringReplace($text, ":D", "<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/24/Emotes-face-smile-big-icon.png' />")
  155.     $text = StringReplace($text, "xD", "<img src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/24/Emotes-face-laugh-icon.png' />")
  156. Return $text
  157. EndFunc
  158.  
  159. Func _sendwebmsg($to, $msg)
  160.     _INetGetSource("https://pdglobal.net/?sid=sendmsg&to=" & $to & "&msg=" & $msg & "&session=" & $session)
  161. EndFunc   ;==>_sendwebmsg
  162.  
  163. Func _getmsg()
  164.     $incoming = _INetGetSource("https://pdglobal.net/?sid=getmsgs&session=" & $session)
  165.     $msgs = StringSplit($incoming, "<br/>", 1)
  166.     For $i = 1 To $msgs[0]
  167.         $msgdata = StringSplit($msgs[$i], "~")
  168.         For $i = 0 To $conversations[0][0]
  169.             If UBound($msgdata) > 2 Then
  170.                 If StringUpper($conversations[$i][0]) = StringTrimLeft($msgdata[1], 1) Then
  171.                     $current = StringTrimLeft($msgdata[1], 1)
  172.                     If UBound($conversations[$i][2]) > 2 Then
  173.                         $msgdata[2] = _extract($conversations[$i][2], $msgdata[2])
  174.  
  175.                     EndIf
  176.                     $conversations[$i][1] &= "<div style='float: left;width: 90%;border: 3px solid #11AAFF;padding: 10px;text-align:left;margin-bottom:10px;' >"&$msgdata[1] & ": " & _Formattext($msgdata[2])& "<br/></div><br/>"
  177.                     _IEDocWriteHTML($oIE, $conversations[$i][1])
  178.                     $oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)
  179.                     ;GUICtrlSetData($Edit2, _Formattext($conversations[$i][1]))
  180.                     if not WinActive($Form2) Then
  181.                         Beep(1000, 250)
  182.                         $aRet = _Toast_Show(0, $msgdata[1], $msgdata[2], 0)
  183.                         WinFlash($Form2)
  184.                         _Toast_Hide()
  185.                     EndIf
  186.                     if stringleft($msgdata[2], 5) = "/ping" Then
  187.                         _sendwebmsg(StringTrimLeft($msgdata[1], 1), "*pong*")
  188.                     EndIf
  189.                     ExitLoop
  190.                 EndIf
  191.             EndIf
  192.         Next
  193.  
  194.     Next
  195.  
  196. EndFunc   ;==>_getmsg
  197.  
  198.  
  199. Func _getpeers()
  200. ;~ $peerlist = StringSplit(StringTrimLeft(_INetGetSource("https://pdglobal.net/?sid=peerlist"),1), "|")
  201. ;~ for $i=1 to $peerlist[0]
  202. ;~  _P2P_Connect($peerlist[$i])
  203. ;~ Next
  204. EndFunc   ;==>_getpeers
  205.  
  206. Func _getcontacts()
  207.     $clist = StringSplit(StringTrimLeft(_INetGetSource("https://pdglobal.net/?sid=contactslist&session=" & $session), 1), "|")
  208.     $index = 0
  209.  
  210.     _GUICtrlListBox_ResetContent($List2)
  211.     For $i = 1 To $clist[0]
  212.         If $clist[$i] <> "" Then
  213.             $conversations[0][0] += 1
  214.             $conversations[$i][0] = $clist[$i]
  215.             $conversations[$i][2] = _bang(FileRead(IniRead(@ScriptDir & "\settings.ini", "userkeys", $clist[$i], "NA")))
  216.             _GUICtrlListBox_AddString($List2, $clist[$i])
  217.             $index += 1
  218.         EndIf
  219.     Next
  220. EndFunc   ;==>_getcontacts
  221.  
  222. Func recv($Socket, $message, $from, $error)
  223.     ;_extract($message)
  224.     ConsoleWrite($from& "<br/>")
  225.     For $i = 0 To $conversations[0][0]
  226.         If $conversations[$i][0] = $from Then
  227.  
  228.             If UBound($conversations[$i][2]) > 2 Then
  229.                 $message = _extract($conversations[$i][2], $message)
  230.  
  231.             EndIf
  232.             $conversations[$i][1] &= $from & ": " & _Formattext($message)& "<br/>"
  233.  
  234.                     _IEDocWriteHTML($oIE, $conversations[$i][1])
  235.                     $oIE.document.parentwindow.scroll(0, $oIE.document.body.scrollHeight)
  236.             ;GUICtrlSetData($Edit2, _Formattext($conversations[$i][1]))
  237.  
  238.             ExitLoop
  239.         EndIf
  240.     Next
  241. EndFunc   ;==>recv
  242.  
  243. Func _login()
  244.     $Form1 = GUICreate("Secure Interface Module", 280, 331, 192, 124)
  245.     GUISetBkColor(0xFFFFFF)
  246.     $Group1 = GUICtrlCreateGroup("Username", 48, 128, 185, 57)
  247.     $Input1 = GUICtrlCreateInput("", 56, 152, 169, 21)
  248.     GUICtrlCreateGroup("", -99, -99, 1, 1)
  249.     $Group2 = GUICtrlCreateGroup("Password", 48, 195, 185, 57)
  250.     $Input2 = GUICtrlCreateInput("", 56, 219, 169, 21, 0x0020)
  251.     GUICtrlCreateGroup("", -99, -99, 1, 1)
  252.     $Button1 = GUICtrlCreateButton("Sign In", 64, 272, 155, 25, $BS_DEFPUSHBUTTON)
  253.     $Pic1 = GUICtrlCreatePic(@ScriptDir & "\SIM.jpg", 40, 16, 204, 100)
  254.     GUISetState(@SW_SHOW)
  255.     #EndRegion ### END Koda GUI section ###
  256.  
  257.     While 1
  258.         $nMsg = GUIGetMsg()
  259.         Switch $nMsg
  260.             Case $GUI_EVENT_CLOSE
  261.                 Exit
  262.             Case $Button1
  263.                 $username = GUICtrlRead($Input1)
  264.                 $password = GUICtrlRead($Input2)
  265.                 $auth = _INetGetSource("https://pdglobal.net/?sid=login&usr=" & $username & "&pwd=" & $password)
  266.                 If StringLeft($auth, 3) = " 0x" Then
  267.                     ;logged in
  268.                     $session = StringTrimLeft($auth, 3)
  269.                     GUISetState(@SW_HIDE, $Form1)
  270.                     loading()
  271.                     ExitLoop
  272.                 Else
  273.                     MsgBox(16, "Error", $auth)
  274.                 EndIf
  275.  
  276.         EndSwitch
  277.     WEnd
  278. EndFunc   ;==>_login
  279.  
  280. ;coded by UEZ build 2013-05-02, idea taken from http://tympanus.net/codrops/2012/11/14/creative-css-loading-animations/
  281. ;AutoIt v3.3.9.21 or higher needed!
  282.  
  283. Func loading()
  284.     Global Const $hDwmApiDll = DllOpen("dwmapi.dll")
  285.     Global $sChkAero = DllStructCreate("int;")
  286.     DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero))
  287.     Global $bAero = DllStructGetData($sChkAero, 1)
  288.     Global $fStep = 0.02
  289.     If Not $bAero Then $fStep = 1.5
  290.  
  291.     _GDIPlus_Startup()
  292.     Global Const $STM_SETIMAGE = 0x0172 ; $IMAGE_BITMAP = 0
  293.     Global $iW = 400, $iH = 250
  294.     Global $hGUI = GUICreate("Loading", $iW, $iH, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
  295.     GUISetBkColor(0xEEEEEE)
  296.     Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH)
  297.     GUICtrlSetState(-1, $GUI_DISABLE)
  298.     WinSetTrans($hGUI, "", 0)
  299.     GUISetState()
  300.     Global $hHBmp_BG, $hB, $iSleep = 50
  301.     GUIRegisterMsg($WM_TIMER, "PlayAnim")
  302.     DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0)
  303.     Global $z, $iPerc = 0
  304.  
  305.     For $z = 1 To 255 Step $fStep
  306.         WinSetTrans($hGUI, "", $z)
  307.     Next
  308.  
  309. EndFunc   ;==>loading
  310.  
  311. Func PlayAnim()
  312.     $hHBmp_BG = _GDIPlus_MonochromaticBlinker($iW, $iH, "Loading... Please Wait")
  313.     $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG)
  314.     If $hB Then _WinAPI_DeleteObject($hB)
  315.     _WinAPI_DeleteObject($hHBmp_BG)
  316. EndFunc   ;==>PlayAnim
  317.  
  318. Func _GDIPlus_MonochromaticBlinker($iW, $iH, $sString = "Please wait...", $bHBitmap = True)
  319.     Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid(0xFF123456)
  320.     Local Const $hBrushBall2 = _GDIPlus_BrushCreateSolid(0x80123456)
  321.     Local Const $hBrushRect = _GDIPlus_BrushCreateSolid(0x90FFFFFF)
  322.     Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
  323.  
  324.     Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
  325.     _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)
  326.     _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
  327.     Local Const $hBmp_BG = _GDIPlus_BitmapCreateFromMemory(_Background())
  328.     Local $hBrushTexture = _GDIPlus_TextureCreate($hBmp_BG)
  329.     _GDIPlus_BitmapDispose($hBmp_BG)
  330.     _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushTexture)
  331.     Local $iRadius, $fCosX, $fSinY, $i, $j = 0, $l = 0
  332.     Local Const $fDeg = ACos(-1) / 180, $iRadius1 = 60, $iRadius2 = $iRadius1 - 16, $iCount = 4, $iW2 = $iW / 2, $iH2 = $iH / 2, $iSizeBall = 32, $iSizeBall2 = $iSizeBall / 2, _
  333.             $fFontSize = 12, $fSpeed = 0.5
  334.     Local $tPoints = DllStructCreate("float[" & $iCount * 2 & "]")
  335.     Local $aColors[15] = [$hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall2, _
  336.             $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1, $hBrushBall1]
  337.     Local Static $iAngle = 0, $k
  338.     For $i = 0 To 315 Step 45
  339.         $fCosX = Cos(($i + $iAngle) * $fDeg)
  340.         $fSinY = Sin(($i + $iAngle) * $fDeg)
  341.         If Not Mod($j, 2) Then
  342.             DllStructSetData($tPoints, 1, $iW2 + $fCosX * ($iRadius1 + 3), $l * 2 + 1)
  343.             DllStructSetData($tPoints, 1, $iH2 + $fSinY * ($iRadius1 + 3), $l * 2 + 2)
  344.             $l += 1
  345.         EndIf
  346.         $iRadius = Execute("$iRadius" & 1 + Mod($j, 2))
  347.         _GDIPlus_GraphicsFillEllipse($hCtxt, -$iSizeBall2 + $iW2 + $fCosX * $iRadius, -$iSizeBall2 + $iH2 + $fSinY * $iRadius, $iSizeBall, $iSizeBall, $aColors[Int(7 - $k + $j)])
  348.         $j += 1
  349.     Next
  350.     $k = Mod($k + $fSpeed, 8)
  351.     DllCall($__g_hGDIPDll, "int", "GdipFillPolygon", "handle", $hCtxt, "handle", $hBrushRect, "struct*", $tPoints, "int", $iCount, "int", 0)
  352.     $tPoints = 0
  353.     $iAngle -= 2
  354.     Local Const $hFormat = _GDIPlus_StringFormatCreate()
  355.     Local Const $hFamily = _GDIPlus_FontFamilyCreate("Arial")
  356.     Local Const $hFont = _GDIPlus_FontCreate($hFamily, $fFontSize, 2)
  357.     Local Const $hBrushTxt = _GDIPlus_BrushCreateSolid(0xFF101010)
  358.     Local Const $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
  359.     Local Const $aInfo = _GDIPlus_GraphicsMeasureString($hCtxt, $sString, $hFont, $tLayout, $hFormat)
  360.     DllStructSetData($tLayout, "X", ($iW - DllStructGetData($aInfo[0], "Width")) / 2)
  361.     DllStructSetData($tLayout, "Y", $iH / 2 + $iRadius1 + $iSizeBall)
  362.     _GDIPlus_GraphicsDrawStringEx($hCtxt, $sString, $hFont, $tLayout, $hFormat, $hBrushTxt)
  363.  
  364.     _GDIPlus_FontDispose($hFont)
  365.     _GDIPlus_FontFamilyDispose($hFamily)
  366.     _GDIPlus_StringFormatDispose($hFormat)
  367.     _GDIPlus_BrushDispose($hBrushTxt)
  368.     _GDIPlus_BrushDispose($hBrushTexture)
  369.     _GDIPlus_GraphicsDispose($hCtxt)
  370.     _GDIPlus_BrushDispose($hBrushBall1)
  371.     _GDIPlus_BrushDispose($hBrushBall2)
  372.     _GDIPlus_BrushDispose($hBrushRect)
  373.     If $bHBitmap Then
  374.         Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
  375.         _GDIPlus_BitmapDispose($hBitmap)
  376.         Return $hHBITMAP
  377.     EndIf
  378.     Return $hBitmap
  379. EndFunc   ;==>_GDIPlus_MonochromaticBlinker
  380.  
  381. ;Code below was generated by: 'File to Base64 String' Code Generator v1.12 Build 2013-03-27
  382.  
  383. Func _Background($bSaveBinary = False, $sSavePath = @ScriptDir)
  384.     Local $Background
  385.     $Background &= 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKBAMAAAB/HNKOAAAAD1BMVEXl5eXp6enu7u7g4ODm5uY5xL5yAAAAJElEQVR4Xk3KMQ0AAAwDoNYKGupf2969hBTNsKiKmVDC+P7/AbJBBh6YaCBlAAAAAElFTkSuQmCC'
  386.     Local $bString = Binary(_Base64Decode($Background))
  387.     If $bSaveBinary Then
  388.         Local $hFile = FileOpen($sSavePath & "\hexabump.png", 18)
  389.         FileWrite($hFile, $bString)
  390.         FileClose($hFile)
  391.     EndIf
  392.     Return $bString
  393. EndFunc   ;==>_Background
  394. ;~ Func _base64decode($data)
  395. ;~     Local $opcode = "0xC81000005356578365F800E8500000003EFFFFFF3F3435363738393A3B3C3DFFFFFF00FFFFFF000102030405060708090A0B0C0D0E0F10111213141516171819FFFFFFFFFFFF1A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132338F45F08B7D0C8B5D0831D2E9910000008365FC00837DFC047D548A034384C0750383EA033C3D75094A803B3D75014AB00084C0751A837DFC047D0D8B75FCC64435F400FF45FCEBED6A018F45F8EB1F3C2B72193C7A77150FB6F083EE2B0375F08A068B75FC884435F4FF45FCEBA68D75F4668B06C0E002C0EC0408E08807668B4601C0E004C0EC0208E08847018A4602C0E00624C00A46038847028D7F038D5203837DF8000F8465FFFFFF89D05F5E5BC9C21000"
  396. ;~     Local $codebuffer = DllStructCreate("byte[" & BinaryLen($opcode) & "]")
  397. ;~     DllStructSetData($codebuffer, 1, $opcode)
  398. ;~     Local $ouput = DllStructCreate("byte[" & BinaryLen($data) & "]")
  399. ;~     Local $ret = DllCall("user32.dll", "int", "CallWindowProc", "ptr", DllStructGetPtr($codebuffer), "str", $data, "ptr", DllStructGetPtr($ouput), "int", 0, "int", 0)
  400. ;~     Return BinaryMid(DllStructGetData($ouput, 1), 1, $ret[0])
  401. ;~ EndFunc
  402.  
  403. ;~ Func _base64encode($data, $linebreak = 76)
  404. ;~     Local $opcode = "0x5589E5FF7514535657E8410000004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F005A8B5D088B7D108B4D0CE98F0000000FB633C1EE0201D68A06880731C083F901760C0FB6430125F0000000C1E8040FB63383E603C1E60409C601D68A0688470183F90176210FB6430225C0000000C1E8060FB6730183E60FC1E60209C601D68A06884702EB04C647023D83F90276100FB6730283E63F01D68A06884703EB04C647033D8D5B038D7F0483E903836DFC04750C8B45148945FC66B80D0A66AB85C90F8F69FFFFFFC607005F5E5BC9C21000"
  405. ;~     Local $codebuffer = DllStructCreate("byte[" & BinaryLen($opcode) & "]")
  406. ;~     DllStructSetData($codebuffer, 1, $opcode)
  407. ;~     $data = Binary($data)
  408. ;~     Local $input = DllStructCreate("byte[" & BinaryLen($data) & "]")
  409. ;~     DllStructSetData($input, 1, $data)
  410. ;~     $linebreak = Floor($linebreak / 4) * 4
  411. ;~     Local $oputputsize = Ceiling(BinaryLen($data) * 4 / 3)
  412. ;~     $oputputsize = $oputputsize + Ceiling($oputputsize / $linebreak) * 2 + 4
  413. ;~     Local $ouput = DllStructCreate("char[" & $oputputsize & "]")
  414. ;~     DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($codebuffer), "ptr", DllStructGetPtr($input), "int", BinaryLen($data), "ptr", DllStructGetPtr($ouput), "uint", $linebreak)
  415. ;~     Return DllStructGetData($ouput, 1)
  416. ;~ EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement