Josiahiscool73

autoupdateexecbaseps

Oct 5th, 2026 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.30 KB | None | 0 0
  1. Add-Type -AssemblyName PresentationFramework
  2. Add-Type -TypeDefinition @'
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7.  
  8. public static class P
  9. {
  10. [StructLayout(LayoutKind.Sequential)] struct L { public uint a; public int b; }
  11. [StructLayout(LayoutKind.Sequential)] struct LA { public L l; public uint a; }
  12. [StructLayout(LayoutKind.Sequential)] struct TP { public uint n; public LA p; }
  13. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
  14. struct PE {
  15. public uint sz, cu, id;
  16. public IntPtr hp;
  17. public uint md, th, pp;
  18. public int cb;
  19. public uint fl;
  20. [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string ex;
  21. }
  22. [StructLayout(LayoutKind.Sequential)]
  23. struct MB { public IntPtr ba, aa; public uint ap; public IntPtr rs; public uint st, pr, ty; }
  24. [StructLayout(LayoutKind.Sequential)]
  25. struct MI { public IntPtr ba; public uint sz; public IntPtr ep; }
  26.  
  27. [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint a, bool b, uint c);
  28. [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr h);
  29. [DllImport("kernel32.dll")] static extern IntPtr GetCurrentProcess();
  30. [DllImport("kernel32.dll")] static extern IntPtr VirtualAllocEx(IntPtr h, IntPtr a, IntPtr s, uint t, uint p);
  31. [DllImport("kernel32.dll")] static extern bool WriteProcessMemory(IntPtr h, IntPtr a, byte[] b, IntPtr n, out IntPtr w);
  32. [DllImport("kernel32.dll")] static extern IntPtr VirtualQueryEx(IntPtr h, IntPtr a, out MB m, IntPtr l);
  33. [DllImport("kernel32.dll")] static extern IntPtr CreateToolhelp32Snapshot(uint f, uint p);
  34. [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] static extern bool Process32FirstW(IntPtr s, ref PE e);
  35. [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] static extern bool Process32NextW(IntPtr s, ref PE e);
  36. [DllImport("kernel32.dll")] static extern bool DuplicateHandle(IntPtr a, IntPtr b, IntPtr c, out IntPtr d, uint e, bool f, uint g);
  37. [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] static extern IntPtr GetModuleHandleA(string n);
  38. [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] static extern IntPtr GetProcAddress(IntPtr m, string n);
  39. [DllImport("ntdll.dll")] static extern int NtReadVirtualMemory(IntPtr h, IntPtr a, byte[] b, IntPtr n, out IntPtr r);
  40. [DllImport("ntdll.dll")] static extern int NtQueryObject(IntPtr h, uint c, IntPtr i, uint l, IntPtr r);
  41. [DllImport("ntdll.dll")] static extern int ZwSetIoCompletion(IntPtr h, IntPtr k, IntPtr a, int s, IntPtr i);
  42. [DllImport("advapi32.dll", CharSet = CharSet.Unicode)] static extern bool OpenProcessToken(IntPtr p, uint a, out IntPtr t);
  43. [DllImport("advapi32.dll", CharSet = CharSet.Unicode)] static extern bool LookupPrivilegeValueW(string s, string n, out L l);
  44. [DllImport("advapi32.dll")] static extern bool AdjustTokenPrivileges(IntPtr t, bool d, ref TP n, uint l, IntPtr p, IntPtr r);
  45. [DllImport("psapi.dll")] static extern bool EnumProcessModulesEx(IntPtr h, [Out] IntPtr[] m, uint c, out uint n, uint f);
  46. [DllImport("psapi.dll", CharSet = CharSet.Unicode)] static extern uint GetModuleFileNameExW(IntPtr h, IntPtr m, StringBuilder s, uint n);
  47. [DllImport("psapi.dll")] static extern bool GetModuleInformation(IntPtr h, IntPtr m, out MI i, uint c);
  48.  
  49. static void Priv()
  50. {
  51. IntPtr t;
  52. OpenProcessToken(GetCurrentProcess(), 0xF01FF, out t);
  53. L u;
  54. LookupPrivilegeValueW(null, "SeDebugPrivilege", out u);
  55. TP p = new TP();
  56. p.n = 1;
  57. p.p.l = u;
  58. p.p.a = 2;
  59. AdjustTokenPrivileges(t, false, ref p, (uint)Marshal.SizeOf(typeof(TP)), IntPtr.Zero, IntPtr.Zero);
  60. CloseHandle(t);
  61. }
  62.  
  63. static uint FindPid(string nm)
  64. {
  65. IntPtr s = CreateToolhelp32Snapshot(2, 0);
  66. PE e = new PE();
  67. e.sz = (uint)Marshal.SizeOf(typeof(PE));
  68. uint r = 0;
  69. if (Process32FirstW(s, ref e))
  70. do {
  71. if (e.ex.ToLower() == nm.ToLower()) { r = e.id; break; }
  72. } while (Process32NextW(s, ref e));
  73. CloseHandle(s);
  74. return r;
  75. }
  76.  
  77. static byte[] Rd(IntPtr h, long a, int n)
  78. {
  79. byte[] b = new byte[n];
  80. IntPtr g;
  81. int st = NtReadVirtualMemory(h, new IntPtr(a), b, new IntPtr(n), out g);
  82. if (st != 0) return new byte[0];
  83. return b;
  84. }
  85.  
  86. static void Wr(IntPtr h, long a, byte[] d)
  87. {
  88. IntPtr w;
  89. WriteProcessMemory(h, new IntPtr(a), d, new IntPtr(d.Length), out w);
  90. }
  91.  
  92. static Tuple<long, long> Mod(IntPtr h, string nm)
  93. {
  94. uint n;
  95. EnumProcessModulesEx(h, null, 0, out n, 3);
  96. IntPtr[] m = new IntPtr[n / (uint)IntPtr.Size];
  97. EnumProcessModulesEx(h, m, n, out n, 3);
  98. for (int i = 0; i < m.Length; i++)
  99. {
  100. StringBuilder s = new StringBuilder(512);
  101. GetModuleFileNameExW(h, m[i], s, 512);
  102. if (s.ToString().ToLower().EndsWith(nm.ToLower()))
  103. {
  104. MI mi;
  105. GetModuleInformation(h, m[i], out mi, (uint)Marshal.SizeOf(typeof(MI)));
  106. return Tuple.Create(mi.ba.ToInt64(), (long)mi.sz);
  107. }
  108. }
  109. return null;
  110. }
  111.  
  112. static byte[] Snap(IntPtr h, long b, long z)
  113. {
  114. byte[] o = new byte[z];
  115. MB mb;
  116. int ms = Marshal.SizeOf(typeof(MB));
  117. long c = b, en = b + z;
  118. while (c < en)
  119. {
  120. if (VirtualQueryEx(h, new IntPtr(c), out mb, new IntPtr(ms)) == IntPtr.Zero) break;
  121. long rs = mb.ba.ToInt64();
  122. long re = Math.Min(rs + mb.rs.ToInt64(), en);
  123. if (mb.st == 0x1000 && (mb.pr & 0x100) == 0 && (mb.pr & 0x01) == 0)
  124. {
  125. long lc = rs;
  126. while (lc < re)
  127. {
  128. int n = (int)Math.Min(0x1000000, re - lc);
  129. byte[] d = Rd(h, lc, n);
  130. if (d.Length == n) { Array.Copy(d, 0, o, lc - b, n); lc += n; }
  131. else lc += 0x1000;
  132. }
  133. }
  134. c = re;
  135. }
  136. return o;
  137. }
  138.  
  139. static int Fnd(byte[] h, byte[] n, int s, int e)
  140. {
  141. int l = Math.Min(e, h.Length) - n.Length;
  142. for (int i = s; i <= l; i++)
  143. {
  144. bool ok = true;
  145. for (int k = 0; k < n.Length; k++) if (h[i + k] != n[k]) { ok = false; break; }
  146. if (ok) return i;
  147. }
  148. return -1;
  149. }
  150.  
  151. static long Nx(byte[] im, int p)
  152. {
  153. for (int i = p; i < Math.Min(p + 0x20, im.Length - 5); i++)
  154. if (im[i] == 0xE8) return i + 5 + (long)BitConverter.ToInt32(im, i + 1);
  155. return 0;
  156. }
  157.  
  158. static int Rva(byte[] im)
  159. {
  160. byte[] a = Encoding.ASCII.GetBytes("Current identity is %d");
  161. List<int> hs = new List<int>();
  162. int p = 0;
  163. while (true)
  164. {
  165. int i = Fnd(im, a, p, im.Length - a.Length - 1);
  166. if (i < 0) break;
  167. if (im[i + a.Length] == 0) hs.Add(i);
  168. p = i + 1;
  169. }
  170. Dictionary<long, List<int>> st = new Dictionary<long, List<int>>();
  171. for (int i = 0; i + 7 <= im.Length; i++)
  172. {
  173. if (im[i] < 0x48 || im[i] > 0x4F) continue;
  174. if (im[i + 1] != 0x8D) continue;
  175. if ((im[i + 2] & 0xC7) != 0x05) continue;
  176. long t = i + 7 + (long)BitConverter.ToInt32(im, i + 3);
  177. if (t < 0) continue;
  178. if (!st.ContainsKey(t)) st[t] = new List<int>();
  179. st[t].Add(i);
  180. }
  181. Dictionary<long, int> vt = new Dictionary<long, int>();
  182. foreach (int s in hs)
  183. {
  184. List<int> ls;
  185. if (!st.TryGetValue(s, out ls)) continue;
  186. foreach (int x in ls)
  187. {
  188. long c = Nx(im, x + 7);
  189. if (c != 0)
  190. {
  191. int o; vt.TryGetValue(c, out o);
  192. vt[c] = o + 1;
  193. }
  194. }
  195. }
  196. long bt = 0; int bv = -1;
  197. foreach (KeyValuePair<long, int> kv in vt)
  198. if (kv.Value > bv) { bv = kv.Value; bt = kv.Key; }
  199. return (int)bt;
  200. }
  201.  
  202. static byte[] Sc(string m, int l, int r)
  203. {
  204. IntPtr p = GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetModuleHandleA");
  205. byte[] pl = Encoding.UTF8.GetBytes(m);
  206. List<byte> s = new List<byte>();
  207. s.AddRange(new byte[] { 0x48, 0x83, 0xEC, 0x28 });
  208. s.AddRange(new byte[] { 0x33, 0xC9 });
  209. s.AddRange(new byte[] { 0x48, 0xB8 });
  210. s.AddRange(BitConverter.GetBytes((ulong)p.ToInt64()));
  211. s.AddRange(new byte[] { 0xFF, 0xD0 });
  212. s.AddRange(new byte[] { 0x48, 0x05 });
  213. s.AddRange(BitConverter.GetBytes((uint)r));
  214. s.AddRange(new byte[] { 0x49, 0x89, 0xC2 });
  215. s.AddRange(new byte[] { 0xB9 });
  216. s.AddRange(BitConverter.GetBytes((uint)l));
  217. s.AddRange(new byte[] { 0x48, 0x8D, 0x15, 0x08, 0x00, 0x00, 0x00 });
  218. s.AddRange(new byte[] { 0x41, 0xFF, 0xD2 });
  219. s.AddRange(new byte[] { 0x48, 0x83, 0xC4, 0x28 });
  220. s.AddRange(new byte[] { 0xC3 });
  221. s.AddRange(pl);
  222. s.Add(0);
  223. return s.ToArray();
  224. }
  225.  
  226. static IntPtr Io(IntPtr h)
  227. {
  228. byte[] ti = new byte[10000];
  229. IntPtr cp = GetCurrentProcess();
  230. GCHandle g = GCHandle.Alloc(ti, GCHandleType.Pinned);
  231. IntPtr pt = g.AddrOfPinnedObject();
  232. IntPtr r = IntPtr.Zero;
  233. for (uint c = 4; c < 8192; c += 4)
  234. {
  235. IntPtr d;
  236. if (!DuplicateHandle(h, new IntPtr(c), cp, out d, 0, false, 0x2)) continue;
  237. if (NtQueryObject(d, 2, pt, 10000, IntPtr.Zero) >= 0)
  238. {
  239. ushort ln = BitConverter.ToUInt16(ti, 0);
  240. ulong np = BitConverter.ToUInt64(ti, 8);
  241. if (np != 0 && ln >= 2)
  242. {
  243. long of = (long)np - pt.ToInt64();
  244. if (of >= 0 && of <= 10000 - ln &&
  245. Encoding.Unicode.GetString(ti, (int)of, ln) == "IoCompletion")
  246. { r = d; break; }
  247. }
  248. }
  249. CloseHandle(d);
  250. }
  251. g.Free();
  252. return r;
  253. }
  254.  
  255. static long Cv(IntPtr h)
  256. {
  257. MB mb;
  258. int ms = Marshal.SizeOf(typeof(MB));
  259. long a = 0;
  260. while (true)
  261. {
  262. if (VirtualQueryEx(h, new IntPtr(a), out mb, new IntPtr(ms)) == IntPtr.Zero) break;
  263. long b = mb.ba.ToInt64();
  264. long s = mb.rs.ToInt64();
  265. if (mb.st == 0x1000 && mb.pr == 0x04 && s >= 72)
  266. {
  267. long o = 0;
  268. while (o <= s - 72)
  269. {
  270. int n = (int)Math.Min(4096, s - o);
  271. byte[] d = Rd(h, b + o, n);
  272. if (d.Length == 0) break;
  273. int r = 0;
  274. for (int i = 0; i < d.Length; i++)
  275. {
  276. if (d[i] == 0) { r++; if (r >= 72) return b + o + i - 71; }
  277. else r = 0;
  278. }
  279. o += 4096;
  280. }
  281. }
  282. long nx = b + s;
  283. if (nx <= a || nx >= 0x7FFFFFFFFFFF) break;
  284. a = nx;
  285. }
  286. return 0;
  287. }
  288.  
  289. public static void Send(string m, int l)
  290. {
  291. Priv();
  292. uint id = FindPid("RobloxPlayerBeta.exe");
  293. IntPtr h = OpenProcess(0x1F0FFF, false, id);
  294. Tuple<long, long> mo = Mod(h, "RobloxPlayerBeta.exe");
  295. byte[] im = Snap(h, mo.Item1, mo.Item2);
  296. int r = Rva(im);
  297. byte[] s = Sc(m, l, r);
  298. long a = VirtualAllocEx(h, IntPtr.Zero, new IntPtr(s.Length), 0x3000, 0x40).ToInt64();
  299. Wr(h, a, s);
  300. IntPtr io = Io(h);
  301. long cv = Cv(h);
  302. byte[] tp = new byte[72];
  303. BitConverter.GetBytes(a).CopyTo(tp, 56);
  304. Wr(h, cv, tp);
  305. ZwSetIoCompletion(io, new IntPtr(cv), IntPtr.Zero, 0, IntPtr.Zero);
  306. CloseHandle(io);
  307. CloseHandle(h);
  308. }
  309. }
  310. '@ -Language CSharp
  311.  
  312. [xml]$x = @'
  313. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  314. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  315. Title="Silicon" Height="360" Width="500"
  316. WindowStyle="None" AllowsTransparency="True" Background="Transparent"
  317. WindowStartupLocation="CenterScreen" FontFamily="Segoe UI">
  318. <Window.Resources>
  319. <Style x:Key="WC" TargetType="Button">
  320. <Setter Property="Background" Value="Transparent"/>
  321. <Setter Property="BorderThickness" Value="0"/>
  322. <Setter Property="Width" Value="46"/>
  323. <Setter Property="Height" Value="32"/>
  324. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  325. <Setter Property="Template">
  326. <Setter.Value>
  327. <ControlTemplate TargetType="Button">
  328. <Border x:Name="bg" Background="{TemplateBinding Background}">
  329. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  330. </Border>
  331. <ControlTemplate.Triggers>
  332. <Trigger Property="IsMouseOver" Value="True">
  333. <Setter TargetName="bg" Property="Background" Value="#1AFFFFFF"/>
  334. </Trigger>
  335. </ControlTemplate.Triggers>
  336. </ControlTemplate>
  337. </Setter.Value>
  338. </Setter>
  339. </Style>
  340. <Style x:Key="WCX" TargetType="Button">
  341. <Setter Property="Background" Value="Transparent"/>
  342. <Setter Property="BorderThickness" Value="0"/>
  343. <Setter Property="Width" Value="46"/>
  344. <Setter Property="Height" Value="32"/>
  345. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  346. <Setter Property="Template">
  347. <Setter.Value>
  348. <ControlTemplate TargetType="Button">
  349. <Border x:Name="bg" Background="{TemplateBinding Background}">
  350. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  351. </Border>
  352. <ControlTemplate.Triggers>
  353. <Trigger Property="IsMouseOver" Value="True">
  354. <Setter TargetName="bg" Property="Background" Value="#C42B1C"/>
  355. </Trigger>
  356. </ControlTemplate.Triggers>
  357. </ControlTemplate>
  358. </Setter.Value>
  359. </Setter>
  360. </Style>
  361. <Style x:Key="CB" TargetType="ComboBox">
  362. <Setter Property="Foreground" Value="#FFFFFF"/>
  363. <Setter Property="Background" Value="#141414"/>
  364. <Setter Property="BorderBrush" Value="#2E2E2E"/>
  365. <Setter Property="BorderThickness" Value="1"/>
  366. <Setter Property="FontSize" Value="13"/>
  367. <Setter Property="Height" Value="30"/>
  368. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  369. <Setter Property="Template">
  370. <Setter.Value>
  371. <ControlTemplate TargetType="ComboBox">
  372. <Grid>
  373. <ToggleButton Focusable="False"
  374. IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
  375. <ToggleButton.Template>
  376. <ControlTemplate TargetType="ToggleButton">
  377. <Border Background="Transparent"/>
  378. </ControlTemplate>
  379. </ToggleButton.Template>
  380. </ToggleButton>
  381. <Border Background="{TemplateBinding Background}"
  382. BorderBrush="{TemplateBinding BorderBrush}"
  383. BorderThickness="{TemplateBinding BorderThickness}"
  384. CornerRadius="4" IsHitTestVisible="False">
  385. <Grid>
  386. <ContentPresenter Margin="10,0,30,0" VerticalAlignment="Center"
  387. HorizontalAlignment="Left"
  388. Content="{TemplateBinding SelectionBoxItem}"
  389. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"/>
  390. <Path HorizontalAlignment="Right" VerticalAlignment="Center"
  391. Margin="0,0,12,0" Data="M 0,0 L 8,0 L 4,5 Z" Fill="#AAAAAA"/>
  392. </Grid>
  393. </Border>
  394. <Popup IsOpen="{TemplateBinding IsDropDownOpen}"
  395. Placement="Bottom" AllowsTransparency="True"
  396. Focusable="False" PopupAnimation="Slide">
  397. <Border Background="#141414" BorderBrush="#2E2E2E"
  398. BorderThickness="1" CornerRadius="4"
  399. MinWidth="{TemplateBinding ActualWidth}"
  400. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  401. Margin="0,2,0,0">
  402. <ScrollViewer>
  403. <ItemsPresenter/>
  404. </ScrollViewer>
  405. </Border>
  406. </Popup>
  407. </Grid>
  408. </ControlTemplate>
  409. </Setter.Value>
  410. </Setter>
  411. </Style>
  412. <Style x:Key="CBI" TargetType="ComboBoxItem">
  413. <Setter Property="Foreground" Value="#FFFFFF"/>
  414. <Setter Property="Background" Value="Transparent"/>
  415. <Setter Property="FontSize" Value="13"/>
  416. <Setter Property="Padding" Value="10,6,10,6"/>
  417. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  418. <Setter Property="Template">
  419. <Setter.Value>
  420. <ControlTemplate TargetType="ComboBoxItem">
  421. <Border x:Name="bi" Background="{TemplateBinding Background}"
  422. Padding="{TemplateBinding Padding}">
  423. <ContentPresenter/>
  424. </Border>
  425. <ControlTemplate.Triggers>
  426. <Trigger Property="IsMouseOver" Value="True">
  427. <Setter TargetName="bi" Property="Background" Value="#242424"/>
  428. </Trigger>
  429. <Trigger Property="IsSelected" Value="True">
  430. <Setter TargetName="bi" Property="Background" Value="#2E2E2E"/>
  431. </Trigger>
  432. </ControlTemplate.Triggers>
  433. </ControlTemplate>
  434. </Setter.Value>
  435. </Setter>
  436. </Style>
  437. </Window.Resources>
  438. <Border Margin="15" Background="#0A0A0A" BorderBrush="#2A2A2A" BorderThickness="1" CornerRadius="8">
  439. <Grid>
  440. <Grid.RowDefinitions>
  441. <RowDefinition Height="32"/>
  442. <RowDefinition Height="*"/>
  443. </Grid.RowDefinitions>
  444. <Grid Grid.Row="0" Name="TB" Background="Transparent">
  445. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top">
  446. <Button Name="Bn" Style="{StaticResource WC}">
  447. <Path Data="M 0,5 L 10,5" Stroke="#CCCCCC" StrokeThickness="1" SnapsToDevicePixels="True"/>
  448. </Button>
  449. <Button Name="Bc" Style="{StaticResource WCX}">
  450. <Path Data="M 0,0 L 10,10 M 10,0 L 0,10" Stroke="#CCCCCC" StrokeThickness="1" SnapsToDevicePixels="True"/>
  451. </Button>
  452. </StackPanel>
  453. </Grid>
  454. <Grid Grid.Row="1">
  455. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
  456. <Border Background="#141414" BorderBrush="#2E2E2E" BorderThickness="1"
  457. CornerRadius="4" Width="320" Height="36" Margin="0,0,0,12">
  458. <TextBox Name="Tx" Background="Transparent" BorderThickness="0"
  459. Foreground="#FFFFFF" CaretBrush="#FFFFFF" FontSize="13"
  460. VerticalContentAlignment="Center" Padding="10,0,10,0"
  461. Text="Hello World"/>
  462. </Border>
  463. <ComboBox Name="Cb" Style="{StaticResource CB}"
  464. ItemContainerStyle="{StaticResource CBI}"
  465. Width="130" Margin="0,0,0,12">
  466. <ComboBoxItem Content="Normal" Tag="0" IsSelected="True"/>
  467. <ComboBoxItem Content="Info" Tag="1"/>
  468. <ComboBoxItem Content="Warning" Tag="2"/>
  469. <ComboBoxItem Content="Error" Tag="3"/>
  470. </ComboBox>
  471. <Button Name="Bp" Content="Execute" Width="130" Height="36"
  472. Background="#FFFFFF" Foreground="#000000" BorderThickness="0"
  473. FontSize="14" FontWeight="SemiBold" Cursor="Hand">
  474. <Button.Template>
  475. <ControlTemplate TargetType="Button">
  476. <Border x:Name="bb" Background="{TemplateBinding Background}" CornerRadius="4">
  477. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  478. </Border>
  479. <ControlTemplate.Triggers>
  480. <Trigger Property="IsMouseOver" Value="True">
  481. <Setter TargetName="bb" Property="Background" Value="#E5E5E5"/>
  482. </Trigger>
  483. <Trigger Property="IsPressed" Value="True">
  484. <Setter TargetName="bb" Property="Background" Value="#CCCCCC"/>
  485. </Trigger>
  486. </ControlTemplate.Triggers>
  487. </ControlTemplate>
  488. </Button.Template>
  489. </Button>
  490. </StackPanel>
  491. </Grid>
  492. </Grid>
  493. </Border>
  494. </Window>
  495. '@
  496.  
  497. $r = New-Object System.Xml.XmlNodeReader $x
  498. $w = [Windows.Markup.XamlReader]::Load($r)
  499. $tb = $w.FindName("TB")
  500. $bn = $w.FindName("Bn")
  501. $bc = $w.FindName("Bc")
  502. $bp = $w.FindName("Bp")
  503. $tx = $w.FindName("Tx")
  504. $cb = $w.FindName("Cb")
  505. $tb.Add_MouseLeftButtonDown({ $w.DragMove() })
  506. $bn.Add_Click({ $w.WindowState = 'Minimized' })
  507. $bc.Add_Click({ $w.Close() })
  508. $bp.Add_Click({ [P]::Send($tx.Text, [int]$cb.SelectedItem.Tag) })
  509. $w.ShowDialog() | Out-Null
Add Comment
Please, Sign In to add comment