Skip to content

Commit 01b6030

Browse files
committed
rdp/wget 1.19.4-32
1 parent 23fbf6b commit 01b6030

File tree

10 files changed

+239
-5
lines changed

10 files changed

+239
-5
lines changed

autoit/eg_rdp.au3

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,68 @@
1+
;TODO
2+
; https://www.autoitscript.com/forum/topic/167711-refresh-everything-in-the-gui/
3+
4+
#Include <WinAPIEx.au3>
5+
16
#include <GUIConstants.au3>
27

3-
$oRDP = ObjCreate("MsTscAx.MsTscAx")
8+
;$oRDP = ObjCreate("MsTscAx.MsTscAx")
9+
$oRDP = ObjCreate("MsTscAx.MsTscAx.2")
10+
11+
$argc = $CmdLine[0]
12+
13+
$user=""
14+
if $argc>0 then
15+
$user=$CmdLine[1]
16+
endif
17+
18+
$pass=""
19+
if $argc>1 then
20+
$pass=$CmdLine[2]
21+
endif
22+
23+
;GUICreate("RDP " & $user, 1281, 1025, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
24+
$hForm = GUICreate("RDP " & $user, 1024, 768, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
425

5-
GUICreate("Embedded RDP control Test", 1281, 1025, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
26+
;; ---------------------------------------------------------------------------
27+
;; GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), '_ShellHookProc')
28+
;; _WinAPI_RegisterShellHookWindow($hForm)
29+
;;
30+
;; Func _ShellHookProc($hWnd, $iMsg, $wParam, $lParam)
31+
;; Switch $hWnd
32+
;; Case $hForm
33+
;; Switch $wParam
34+
;; Case $HSHELL_WINDOWACTIVATED
35+
;; ;ConsoleWrite('Activated: ' & WinGetHandle($lParam) & @CR)
36+
;; MsgBox(0,"Activated:","" &WinGetHandle($lParam) & @CR )
37+
;; EndSwitch
38+
;; EndSwitch
39+
;; EndFunc ;==>_ShellHookProc
40+
;; Func OnAutoItExit()
41+
;; _WinAPI_DeregisterShellHookWindow($hForm)
42+
;; EndFunc ;==>OnAutoItExit
43+
44+
;; ---------------------------------------------------------------------------
45+
;; ObjEvent($oRDP,"Run_")
46+
;; ;Func Run_OnConnected()
47+
;; ; MsgBox(0x40, "Title", "Text")
48+
;; ;EndFunc
49+
;; Func Run_OnLoginComplete()
50+
;; MsgBox(0,"Login","Login has Completed!")
51+
;; EndFunc
652

753
$GUIActiveX = GUICtrlCreateObj($oRDP, 1, 1, 1280, 1024)
854

9-
GUICtrlSetStyle ($GUIActiveX, $WS_VISIBLE )
55+
;GUICtrlSetStyle ($GUIActiveX, $WS_VISIBLE )
56+
1057
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
58+
;GUICtrlSetResizing(-1, $GUI_DOCKALL)
1159

1260
GUISetState()
1361

1462
$oRDP.Server = "127.0.0.1"
1563
$oRDP.Domain = ""
16-
$oRDP.UserName = "test"
17-
$oRDP.AdvancedSettings2.ClearTextPassword = "test1234"
64+
$oRDP.UserName = $user
65+
$oRDP.AdvancedSettings2.ClearTextPassword = $pass
1866

1967
$oRdp.ConnectingText = "Connecting..."
2068
$oRdp.DisconnectedText = "Disconnected"
@@ -31,13 +79,39 @@ $oRDP.AdvancedSettings2.EnableAutoReconnect = True
3179
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = True
3280
;$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
3381

82+
Func _SetStyle($hwnd,$style,$exstyle)
83+
DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -16, "long", $style)
84+
DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -20, "long", $exstyle)
85+
EndFunc
86+
87+
88+
;$hUIContainerClass = ControlGetHandle($GUIActiveX, "", "UIContainerClass2")
89+
;$hUIMainClass = ControlGetHandle($GUIActiveX, "", "UIMainClass1")
90+
;$hATL = ControlGetHandle($GUIActiveX, "", "ATL:46F016981")
91+
;Const $WS_EX_NOPARENTNOTIFY = 0x4
92+
;Const $WS_EX_NOINHERITLAYOUT = 0x100000
93+
;$hUIContainerClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000
94+
;$hUIContainerClassStyleEx = BitOR($WS_EX_NOINHERITLAYOUT, $WS_EX_NOPARENTNOTIFY) ; 0x00100004
95+
;$hUIMainClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_SYSMENU, $WS_VISIBLE) ; 0x56080000
96+
;$hUIMainClassStyleEx = 0x0
97+
;$hATLStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000
98+
;$hATLStyleEx = 0x0
99+
;$guiStyle = BitOR($WS_BORDER, $WS_CAPTION, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_DLGFRAME, $WS_GROUP, $WS_MAXIMIZE, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_TABSTOP, $WS_THICKFRAME, $WS_VISIBLE) ; 0x17CF0100
100+
;$guiStyleEx = $WS_EX_WINDOWEDGE ; 0x00000100
101+
;_SetStyle($hUIContainerClass,$hUIContainerClassStyle,$hUIContainerClassStyleEx)
102+
;_SetStyle($hUIMainClass,$hUIMainClassStyle,$hUIMainClassStyleEx)
103+
;_SetStyle($hATL,$hATLStyle,$hATLStyleEx)
104+
;_SetStyle($gui,$guiStyle,$guiStyleEx)
105+
34106
$oRDP.Connect()
35107

