From adabe322c3cbed132dd87dce7b7a8e3e34dcec53 Mon Sep 17 00:00:00 2001 From: binarymaster Date: Thu, 16 Jul 2015 23:17:41 +0300 Subject: [PATCH] Update apps --- src-installer/RDPWInst.dpr | 33 +++++++++++++++++++++++---------- src-installer/RDPWInst.dproj | 8 ++++---- src-installer/resource.res | Bin 435504 -> 397100 bytes src-rdpcheck/MainUnit.pas | 6 +++--- src-rdpconfig/MainUnit.dfm | 22 ++++++++++++---------- src-rdpconfig/MainUnit.pas | 11 ++++++++++- 6 files changed, 52 insertions(+), 28 deletions(-) diff --git a/src-installer/RDPWInst.dpr b/src-installer/RDPWInst.dpr index 6f934f5..b4489bd 100644 --- a/src-installer/RDPWInst.dpr +++ b/src-installer/RDPWInst.dpr @@ -1,5 +1,5 @@ { - Copyright 2014 Stas'M Corp. + Copyright 2015 Stas'M Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -282,32 +282,45 @@ var hSvc: THandle; Code: DWORD; pch: PWideChar; + procedure ExitError(Func: String; ErrorCode: DWORD); + begin + if hSC > 0 then + CloseServiceHandle(hSC); + if hSvc > 0 then + CloseServiceHandle(hSvc); + Writeln('[-] ', Func, ' error (code ', ErrorCode, ').'); + end; begin + hSC := 0; + hSvc := 0; Writeln('[*] Starting ', SvcName, '...'); hSC := OpenSCManager(nil, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT); if hSC = 0 then begin - Code := GetLastError; - Writeln('[-] OpenSCManager error (code ', Code, ').'); + ExitError('OpenSCManager', GetLastError); Exit; end; hSvc := OpenService(hSC, PWideChar(SvcName), SERVICE_START); if hSvc = 0 then begin - CloseServiceHandle(hSC); - Code := GetLastError; - Writeln('[-] OpenService error (code ', Code, ').'); + ExitError('OpenService', GetLastError); Exit; end; pch := nil; if not StartService(hSvc, 0, pch) then begin - CloseServiceHandle(hSvc); - CloseServiceHandle(hSC); Code := GetLastError; - Writeln('[-] StartService error (code ', Code, ').'); - Exit; + if Code = 1056 then begin // Service already started + Sleep(2000); // or SCM hasn't registered killed process + if not StartService(hSvc, 0, pch) then begin + ExitError('StartService', Code); + Exit; + end; + end else begin + ExitError('StartService', Code); + Exit; + end; end; CloseServiceHandle(hSvc); CloseServiceHandle(hSC); diff --git a/src-installer/RDPWInst.dproj b/src-installer/RDPWInst.dproj index 78b7b03..3d44444 100644 --- a/src-installer/RDPWInst.dproj +++ b/src-installer/RDPWInst.dproj @@ -41,14 +41,14 @@ Base - - Cfg_2 - Base - Cfg_1 Base + + Cfg_2 + Base + diff --git a/src-installer/resource.res b/src-installer/resource.res index 8bcc9dd10466c18d591998d2b7034726c3b241ae..402086aa693436be4016e1d63dd72da12edd5cd9 100644 GIT binary patch delta 1744 zcmY*XYfzL`7@pnzHj`W%Bs6wiSXr6Iz46`lrcuGiZVIAEDmr24$ZAXoD3Y3!5}Gtk zCd;EvrAUlsOxk!s(u^s>8m5b5ih`Fi_D{dFv6|5zcFuWqv>#{RbKd8DF6VrE{73uI z15dZR%!f*oxx2;%{j%m)wd9$3$Tb;k1+dj@wKdiyUP?4I)i%^O6)13-WaOFC@1qk~ zoq=oS3{m42T~t}(brO1{y!+=o%(U9Xey25zi`F8xd{fHn8!Hkuwd)cq*E99Py1Ir9 zi5li{!78Vh#mnoOSJyt$b(y@Gi)v%5R$yKeE5V5=Vo~kx2fpe@5P)aO9Xx*o$&Sy!V5B0Sf25raLOEk_hb>?<{(^m5+2DR zylWcaTik?u^ElotxO-<1*6bxL*UvF8^76@hr^0bR)@V5_n-4$h3d21p4ZXWdfn!ys%JXK13$2{WSolpFw z3y42j@qhl*O5$%`Li{^R4W{oySry%B(kmSIprKmDx#d;p*yzKC6|HQ>kF=U>98AoG zWi@3#`l=@IaP8XyKmQtObgXf)86WjUA{@exI;-pBuP z%h>pIEa=?LC}qN;xtlD?4w6O2CuFhqFj@ThDYux8njX&a;Miw8nis7{Tq0WK=fra! zBi`oY#Jh8Xc=adSG5EC?Ri}8oGQrt%nsfYE{3U(9-m}C}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_Qb-~}+u2YU4NJ-`Bfn;xc^kBI7Ra9n#yy$_X)X_sQ zGZQg{Zy%iTPw3)cLiy;y!>vSKjiLLeL=Rp&GkWk0H#I|V#niDu(xL~iT|Rp7u>Qx< z!$8lE9$HPTrm!W7WazYm*3FC_n(an@^bpsdVHyBqp&7uKg$k9m^_GhtC*iX8zv%Jk z;i!=kJ-BpD6FhYZMw|NCa~ewF=s~p2iyo*=B6<)~C8Gx+0_3V-Dv`L8BIcIx)|wRpvR$g}4{JQrR}X5`cO^!M*5p&?%)(!O4cg$;Q7U?)%=I;t=(yXfy7^mjM?-Sc;!U%d0VfBauLXg96^ diff --git a/src-rdpcheck/MainUnit.pas b/src-rdpcheck/MainUnit.pas index 1f0e201..3efe4ca 100644 --- a/src-rdpcheck/MainUnit.pas +++ b/src-rdpcheck/MainUnit.pas @@ -1,5 +1,5 @@ { - Copyright 2014 Stas'M Corp. + Copyright 2015 Stas'M Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ begin RDP.ConnectingText := 'Connecting...'; RDP.ConnectedStatusText := 'Connected.'; RDP.UserName := ''; - RDP.Server := '127.0.0.1'; + RDP.Server := '127.0.0.2'; Reg := TRegistry.Create; Reg.RootKey := HKEY_LOCAL_MACHINE; @@ -133,7 +133,7 @@ begin $2207: ErrStr := 'The smart card is blocked.'; $1C07: ErrStr := 'An incorrect PIN was presented to the smart card.'; $B09: ErrStr := 'Network Level Authentication is required.'; - $708: ErrStr := 'The RDP seems to work, but your client doesn''t support loopback connections. Try to connect to your PC from another device in the network.'; + $708: ErrStr := 'RDP is working, but the client doesn''t allow loopback connections. Try to connect to your PC from another device in the network.'; else ErrStr := 'Unknown code 0x'+IntToHex(discReason, 1); end; if (discReason > 2) then diff --git a/src-rdpconfig/MainUnit.dfm b/src-rdpconfig/MainUnit.dfm index 49a9004..d67ee28 100644 --- a/src-rdpconfig/MainUnit.dfm +++ b/src-rdpconfig/MainUnit.dfm @@ -3,7 +3,7 @@ object MainForm: TMainForm Top = 0 BorderStyle = bsDialog Caption = 'RDP Wrapper Configuration' - ClientHeight = 326 + ClientHeight = 352 ClientWidth = 351 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -27,7 +27,7 @@ object MainForm: TMainForm end object bOK: TButton Left = 10 - Top = 293 + Top = 319 Width = 75 Height = 25 Caption = 'OK' @@ -37,7 +37,7 @@ object MainForm: TMainForm end object bCancel: TButton Left = 91 - Top = 293 + Top = 319 Width = 75 Height = 25 Caption = 'Cancel' @@ -47,7 +47,7 @@ object MainForm: TMainForm end object bApply: TButton Left = 172 - Top = 293 + Top = 319 Width = 75 Height = 25 Caption = 'Apply' @@ -66,7 +66,7 @@ object MainForm: TMainForm end object rgNLA: TRadioGroup Left = 8 - Top = 135 + Top = 132 Width = 335 Height = 73 Caption = 'Security Mode' @@ -88,14 +88,16 @@ object MainForm: TMainForm end object rgShadow: TRadioGroup Left = 8 - Top = 214 + Top = 208 Width = 335 - Height = 73 + Height = 105 Caption = 'Session Shadowing Mode' Items.Strings = ( 'Disable Shadowing' - 'Shadowing will request user'#39's permission' - 'Shadow sessions immediately') + 'Full access with user'#39's permission' + 'Full access without permission' + 'View only with user'#39's permission' + 'View only without permission') TabOrder = 6 OnClick = cbAllowTSConnectionsClick end @@ -112,7 +114,7 @@ object MainForm: TMainForm end object bLicense: TButton Left = 253 - Top = 293 + Top = 319 Width = 87 Height = 25 Caption = 'View license...' diff --git a/src-rdpconfig/MainUnit.pas b/src-rdpconfig/MainUnit.pas index 8feeccf..d8608cb 100644 --- a/src-rdpconfig/MainUnit.pas +++ b/src-rdpconfig/MainUnit.pas @@ -1,5 +1,5 @@ { - Copyright 2014 Stas'M Corp. + Copyright 2015 Stas'M Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -439,6 +439,15 @@ begin end; end; Reg.CloseKey; + Reg.OpenKey('\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services', True); + if rgShadow.ItemIndex >= 0 then begin + try + Reg.WriteInteger('Shadow', rgShadow.ItemIndex); + except + + end; + end; + Reg.CloseKey; Reg.Free; end;