Update apps

This commit is contained in:
binarymaster 2015-07-16 23:17:41 +03:00
parent eca971de03
commit adabe322c3
6 changed files with 52 additions and 28 deletions

View File

@ -1,5 +1,5 @@
{ {
Copyright 2014 Stas'M Corp. Copyright 2015 Stas'M Corp.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -282,33 +282,46 @@ var
hSvc: THandle; hSvc: THandle;
Code: DWORD; Code: DWORD;
pch: PWideChar; 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 begin
hSC := 0;
hSvc := 0;
Writeln('[*] Starting ', SvcName, '...'); Writeln('[*] Starting ', SvcName, '...');
hSC := OpenSCManager(nil, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT); hSC := OpenSCManager(nil, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT);
if hSC = 0 then if hSC = 0 then
begin begin
Code := GetLastError; ExitError('OpenSCManager', GetLastError);
Writeln('[-] OpenSCManager error (code ', Code, ').');
Exit; Exit;
end; end;
hSvc := OpenService(hSC, PWideChar(SvcName), SERVICE_START); hSvc := OpenService(hSC, PWideChar(SvcName), SERVICE_START);
if hSvc = 0 then if hSvc = 0 then
begin begin
CloseServiceHandle(hSC); ExitError('OpenService', GetLastError);
Code := GetLastError;
Writeln('[-] OpenService error (code ', Code, ').');
Exit; Exit;
end; end;
pch := nil; pch := nil;
if not StartService(hSvc, 0, pch) then begin if not StartService(hSvc, 0, pch) then begin
CloseServiceHandle(hSvc);
CloseServiceHandle(hSC);
Code := GetLastError; Code := GetLastError;
Writeln('[-] StartService error (code ', Code, ').'); 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; Exit;
end; end;
end else begin
ExitError('StartService', Code);
Exit;
end;
end;
CloseServiceHandle(hSvc); CloseServiceHandle(hSvc);
CloseServiceHandle(hSC); CloseServiceHandle(hSC);
end; end;

View File

@ -41,14 +41,14 @@
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release"> <BuildConfiguration Include="Release">
<Key>Cfg_1</Key> <Key>Cfg_1</Key>
<CfgParent>Base</CfgParent> <CfgParent>Base</CfgParent>
</BuildConfiguration> </BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup> </ItemGroup>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/> <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<ProjectExtensions> <ProjectExtensions>

Binary file not shown.

View File

@ -1,5 +1,5 @@
{ {
Copyright 2014 Stas'M Corp. Copyright 2015 Stas'M Corp.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -50,7 +50,7 @@ begin
RDP.ConnectingText := 'Connecting...'; RDP.ConnectingText := 'Connecting...';
RDP.ConnectedStatusText := 'Connected.'; RDP.ConnectedStatusText := 'Connected.';
RDP.UserName := ''; RDP.UserName := '';
RDP.Server := '127.0.0.1'; RDP.Server := '127.0.0.2';
Reg := TRegistry.Create; Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE; Reg.RootKey := HKEY_LOCAL_MACHINE;
@ -133,7 +133,7 @@ begin
$2207: ErrStr := 'The smart card is blocked.'; $2207: ErrStr := 'The smart card is blocked.';
$1C07: ErrStr := 'An incorrect PIN was presented to the smart card.'; $1C07: ErrStr := 'An incorrect PIN was presented to the smart card.';
$B09: ErrStr := 'Network Level Authentication is required.'; $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); else ErrStr := 'Unknown code 0x'+IntToHex(discReason, 1);
end; end;
if (discReason > 2) then if (discReason > 2) then

View File

@ -3,7 +3,7 @@ object MainForm: TMainForm
Top = 0 Top = 0
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'RDP Wrapper Configuration' Caption = 'RDP Wrapper Configuration'
ClientHeight = 326 ClientHeight = 352
ClientWidth = 351 ClientWidth = 351
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
@ -27,7 +27,7 @@ object MainForm: TMainForm
end end
object bOK: TButton object bOK: TButton
Left = 10 Left = 10
Top = 293 Top = 319
Width = 75 Width = 75
Height = 25 Height = 25
Caption = 'OK' Caption = 'OK'
@ -37,7 +37,7 @@ object MainForm: TMainForm
end end
object bCancel: TButton object bCancel: TButton
Left = 91 Left = 91
Top = 293 Top = 319
Width = 75 Width = 75
Height = 25 Height = 25
Caption = 'Cancel' Caption = 'Cancel'
@ -47,7 +47,7 @@ object MainForm: TMainForm
end end
object bApply: TButton object bApply: TButton
Left = 172 Left = 172
Top = 293 Top = 319
Width = 75 Width = 75
Height = 25 Height = 25
Caption = 'Apply' Caption = 'Apply'
@ -66,7 +66,7 @@ object MainForm: TMainForm
end end
object rgNLA: TRadioGroup object rgNLA: TRadioGroup
Left = 8 Left = 8
Top = 135 Top = 132
Width = 335 Width = 335
Height = 73 Height = 73
Caption = 'Security Mode' Caption = 'Security Mode'
@ -88,14 +88,16 @@ object MainForm: TMainForm
end end
object rgShadow: TRadioGroup object rgShadow: TRadioGroup
Left = 8 Left = 8
Top = 214 Top = 208
Width = 335 Width = 335
Height = 73 Height = 105
Caption = 'Session Shadowing Mode' Caption = 'Session Shadowing Mode'
Items.Strings = ( Items.Strings = (
'Disable Shadowing' 'Disable Shadowing'
'Shadowing will request user'#39's permission' 'Full access with user'#39's permission'
'Shadow sessions immediately') 'Full access without permission'
'View only with user'#39's permission'
'View only without permission')
TabOrder = 6 TabOrder = 6
OnClick = cbAllowTSConnectionsClick OnClick = cbAllowTSConnectionsClick
end end
@ -112,7 +114,7 @@ object MainForm: TMainForm
end end
object bLicense: TButton object bLicense: TButton
Left = 253 Left = 253
Top = 293 Top = 319
Width = 87 Width = 87
Height = 25 Height = 25
Caption = 'View license...' Caption = 'View license...'

View File

@ -1,5 +1,5 @@
{ {
Copyright 2014 Stas'M Corp. Copyright 2015 Stas'M Corp.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -439,6 +439,15 @@ begin
end; end;
end; end;
Reg.CloseKey; 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; Reg.Free;
end; end;