36108
While 1
37109
$msg = GUIGetMsg()
38110
Select
39111
Case $msg = $GUI_EVENT_CLOSE
40112
ExitLoop
113+
Case $msg = $GUI_EVENT_RESTORE
114+
WinMove($hForm, "",0,0)
41115
EndSelect
42116
WEnd
43117

rdp/TODO.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# TODO
2+
3+
rdp plugin in chrome:
4+
https://chrome.google.com/webstore/detail/chrome-rdp/cbkkbcmdlboombapidmoeolnmdacpkch/related
452 KB
Binary file not shown.
1.03 MB
Binary file not shown.

rdp/rdp_pass.au3

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Func CryptRDPPassword2($str)
2+
Local Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1
3+
Local Const $DATA_BLOB = "int;ptr"
4+
5+
Local $passStr = DllStructCreate("byte[1024]")
6+
Local $DataIn = DllStructCreate($DATA_BLOB)
7+
Local $DataOut = DllStructCreate($DATA_BLOB)
8+
$pwDescription = 'psw'
9+
$PwdHash = ""
10+
11+
DllStructSetData($DataOut, 1, 0)
12+
DllStructSetData($DataOut, 2, 0)
13+
14+
DllStructSetData($passStr, 1, StringToBinary($str,2)); UTF16 Little Endian
15+
DllStructSetData($DataIn, 2, DllStructGetPtr($passStr, 1))
16+
DllStructSetData($DataIn, 1, StringLen($str)*2)
17+
18+
$return = DllCall("crypt32.dll","int", "CryptProtectData", _
19+
"ptr", DllStructGetPtr($DataIn), _
20+
"wstr", $pwDescription, _
21+
"ptr", 0, _
22+
"ptr", 0, _
23+
"ptr", 0, _
24+
"dword", $CRYPTPROTECT_UI_FORBIDDEN, _
25+
"ptr", DllStructGetPtr($DataOut))
26+
If @error Then Return ""
27+
28+
$len = DllStructGetData($DataOut, 1)
29+
$PwdHash = Ptr(DllStructGetData($DataOut, 2))
30+
$PwdHash = DllStructCreate("byte[" & $len & "]", $PwdHash)
31+
Return DllStructGetData($PwdHash, 1)
32+
EndFunc
33+
34+
Func CryptRDPPassword($str)
35+
Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1
36+
Const $DATA_BLOB = "int;ptr"
37+
38+
Dim $passStr = DllStructCreate("byte[1024]")
39+
Dim $DataIn = DllStructCreate($DATA_BLOB)
40+
Dim $DataOut = DllStructCreate($DATA_BLOB)
41+
$pwDescription = 'psw'
42+
$PwdHash = ""
43+
44+
DllStructSetData($DataOut, 1, 0)
45+
DllStructSetData($DataOut, 2, 0)
46+
47+
DllStructSetData($passStr, 1, StringToBinary($str,2)); UTF16 Little Endian
48+
DllStructSetData($DataIn, 2, DllStructGetPtr($passStr, 1))
49+
DllStructSetData($DataIn, 1, StringLen($str)*2)
50+
51+
$return = DllCall("crypt32.dll","int", "CryptProtectData", _
52+
"ptr", DllStructGetPtr($DataIn), _
53+
"wstr", $pwDescription, _
54+
"ptr", 0, _
55+
"ptr", 0, _
56+
"ptr", 0, _
57+
"dword", $CRYPTPROTECT_UI_FORBIDDEN, _
58+
"ptr", DllStructGetPtr($DataOut))
59+
If @error Then Return ""
60+
61+
$len = DllStructGetData($DataOut, 1)
62+
$PwdHash = Ptr(DllStructGetData($DataOut, 2))
63+
$PwdHash = DllStructCreate("byte[" & $len & "]", $PwdHash)
64+
$encodeStr = ""
65+
For $x = 1 To $len
66+
$encodeStr &= Hex(DllStructGetData($PwdHash, 1, $x),2)
67+
Next
68+
Return $encodeStr
69+
EndFunc
70+
71+
$argc = $CmdLine[0]
72+
73+
$pass=""
74+
if $argc>0 then
75+
$pass=$CmdLine[1]
76+
$pass2=CryptRDPPassword($pass)
77+
;MsgBox(0,$pass,$pass2)
78+
ConsoleWrite($pass2)
79+
endif
80+

