Во блин
![](/img/smilies/icon_confused.gif)
![](/img/smilies/icon_confused.gif)
![](/img/icon_plus.gif)
Add(MainForm,2953706,189,196)
{
Width=466
Height=253
link(onCreate,8347339:doEvent1,[])
}
Add(Button,10200834,231,441)
{
Left=110
Top=180
Width=230
Caption="Запустить программу"
link(onClick,944995:doData,[])
}
Add(InlineCode,13368979,392,441)
{
WorkPoints=#71:doRunAsExt=запуск программы от учётной записи, имя файла *.exe в потоке|
EventPoints=#21:onLog=Вывод сообщений|
DataPoints=#14:UserName=Логин|15:Password=Пароль|12:Domain=Домен|21:CommandLine=Параметры|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|30:uses kol,windows, Share,Debug;|0:|48:function CreateProcessWithLogonW(user:pwidechar;|50: domain:pwidechar;|50: passw:pwidechar; |47: flags: DWORD; |62: lpApplicationName: PwideChar;|58: lpCommandLine: PwideChar;|57: dwCreationFlags: DWORD; |56: lpEnvironment: Pointer;|64: lpCurrentDirectory: PWideChar; |67: const lpStartupInfo: TStartupInfo;|120: var lpProcessInformation: TProcessInformation): BOOL; stdcall; external 'advapi32.dll';|0:|77:function runas(username, password, domain, strline, command: string): string;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|23: //Command: string;|59: UserName,Password,Domain,CommandLine,onLog :THI_Event;|50: procedure doRunAsExt(var dt:TData; idx:word);|5: end;|0:|14:implementation|0:|77:function runas(username, password, domain, strline, command: string): string;|3:var|19: si: tstartupinfo;|26: pi: tprocessinformation;|72: puser, ppass, pdomain, pprogram, pcomandline: array [0..255] of wchar;|19: lasterror: dword;|23: resultstring: string;|5:begin|30: zeromemory(@si, sizeof(si));|20: si.cb:=sizeof(si);|30: zeromemory(@pi, sizeof(pi));|0:|41: stringtowidechar(username, puser, 255);|41: stringtowidechar(password, ppass, 255);|41: stringtowidechar(domain, pdomain, 255);|43: stringtowidechar(command, pprogram, 255);|46: stringtowidechar(strline, pcomandline, 255);|2: |32: createprocesswithlogonw(puser,|34: pdomain,|32: ppass,|50: 1, //logon_with_profile,|35: pprogram,|45: pcomandline, //nil,|76: create_default_error_mode or create_new_console or|78: create_new_process_group or create_separate_wow_vdm,|30: nil,|30: nil,|29: si,|30: pi);|0:|26: lasterror:=getlasterror;|19: case lasterror of|31: 0: resultstring:='success';|39: 86: resultstring:='wrong password';|53: 1326: resultstring:='wrong username or password';|66: 1327: resultstring:='logon failure. user account restriction';|114: 1385: resultstring:='logon failure. the user has not been granted the requested logon type at this computer.';|38: 2: resultstring:='file not found';|37: 5: resultstring:='access denied';|6: else|46: resultstring:='error '+int2str(lasterror);|6: end;|23: result:=resultstring;|4:end;|0:|33:procedure THiAsmClass.doRunAsExt;|53:var login,pass,strdomain,command,strline,log: string;|16: data: TData;|5:begin|26: command := ToString(dt);|40: login := ReadString(data,UserName,'');|40: pass := ReadString(data,Password,'');|43: strdomain := ReadString(data,Domain,'');|46: strline := ReadString(data,CommandLine,'');|57: log := runas(login, pass, strdomain, strline, command);|25: _hi_OnEvent(onLog,log);|4:end;|4:end.|
link(onLog,5067512:doText,[])
link(UserName,3946622:String,[])
link(Password,1692524:Text,[])
link(Domain,3510170:Text,[])
link(CommandLine,1467427:Text,[])
}
Add(ComboBox,3946622,385,210)
{
Left=55
Top=10
Width=135
Height=21
Text="Please select a user"
}
Add(Label,11032557,434,210)
{
Left=10
Top=15
Width=26
Height=17
Cursor=2
Hint="Refresh"
Caption="User"
Underline=0
link(onClick,13698167:doEvent1,[])
AddHint(73,19,37,13,Caption)
}
Add(Edit,1692524,399,273)
{
Left=255
Top=10
Width=135
Text="Please enter the pass. here"
ClearAfterEnter=1
Point(doSelectAll)
Point(onMouseMove)
link(onMouseMove,1692524:doSelectAll,[(438,293)(438,265)(389,265)(389,293)])
}
Add(Label,3990666,469,273)
{
Left=210
Top=15
Width=27
Height=17
Caption="Pass"
AddHint(72,-7,38,13,Caption)
}
Add(Edit,3510170,406,329)
{
Left=55
Top=45
Width=385
}
Add(Label,6989190,469,329)
{
Left=10
Top=50
Width=40
Height=17
Cursor=2
Hint="Refresh"
Caption="Domain"
Underline=0
link(onClick,12797900:doClear,[])
AddHint(62,-30,51,13,Caption)
}
Add(Hub,8347339,231,210)
{
link(onEvent1,7695739:doWork2,[])
link(onEvent2,10768462:doWork1,[(312,223)])
}
Add(ComputerInfo,2997109,322,280)
{
}
Add(DoData,9771323,329,329)
{
link(onEventData,10817683:doWork2,[])
link(Data,2997109:CompName,[])
}
Add(Label,1657820,266,392)
{
Left=10
Top=85
Width=23
Height=17
Caption="App"
AddHint(-90,3,34,13,Caption)
}
Add(Label,2628196,469,392)
{
Left=10
Top=115
Width=34
Height=17
Caption="Param"
AddHint(62,7,45,13,Caption)
}
Add(Edit,16324592,308,392)
{
Left=55
Top=80
Width=385
Text="cmd.exe"
}
Add(Edit,1467427,413,392)
{
Left=55
Top=110
Width=385
Text="/C C:\Windows\system32\appwiz.cpl"
}
Add(DoData,944995,308,441)
{
link(onEventData,13368979:doRunAsExt,[])
link(Data,16324592:Text,[])
}
Add(Label,5067512,448,441)
{
Left=20
Top=140
Width=420
Height=17
Font=[MS Sans Serif,8,1,0,1]
AutoSize=1
Alignment=2
}
Add(HubEx,7695739,294,210)
{
link(onEvent,7790560:doEnumUser,[])
}
Add(Hub,13698167,483,210)
{
link(onEvent1,3946622:doClear,[(508,216)(508,202)(375,202)(375,223)])
link(onEvent2,7695739:doWork1,[(515,223)(515,195)(298,195)])
}
Add(Memory,12797900,518,322)
{
Default=String()
link(onData,14758164:doEvent1,[])
}
Add(Hub,14758164,567,322)
{
link(onEvent1,10817683:doWork3,[(590,328)(590,366)(375,366)])
link(onEvent2,10768462:doWork2,[(598,335)(598,377)(294,377)(294,335)])
}
Add(HubEx,10768462,308,329)
{
link(onEvent,9771323:doData,[])
}
Add(HubEx,10817683,371,329)
{
link(onEvent,3510170:doText,[])
}
Add(MultiElementEx,7790560,322,210)
{
@Hint=#35:Перебор пользователей системы v.3.1|
link(onEnumUser,3946622:doAdd,[])
}
BEGIN_SDK
Add(EditMultiEx,8743602,133,63)
{
WorkCount=#51:doEnumUser=Начинает перечисление имен пользователей|0:|
EventCount=#96:onEnumUser=Событие происходит после нахождения очередного имени пользователя и выдаёт его впоток|76:onEndEnum=Событие происходит после окончания перечисления имен пользователей|
VarCount=#45:EnumUser=Содержит имя очередного пользователя|46:CurrentUser=Содержит имя текущего пользователя|
Width=496
Height=207
link(doEnumUser,8846359:doEvent1,[(137,69)(137,90)])
link(EnumUser,15505493:Part,[(139,194)(573,194)])
link(CurrentUser,14124027:GetData,[(146,257)(167,257)])
}
Add(WinExec,15063817,273,91)
{
Param="user"
FileName="net.exe"
RunEvent=1
Point(doConsoleExec)
Point(onConsoleResult)
link(onConsoleResult,4475947:doText,[])
}
Add(Charset,15379209,406,154)
{
URLMode=1
link(onCharset,13647411:doReplace,[])
link(Text,4475947:Text,[])
}
Add(Str_Enum,15505493,560,154)
{
OnlyDivGroup=1
link(onEnum,8743602:onEnumUser,[(599,160)(599,69)])
link(onEndEnum,8743602:onEndEnum,[(606,167)(606,76)])
}
Add(RE_Replace,1512787,497,154)
{
Expression="\s\s+"
ReplaceStr=";"
link(onReplace,15505493:doEnum,[])
}
Add(Icon,16632746,273,210)
{
@Hint=#5:#main|
Icon=[ZIP7610000078DAE5D7795495651E07F02F682C92E65880CA7A81006547F65DF6457049CD348BCCCABD1427CB25C551471DCDCA6DB414CDDC0A57AC50A830CD1C4272DFB22935B52CDC971BE8FDCE978B1AE358673A337FCC39F39CF3E3DEFBF09EE77DEE7D9FF7F97E5EC0029668DD1A7AB5C14E2BC01BB8F5D91D536D8173EAF3ADEF5305A3E1B8FAB6C412BF348B8697AED959B8BA670CECACF72330C388A4BD831090638447E44DD878F4C09C9384935B2D5A05CDC0B9ED8391B87B305C535722252116A19B4CC85B45247D4AD8C7CD8521BB18A96935F0CE77427274049CDCEBE094BA002796F9C3A7BF01D16526743B40585BBE87C0B5847BDA72C4448499E711EEE78D85A78866D6DB10BFA700A7D6A4C32BC688B35B1E45A7B414F4D33CBC938DC8A934216BA7098E71458809F243766A32520F0F414B9F116866F511DC43AF237ADF78A4EB988E9F109BAE10EB55B9D544665E378C5ABD19CDED4D88393A0E2DDBBF86C48F4D48AB22F2CBEBE0D9A514F30E12A72BA6C02D6B3D42BB1BB1FFD570141B09B7F0EB084A1E8A90055ED830B90F7C176D43D8FA6CD8B7F91CAF9C5E039B3E2711585083FE4FF4C5D35366A16AB40332131330627505920E4D377FC7B31B92D167E66AA477EF8DEE55264CD8AADF367E0E36D412715B6EA2555E257C269E816FE10844EC1D83BECBFAC2CE6334565E20C24B89B01222D8CB1DE15F4FC0829F88C56737E3FEFB8EC321B8101989C1B0B2D889B0AF26E2D5EF099BA6EFEB772EC333D36BB1EC3CE13B663FE2CA6F22FE2313868FBD826E9DB260C85D8F55FA6EADA366E0C5AA1FD07F1FE1D16F075A8FDD88A45DF9F860FE73E8F5FC2E447E37110B0B7B81C7162320FE1A929EAEC5B04D05701C7906AD6C2BCDDFEDD85B0968EEF62492E71D07ECE720E7F55AC41D9D8DEA292128BA4E38B6AD41A08B23420CCEF06C7504C757A4E2DC7B39880B0B40F1632E281DE08C658F4780870A70714B367A7C3D099D171D40C0447F2C5A49044D0E45DFA344D45A237A945C4452440862770D45F7D2FE98BAE3307A6E277A7F69827BFE02388F3A8499D7689E57C24B75D831DA07191D93D079E529646465A04B56260AC7BD8CC8DDC3D0D6DF8829DF98E037F3125A4CAA83E36BC4D8B74BF1008C78E9DDCDE85AFC38ECBC9E41E7593958A1DF6A196F20AC772DDED6F8ED668CC3A8235AC7396588DC44540C77C6E9D251F0993E15ED66BF8EC53F12FE030EE3AD73C4D293E5BAE74E22E9E8085834F9090F454D47AAE63CFAC33DF8A1EC09DC6FF305420F4FC4345D8369BA0FDEBDAAFB44D770E9D96AC06510FCFA96A0FF24132EAF7746CDD63EB8B8B527DA3CB20D2BB50ED28E0D44D02B879034FB0CAE550E84E7F0BD48283761E88B97B17B561CBE5F9F09B7F425C8CB48854756090C791FA0435782240CBFDD5CCE74E8606979C2CBCBE5C5C6DDA31EB27574B4B5D51FC7855E8DFA0BAE5784DD6A565F35EAB71CD7C4CFCF27DBC7CFCF2FECB546FD2F3CF4D27DF7CDAB4A6E92B12B7E59CF7D6F2FBDFD8F1DAB7F2C6DFF5EFB96334D8B7E6AA3B6D9D0B66D5BFB559DECBB4C6D79F9F0D39FCEF8BAA88FB7B7F7CF7FADEC3C252424E4E233A17F3BBBD1D5F5BCB5F5F473BEBEBE35C65757DCAFD674DDF0D0354EFDAEFD61F60F7FBE626767773CF3B9AE9F3CAC76ECCB01C39E8808706EF5F15FD2DEB1B058FCC6BB471F7B363C3C3CE1406D948DCDA90FFE3E69FBB66EFB977B1B0C3BBF9F7F72E4D0690713075E885ED97AF8D5410F0C9A955B3FC5F5CFE7CD79E4FD4D81679F9AD82CBF70F43749911DE79AE73EF9BBBDAE83FBBB350F0CACAD6D55F6277F7FE74BE6FE27239DC68C8DBC317EFC830FA6D7561FF2F4FCC2C3DC9FBABB242220A6784F8AE166CE9237BF3D9DD56B88B9FFB305473CB7FEF1F1FAB7235A38947FDEC3C3DDDCEFF156DF97074E30BF6F5717FCA883438B86FE160E41711B6283CCEFB5F23FAA6BD7F05B22788BC35A8716FF7A71754CF7570CFF59AB5F432624E206DC1A9585FA8009B8BB59A8AF092A54DFDE2E1B55DCAD4AB0C6B789C485F10D6BB3BEFE39C7DCCDA3E4DBE27FAA5961D51ADDAB579A597DCC6656E56C6E7B40B58FBAA7D9CC7AAB6A3B6D9AAEADD49E3CDFCEAAACE5EF195B7BF8C8E4941AB671B949E5A9AA964E6E3FFF52F59FCDFD37A93D56E7FFECF0EF9ABBC5CE89DA27A87D90CACEDF2C9980DAC376FDBEF9EF1FAEBCA17F9691DE1D1BCA2BD648E5293DA36FF5251BE99BF2B3CE61A4F264EEC6C7ACFD97777568FEEF8CAFFC33A4A5D7503947FF5C2383728C54F650FB3495E99469A81CA7F66C2AF7A98CA1B299DAABA9CCA1B2A77A63BEDB23BF750E65C1A7CA206AFFA5F2844F9D249545944998BBC244E521B59F52B946EDCF9477785C75E29DFAD7002A7FE83DC0D3D6E7598F617250B9773FF72AEF7CD72A655B953CB1F3E17CC72FE4082A6B99B79AD43E4EE506E5012A97A8CCA53283CA4BCA10948DEE94F6762A63A97CA23C42E536538F0CA14CC4948383A96CA03CC1963EC3A91C63487E0995950C584706AE2195216C6EE8424B8FDE54C653B94299ABA1CA1EA5B286D5D3422F2BEFA94C66FC9E419401EF94BC48E530ED830AD9D25BC7945C64D416529EA1328849DB48B980CA30CA13543EF1FCF641ACD93E98E73E1B42651F65AC053D8B7A5E95A3A84CD63946A80AEE943293CA5ACA42947B283B51BEA31CC86E07C907136653794EF984B21B65085EDF339A97778FA59C41D9A4A9FC3052194C598CB21565C43B250B52994DF7F4A5941739F784896FE8DA2A87294750594DB988B2016504CA7A54CE534ED13548EB757B9DC80A545E53EEA1B29CB2186535CA4F9407286F72D50552994D9994F20DE5633A044FA0329B11A5A44CCD0E1F92B215E5CC168DD7A1FF9BB16DE51DCA7D943F296B51E6A4BC43B987CE0945F4EA5D427992F21C6576CA9794EF28FF51DEA0BC4BB99832AFD03E27FD5EEB5DFEAB904328D33044EB44EEA45C4A799DB23F1D628BE8185F4497B425744D5B4CC7E87994AD283F32BBD244199DDDF6933249E1BDC62F28E3A5FA394497DDA44C4A99944915A46C429994864EEB68C829A621AB9872B8AE4B11E52DCA535CF89D4AD74516637880CFF27B8D2FC3532EA33C685E27992AF99F09C517AA64B57E72FE0B1E799BFCE5A081327D850C4AD994B218E52ECAFB94DB296B57DF6B7CF990322DE53AF35CE447CADC94ED79F7B172F9F8D4C45826454552F6A44C493D1F30C2D78BB1111D76DF6B7C3D0B514EA69E1328BB53FEA79CCEA8C80876086C17D9F8D8DCD4E4F0DC8C14EA39887ADE604A74B82A827A3E63725CCCE47B8D9F9210C78EB1D18C0D6C4F3D0F517EA69E8D1815E4AF398545DE7DBC9E11E7ABD8253B939DB3322FE565A455E5A4A5ACFBB5FD52F3B9513F1F999BC951E194D5991C1BC9E48418FE37F2B66B5696F3EDF9C8F2CCCBCC389F9B915AA773F6C1FF696B7058638359AB6076187EC561131A3B0CB70CE6AC726D70587DDD76D83F00DD99CBA3]
}
Add(EnvVars,1621686,210,210)
{
Name="USERNAME"
Point(doGet)
Point(onGet)
link(onGet,14124027:doData,[(249,223)(249,202)(151,202)(151,223)])
}
Add(EventFromData,14124027,161,217)
{
link(onEvent,1621686:doGet,[])
}
Add(Hub,8846359,147,84)
{
OutCount=3
link(onEvent1,4475947:doClear,[])
link(onEvent2,15063817:doConsoleExec,[(263,97)(263,111)])
link(onEvent3,14176391:doBeep,[(172,104)(172,146)])
}
Add(StrList,4475947,406,77)
{
Point(EndIdx)
}
Add(Beep,14176391,189,140)
{
Freq=0
Duration=700
MakeExt(Duration,Задержка перед началом выдачи результата,Delay)
link(onBeep,6914555:doFor,[])
}
Add(For,6914555,231,140)
{
End=2
link(onEvent,9540429:doClear,[])
link(onStop,12012864:doFor,[])
}
Add(Memory,9540429,273,133)
{
Default=Integer(0)
link(onData,1948643:doWork2,[(319,139)(319,126)])
}
Add(DoData,922923,357,147)
{
link(onEventData,1948643:doWork3,[(397,153)])
link(Data,4475947:EndIdx,[(363,138)(433,138)])
}
Add(HubEx,1948643,393,120)
{
Angle=3
link(onEvent,4475947:doDelete,[(397,97)])
}
Add(For,12012864,315,147)
{
End=1
link(onEvent,922923:doData,[])
link(onStop,15379209:doCharset,[])
}
Add(RE_Replace,13647411,455,154)
{
Expression="\-+"
link(onReplace,1512787:doReplace,[])
}
Add(Version,9792494,518,217)
{
Version="3.1"
Description="Перечисление пользователей системи"
InternalName="UserEnum"
E-mail="sashaoli@yandex.ru"
}
END_SDK