rdp/rdp_pass.exe

839 KB
Binary file not shown.

rdp/rdp_pass_build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
..\megatrade_libs\autoit\Aut2exe /in rdp_pass.au3 /out rdp_pass.exe /console

rdp/rdp_pass_tool.au3

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
Global $sRed1 = "This is a test."
2+
ConsoleWrite("$sRed1 = " & $sRed1 & @LF)
3+
4+
Global $sBlack = CryptRDPPassword($sRed)
5+
ConsoleWrite("$sBlack = " & $sBlack & @LF)
6+
7+
Global $sRed2 = UncryptRDPPassword($sBlack)
8+
ConsoleWrite("$sRed2 = " & $sRed2 & @LF)
9+
10+
Func CryptRDPPassword($str)
11+
Local Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1
12+
Local Const $DATA_BLOB = "int;ptr"
13+
14+
Local $passStr = DllStructCreate("byte[1024]")
15+
Local $DataIn = DllStructCreate($DATA_BLOB)
16+
Local $DataOut = DllStructCreate($DATA_BLOB)
17+
$pwDescription = 'psw'
18+
$PwdHash = ""
19+
20+
DllStructSetData($DataOut, 1, 0)
21+
DllStructSetData($DataOut, 2, 0)
22+
23+
DllStructSetData($passStr, 1, StringToBinary($str,2)); UTF16 Little Endian
24+
DllStructSetData($DataIn, 2, DllStructGetPtr($passStr, 1))
25+
DllStructSetData($DataIn, 1, StringLen($str)*2)
26+
27+
$return = DllCall("crypt32.dll","int", "CryptProtectData", _
28+
"ptr", DllStructGetPtr($DataIn), _
29+
"wstr", $pwDescription, _
30+
"ptr", 0, _
31+
"ptr", 0, _
32+
"ptr", 0, _
33+
"dword", $CRYPTPROTECT_UI_FORBIDDEN, _
34+
"ptr", DllStructGetPtr($DataOut))
35+
If @error Then Return ""
36+
37+
$len = DllStructGetData($DataOut, 1)
38+
$PwdHash = Ptr(DllStructGetData($DataOut, 2))
39+
$PwdHash = DllStructCreate("byte[" & $len & "]", $PwdHash)
40+
Return DllStructGetData($PwdHash, 1)
41+
EndFunc
42+
43+
Func UncryptRDPPassword($bin)
44+
Local Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1
45+
Local Const $DATA_BLOB = "int;ptr"
46+
47+
Local $passStr = DllStructCreate("byte[1024]")
48+
Local $DataIn = DllStructCreate($DATA_BLOB)
49+
Local $DataOut = DllStructCreate($DATA_BLOB)
50+
$pwDescription = 'psw'
51+
$PwdHash = ""
52+
53+
DllStructSetData($DataOut, 1, 0)
54+
DllStructSetData($DataOut, 2, 0)
55+
56+
DllStructSetData($passStr, 1, $bin)
57+
DllStructSetData($DataIn, 2, DllStructGetPtr($passStr, 1))
58+
DllStructSetData($DataIn, 1, BinaryLen($bin))
59+
60+
$return = DllCall("crypt32.dll","int", "CryptUnprotectData", _
61+
"ptr", DllStructGetPtr($DataIn), _
62+
"ptr", 0, _
63+
"ptr", 0, _
64+
"ptr", 0, _
65+
"ptr", 0, _
66+
"dword", $CRYPTPROTECT_UI_FORBIDDEN, _
67+
"ptr", DllStructGetPtr($DataOut))
68+
If @error Then Return ""
69+
70+
$len = DllStructGetData($DataOut, 1)
71+
$PwdHash = Ptr(DllStructGetData($DataOut, 2))
72+
$PwdHash = DllStructCreate("byte[" & $len & "]", $PwdHash)
73+
Return BinaryToString(DllStructGetData($PwdHash, 1), 2)
74+
EndFunc

wget_and_curl/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://eternallybored.org/misc/wget/

wget_and_curl/wget-1.19.4-32.exe

3.71 MB
Binary file not shown.

0 commit comments

Comments
 (0)