├── Invoke-Manifesto.ps1
├── Manifesto.sln
├── ManifestoGUI
├── App.config
├── Engine.cs
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── ManifestInfo.cs
├── ManifestoGUI.csproj
├── NativeAPI.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── ResourceManager.cs
└── Resources
│ └── search (1).png
└── README.md
/Invoke-Manifesto.ps1:
--------------------------------------------------------------------------------
1 |
2 | function Invoke-Manifesto
3 | {
4 | <#
5 | .SYNOPSIS
6 | Get information from filest with Manifest
7 | Author: Eviatar Gerzi (@g3rzi)
8 | License: Free
9 | Required Dependencies: None
10 | Optional Dependencies: None
11 |
12 | Version 1.1: 9.2.2019
13 | - Added more examples and usage information
14 |
15 | Version 1.0: 4.3.2018
16 |
17 | .DESCRIPTION
18 |
19 | .PARAMETER FolderPath
20 | The folder where to search for the files' manifests
21 |
22 | .PARAMETER Recursive
23 | Search recursively inside the subfolders
24 |
25 | .PARAMETER asInvoker
26 | Search for manifests with Level = asInvoker
27 |
28 | .PARAMETER requireAdministrator
29 | Search for manifests with Level = requireAdministrator
30 |
31 | .PARAMETER highestAvailable
32 | Search for manifests with Level = highestAvailable
33 |
34 | .PARAMETER uiAccessTrue
35 | Search for manifests with uiAccess = True
36 |
37 | .PARAMETER uiAccessFalse
38 | Search for manifests with uiAccess = False
39 |
40 | .PARAMETER autoElevateTrue
41 | Search for manifests with uiAccess = True
42 |
43 | .PARAMETER autoElevateFalse
44 | Search for manifests with uiAccess = False
45 |
46 | .PARAMETER dpiAwareTrue
47 | Search for manifests with uiAccess = True
48 |
49 | .PARAMETER dpiAwareFalse
50 | Search for manifests with uiAccess = False
51 |
52 | .EXAMPLE
53 | Invoke-Manifesto -FolderPath "C:\Windows\system32" -uiAccessTrue
54 |
55 | .EXAMPLE
56 | Invoke-Manifesto -FolderPath "C:\Windows\system32" -uiAccessTrue -Recursive
57 | #>
58 |
59 | [CmdletBinding()]
60 | param
61 | (
62 | [Parameter(
63 | Mandatory = $true,
64 | ParameterSetName = 'FolderPath')
65 | ]
66 | [string]$FolderPath,
67 | [switch]$Recursive = $false,
68 | [switch]$asInvoker,
69 | [switch]$requireAdministrator,
70 | [switch]$highestAvailable,
71 | [switch]$uiAccessTrue,
72 | [switch]$uiAccessFalse,
73 | [switch]$autoElevateTrue,
74 | [switch]$autoElevateFalse,
75 | [switch]$dpiAwareTrue,
76 | [switch]$dpiAwareFalse
77 | )
78 |
79 | $code = @"
80 | using System;
81 | using System.Runtime.InteropServices;
82 | using System.Text;
83 | namespace ManifestoPowershell
84 | {
85 | public class NativeAPI
86 | {
87 | [System.Flags]
88 | public enum LoadLibraryFlags : uint
89 | {
90 | DONT_RESOLVE_DLL_REFERENCES = 0x00000001,
91 | LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x00000010,
92 | LOAD_LIBRARY_AS_DATAFILE = 0x00000002,
93 | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x00000040,
94 | LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020,
95 | LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x00000200,
96 | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000,
97 | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100,
98 | LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800,
99 | LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400,
100 | LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008
101 | }
102 |
103 | public const uint RT_MANIFEST = 24;
104 | public const uint CREATEPROCESS_MANIFEST_RESOURCE_ID = 1;
105 |
106 |
107 | [DllImport("kernel32.dll", SetLastError = true)]
108 | public static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hReservedNull, LoadLibraryFlags dwFlags);
109 |
110 | [DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
111 | public static extern IntPtr LoadLibrary(string lpFileName);
112 |
113 | [DllImport("kernel32.dll", SetLastError = true)]
114 | public static extern IntPtr FindResource(IntPtr hModule, uint lpName, uint lpType);
115 | // public static extern IntPtr FindResource(IntPtr hModule, int lpName, uint lpType);
116 |
117 | [DllImport("kernel32.dll", SetLastError = true)]
118 | public static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResInfo);
119 |
120 | [DllImport("kernel32.dll", SetLastError = true)]
121 | public static extern IntPtr LockResource(IntPtr hResData);
122 |
123 | [DllImport("kernel32.dll", SetLastError = true)]
124 | public static extern uint SizeofResource(IntPtr hModule, IntPtr hResInfo);
125 |
126 | [DllImport("kernel32.dll", SetLastError = true)]
127 | public static extern bool EnumResourceNames(IntPtr hModule, string lpType, IntPtr lpEnumFunc, IntPtr lParam);
128 |
129 | }
130 |
131 | public class ResourceManager
132 | {
133 | public static byte[] GetResourceFromExecutable(string lpFileName, uint lpName, uint lpType)
134 | {
135 | IntPtr hModule = NativeAPI.LoadLibraryEx(lpFileName, IntPtr.Zero, NativeAPI.LoadLibraryFlags.LOAD_LIBRARY_AS_DATAFILE);
136 | if (hModule != IntPtr.Zero)
137 | {
138 | IntPtr hResource = NativeAPI.FindResource(hModule, lpName, lpType);
139 | if (hResource != IntPtr.Zero)
140 | {
141 | uint resSize = NativeAPI.SizeofResource(hModule, hResource);
142 | IntPtr resData = NativeAPI.LoadResource(hModule, hResource);
143 | if (resData != IntPtr.Zero)
144 | {
145 | byte[] uiBytes = new byte[resSize];
146 | IntPtr ipMemorySource = NativeAPI.LockResource(resData);
147 | Marshal.Copy(ipMemorySource, uiBytes, 0, (int)resSize);
148 | return uiBytes;
149 | }
150 | }
151 | }
152 | return null;
153 | }
154 | }
155 |
156 | }
157 | "@
158 |
159 | $location = [PsObject].Assembly.Location
160 | $compileParams = New-Object System.CodeDom.Compiler.CompilerParameters
161 | $assemblyRange = @("System.dll", $location)
162 | $compileParams.ReferencedAssemblies.AddRange($assemblyRange)
163 | $compileParams.GenerateInMemory = $True
164 | Add-Type -TypeDefinition $code -CompilerParameters $compileParams -passthru | Out-Null
165 |
166 |
167 | #$filePath = "C:\Windows\System32\calc.exe"
168 | function Get-ManifestInfo($filePath)
169 | {
170 | $manifestInfo = $null
171 | try
172 | {
173 | $bytes = [ManifestoPowershell.ResourceManager]::GetResourceFromExecutable($filePath, [ManifestoPowershell.NativeAPI]::CREATEPROCESS_MANIFEST_RESOURCE_ID, [ManifestoPowershell.NativeAPI]::RT_MANIFEST)
174 | # Some files were UTF8 BOM. Trying to encode it without BOM
175 | # $enc= New-Object System.Text.UTF8Encoding $False
176 | # Didn't help.
177 | # Solved it by removing the first three bytes: 239, 187, 191
178 | if($bytes[0] -eq 239)
179 | {
180 | $first, $second, $third, $bytes = $bytes
181 | }
182 |
183 |
184 | if($bytes -ne $null)
185 | {
186 | $enc = [system.Text.Encoding]::UTF8
187 |
188 |
189 | $encodedString = $enc.GetString($bytes)
190 | try{
191 |
192 | $manifestInfo = New-Object psobject
193 | # " to type "System.Xml.XmlDocument". Error: "'asmv3' is an undeclared prefix. Line 15, position 6."
194 | # C:\Windows\system32\changepk.exe
195 | $xml = [xml]$encodedString
196 |
197 | $requestedExecutionLevel = $xml.GetElementsByTagName("requestedExecutionLevel")
198 |
199 | <#$properties = @{'level'= "";
200 | 'uiAccess'= "";
201 | 'autoElevate'= "";
202 | 'dpiAware'=""}
203 | $manifestInfo = New-Object psobject –Prop $properties
204 | #>
205 |
206 | $manifestInfo | Add-Member -MemberType NoteProperty -Name "FileName" -Value $filePath
207 | foreach($attr in $requestedExecutionLevel.Attributes)
208 | {
209 | $manifestInfo | Add-Member -MemberType NoteProperty -Name $attr.Name -Value $attr.Value
210 | }
211 |
212 | $manifestInfo | Add-Member -MemberType NoteProperty -Name "autoElevate" -Value ($xml.GetElementsByTagName("autoElevate")).'#text'
213 | $manifestInfo | Add-Member -MemberType NoteProperty -Name "dpiAware" -Value ($xml.GetElementsByTagName("dpiAware")).'#text'
214 | }
215 | catch
216 | {
217 | $manifestInfo | Add-Member -MemberType NoteProperty -Name "autoElevate" -Value $encodedString
218 | }
219 | }
220 | }
221 | catch
222 | {
223 | # No manifest resource
224 | }
225 |
226 | return $manifestInfo
227 | }
228 |
229 | function Count-FindingInfo($flag, $flagName, $infoField, [ref]$found)
230 | {
231 | if($flag -and $infoField -ne $null -and $infoField.ToLower() -eq $flagName.ToLower())
232 | {
233 | $found.value++
234 | }
235 | }
236 |
237 | function Is-Filtered($info)
238 | {
239 | $isAllowed = $false
240 | $shouldFound = 0
241 | $found = 0
242 |
243 | if($asInvoker -or $requireAdministrator -or $highestAvailable)
244 | {
245 | $shouldFound++
246 | Count-FindingInfo $asInvoker "asInvoker" $info.Level ([ref]$found)
247 | Count-FindingInfo $requireAdministrator "requireAdministrator" $info.Level ([ref]$found)
248 | Count-FindingInfo $highestAvailable "highestAvailable" $info.Level ([ref]$found)
249 | }
250 |
251 | if($uiAccessTrue -or $uiAccessFalse)
252 | {
253 | $shouldFound++
254 | Count-FindingInfo $uiAccessTrue "true" $info.uiAccess ([ref]$found)
255 | Count-FindingInfo $uiAccessFalse "false" $info.uiAccess ([ref]$found)
256 | }
257 |
258 | if($autoElevateTrue -or $autoElevateFalse)
259 | {
260 | $shouldFound++
261 | Count-FindingInfo $autoElevateTrue "true" $info.autoElevate ([ref]$found)
262 | Count-FindingInfo $autoElevateFalse "false" $info.autoElevate ([ref]$found)
263 | }
264 |
265 | if($dpiAwareTrue -or $dpiAwareFalse)
266 | {
267 | $shouldFound++
268 | Count-FindingInfo $dpiAwareTrue "true/PM" $info.dpiAware ([ref]$found)
269 | Count-FindingInfo $dpiAwareTrue "true" $info.dpiAware ([ref]$found)
270 | Count-FindingInfo $dpiAwareFalse "false" $info.dpiAware ([ref]$found)
271 | }
272 |
273 | if($shouldFound -eq $found){
274 | $isAllowed = $true
275 | }
276 |
277 | return $isAllowed
278 | }
279 |
280 | function Main($file)
281 | {
282 | $info = Get-ManifestInfo $file
283 |
284 | if(($info -ne $null) -and ([System.String]::Empty -ne ($info.Level + $info.uiAccess + $info.autoElevate + $info.dpiAware)))
285 | {
286 | if(Is-Filtered $info)
287 | {
288 | $info | fl *
289 | }
290 | }
291 | }
292 |
293 | if($Recursive)
294 | {
295 | Get-ChildItem $FolderPath -Filter *.exe -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
296 | try
297 | {
298 | Main $_.FullName
299 | }
300 | catch
301 | {
302 | $a = 3
303 |
304 | }
305 | }
306 | }
307 | else
308 | {
309 | Get-ChildItem $FolderPath -Filter *.exe | ForEach-Object {
310 | Main $_.FullName
311 | }
312 | }
313 | }
--------------------------------------------------------------------------------
/Manifesto.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManifestoGUI", "ManifestoGUI\ManifestoGUI.csproj", "{C4965C31-B851-4A79-9FDB-340B5F327C39}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C4965C31-B851-4A79-9FDB-340B5F327C39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C4965C31-B851-4A79-9FDB-340B5F327C39}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C4965C31-B851-4A79-9FDB-340B5F327C39}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C4965C31-B851-4A79-9FDB-340B5F327C39}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/ManifestoGUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ManifestoGUI/Engine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Xml;
7 |
8 | namespace Manifesto
9 | {
10 | class Engine
11 | {
12 | public static ManifestInfo GetManifestInfo(string filepath)
13 | {
14 | //filepath = @"C:\windows\explorer.exe";
15 | //filepath = @"C:\windows\bfsvc.exe";
16 | //filepath = @"C:\windows\system32\dccw.exe";
17 | //filepath = @"C:\Windows\System32\changepk.exe"; //fails with "'asmv3' is an undeclared prefix. Line 15, position 6."
18 |
19 | // Add check Count >= because of filepath = @"C:\Windows\system32\wscript.exe"; out of index
20 | //filepath = @"C:\Windows\system32\compact.exe";
21 | ManifestInfo info = null;
22 | byte[] resource = ResourceManager.GetResourceFromExecutable(filepath, NativeAPI.CREATEPROCESS_MANIFEST_RESOURCE_ID, NativeAPI.RT_MANIFEST);
23 |
24 | if(resource != null)
25 | {
26 | try
27 | {
28 | XmlDocument doc = new XmlDocument();
29 | string xml = Encoding.UTF8.GetString(resource);
30 | if (xml.Contains("asmv3"))
31 | {
32 | xml = (xml.Replace("asmv3:application", "asmv3")).Replace("asmv3:windowsSettings", "asmv3");
33 | }
34 | // If the XML starts with BOM we should remove the first byte
35 | // https://stackoverflow.com/a/27743515
36 | string byteOrderMarkUtf8 = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
37 | if(xml.StartsWith(byteOrderMarkUtf8, StringComparison.Ordinal))
38 | {
39 | xml = xml.Remove(0, byteOrderMarkUtf8.Length);
40 | }
41 | doc.LoadXml(xml);
42 | XmlNodeList list = doc.GetElementsByTagName("requestedExecutionLevel");
43 |
44 | info = new ManifestInfo();
45 | if(list.Count != 0)
46 | {
47 | if (list[0].Attributes.Count >= 1 && list[0].Attributes[0].Name.Equals("level"))
48 | {
49 | info.Level = list[0].Attributes[0].Value;
50 | }
51 |
52 | if (list[0].Attributes.Count >= 2 && list[0].Attributes[1].Name.Equals("uiAccess"))
53 | {
54 | info.uiAccess = list[0].Attributes[1].Value;
55 | }
56 |
57 | list = doc.GetElementsByTagName("dpiAware");
58 | if (list.Count != 0)
59 | {
60 | info.dpiAware = list[0].InnerText;
61 | }
62 |
63 | list = doc.GetElementsByTagName("autoElevate");
64 | if (list.Count != 0)
65 | {
66 | info.autoElevate = list[0].InnerText;
67 | }
68 | }
69 | }
70 | catch (Exception ex)
71 | {
72 | Console.WriteLine("Exception with file: {0}", filepath);
73 | Console.WriteLine("Message: {0}", ex.Message);
74 | Console.WriteLine();
75 | }
76 | }
77 |
78 | return info;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/ManifestoGUI/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace ManifestoGUI
4 | {
5 | partial class Form1
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private System.ComponentModel.IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 | base.Dispose(disposing);
23 | }
24 |
25 | #region Windows Form Designer generated code
26 |
27 | ///
28 | /// Required method for Designer support - do not modify
29 | /// the contents of this method with the code editor.
30 | ///
31 | private void InitializeComponent()
32 | {
33 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
34 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
35 | this.FileColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
36 | this.LevelColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
37 | this.uiAccessColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
38 | this.autoElevateColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
39 | this.dpiAwareColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
40 | this.splitter1 = new System.Windows.Forms.Splitter();
41 | this.panel2 = new System.Windows.Forms.Panel();
42 | this.statusStrip1 = new System.Windows.Forms.StatusStrip();
43 | this.toolStripStatusLabelTotalRows = new System.Windows.Forms.ToolStripStatusLabel();
44 | this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
45 | this.button1 = new System.Windows.Forms.Button();
46 | this.searchButton1 = new System.Windows.Forms.Button();
47 | this.label1 = new System.Windows.Forms.Label();
48 | this.textBox1 = new System.Windows.Forms.TextBox();
49 | this.checkBoxRecursive = new System.Windows.Forms.CheckBox();
50 | this.groupBoxLevel = new System.Windows.Forms.GroupBox();
51 | this.checkBoxLevelAsInvoker = new System.Windows.Forms.CheckBox();
52 | this.checkBoxhHighestAvailable = new System.Windows.Forms.CheckBox();
53 | this.checkBoxRequireAdministrator = new System.Windows.Forms.CheckBox();
54 | this.groupBoxuiAccess = new System.Windows.Forms.GroupBox();
55 | this.checkBoxUiAccessTrue = new System.Windows.Forms.CheckBox();
56 | this.checkBoxUiAccessFalse = new System.Windows.Forms.CheckBox();
57 | this.groupBoxAutoElevate = new System.Windows.Forms.GroupBox();
58 | this.checkBoxAutoElevateTrue = new System.Windows.Forms.CheckBox();
59 | this.checkBoxAutoElevateFalse = new System.Windows.Forms.CheckBox();
60 | this.groupBoxdpiAware = new System.Windows.Forms.GroupBox();
61 | this.checkBoxDpiAwareTrue = new System.Windows.Forms.CheckBox();
62 | this.checkBoxDpiAwareFalse = new System.Windows.Forms.CheckBox();
63 | this.buttonSelectAll = new System.Windows.Forms.Button();
64 | this.buttonClearResults = new System.Windows.Forms.Button();
65 | this.buttonSaveResults = new System.Windows.Forms.Button();
66 | this.comboBoxExtensions = new System.Windows.Forms.ComboBox();
67 | this.panel1 = new System.Windows.Forms.Panel();
68 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
69 | this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
70 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
71 | this.panel2.SuspendLayout();
72 | this.statusStrip1.SuspendLayout();
73 | this.groupBoxLevel.SuspendLayout();
74 | this.groupBoxuiAccess.SuspendLayout();
75 | this.groupBoxAutoElevate.SuspendLayout();
76 | this.groupBoxdpiAware.SuspendLayout();
77 | this.panel1.SuspendLayout();
78 | this.menuStrip1.SuspendLayout();
79 | this.SuspendLayout();
80 | //
81 | // dataGridView1
82 | //
83 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
84 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
85 | this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
86 | this.FileColumn,
87 | this.LevelColumn,
88 | this.uiAccessColumn,
89 | this.autoElevateColumn,
90 | this.dpiAwareColumn});
91 | this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
92 | this.dataGridView1.Location = new System.Drawing.Point(0, 0);
93 | this.dataGridView1.Name = "dataGridView1";
94 | this.dataGridView1.Size = new System.Drawing.Size(890, 343);
95 | this.dataGridView1.TabIndex = 0;
96 | //
97 | // FileColumn
98 | //
99 | this.FileColumn.HeaderText = "File path";
100 | this.FileColumn.Name = "FileColumn";
101 | //
102 | // LevelColumn
103 | //
104 | this.LevelColumn.HeaderText = "Level";
105 | this.LevelColumn.Name = "LevelColumn";
106 | //
107 | // uiAccessColumn
108 | //
109 | this.uiAccessColumn.HeaderText = "uiAccess";
110 | this.uiAccessColumn.Name = "uiAccessColumn";
111 | //
112 | // autoElevateColumn
113 | //
114 | this.autoElevateColumn.HeaderText = "autoElevate";
115 | this.autoElevateColumn.Name = "autoElevateColumn";
116 | //
117 | // dpiAwareColumn
118 | //
119 | this.dpiAwareColumn.HeaderText = "dpiAware";
120 | this.dpiAwareColumn.Name = "dpiAwareColumn";
121 | //
122 | // splitter1
123 | //
124 | this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
125 | this.splitter1.Location = new System.Drawing.Point(0, 210);
126 | this.splitter1.Name = "splitter1";
127 | this.splitter1.Size = new System.Drawing.Size(890, 10);
128 | this.splitter1.TabIndex = 7;
129 | this.splitter1.TabStop = false;
130 | //
131 | // panel2
132 | //
133 | this.panel2.Controls.Add(this.statusStrip1);
134 | this.panel2.Controls.Add(this.dataGridView1);
135 | this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
136 | this.panel2.Location = new System.Drawing.Point(0, 220);
137 | this.panel2.Name = "panel2";
138 | this.panel2.Size = new System.Drawing.Size(890, 343);
139 | this.panel2.TabIndex = 8;
140 | //
141 | // statusStrip1
142 | //
143 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
144 | this.toolStripStatusLabelTotalRows,
145 | this.toolStripStatusLabel1});
146 | this.statusStrip1.Location = new System.Drawing.Point(0, 321);
147 | this.statusStrip1.Name = "statusStrip1";
148 | this.statusStrip1.Size = new System.Drawing.Size(890, 22);
149 | this.statusStrip1.TabIndex = 1;
150 | this.statusStrip1.Text = "statusStrip1";
151 | //
152 | // toolStripStatusLabelTotalRows
153 | //
154 | this.toolStripStatusLabelTotalRows.Name = "toolStripStatusLabelTotalRows";
155 | this.toolStripStatusLabelTotalRows.Size = new System.Drawing.Size(67, 17);
156 | this.toolStripStatusLabelTotalRows.Text = "Total rows: ";
157 | //
158 | // toolStripStatusLabel1
159 | //
160 | this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
161 | this.toolStripStatusLabel1.Size = new System.Drawing.Size(42, 17);
162 | this.toolStripStatusLabel1.Text = "Status:";
163 | //
164 | // button1
165 | //
166 | this.button1.Location = new System.Drawing.Point(24, 51);
167 | this.button1.Name = "button1";
168 | this.button1.Size = new System.Drawing.Size(75, 23);
169 | this.button1.TabIndex = 4;
170 | this.button1.Text = "Browse...";
171 | this.button1.UseVisualStyleBackColor = true;
172 | this.button1.Click += new System.EventHandler(this.buttonBrowse_Click_1);
173 | //
174 | // searchButton1
175 | //
176 | this.searchButton1.Image = global::ManifestoGUI.Properties.Resources.search__1_;
177 | this.searchButton1.Location = new System.Drawing.Point(105, 51);
178 | this.searchButton1.Name = "searchButton1";
179 | this.searchButton1.Size = new System.Drawing.Size(75, 23);
180 | this.searchButton1.TabIndex = 2;
181 | this.searchButton1.UseVisualStyleBackColor = true;
182 | this.searchButton1.Click += new System.EventHandler(this.searchButton1_Click);
183 | //
184 | // label1
185 | //
186 | this.label1.AutoSize = true;
187 | this.label1.Location = new System.Drawing.Point(21, 28);
188 | this.label1.Name = "label1";
189 | this.label1.Size = new System.Drawing.Size(71, 13);
190 | this.label1.TabIndex = 5;
191 | this.label1.Text = "Folder name: ";
192 | //
193 | // textBox1
194 | //
195 | this.textBox1.Location = new System.Drawing.Point(98, 25);
196 | this.textBox1.Name = "textBox1";
197 | this.textBox1.Size = new System.Drawing.Size(272, 20);
198 | this.textBox1.TabIndex = 3;
199 | this.textBox1.Text = "C:\\Windows";
200 | //
201 | // checkBoxRecursive
202 | //
203 | this.checkBoxRecursive.AutoSize = true;
204 | this.checkBoxRecursive.Location = new System.Drawing.Point(204, 56);
205 | this.checkBoxRecursive.Name = "checkBoxRecursive";
206 | this.checkBoxRecursive.Size = new System.Drawing.Size(74, 17);
207 | this.checkBoxRecursive.TabIndex = 6;
208 | this.checkBoxRecursive.Text = "Recursive";
209 | this.checkBoxRecursive.UseVisualStyleBackColor = true;
210 | //
211 | // groupBoxLevel
212 | //
213 | this.groupBoxLevel.Controls.Add(this.checkBoxLevelAsInvoker);
214 | this.groupBoxLevel.Controls.Add(this.checkBoxhHighestAvailable);
215 | this.groupBoxLevel.Controls.Add(this.checkBoxRequireAdministrator);
216 | this.groupBoxLevel.Location = new System.Drawing.Point(127, 89);
217 | this.groupBoxLevel.Name = "groupBoxLevel";
218 | this.groupBoxLevel.Size = new System.Drawing.Size(200, 100);
219 | this.groupBoxLevel.TabIndex = 13;
220 | this.groupBoxLevel.TabStop = false;
221 | this.groupBoxLevel.Text = "Level";
222 | //
223 | // checkBoxLevelAsInvoker
224 | //
225 | this.checkBoxLevelAsInvoker.AutoSize = true;
226 | this.checkBoxLevelAsInvoker.Location = new System.Drawing.Point(14, 28);
227 | this.checkBoxLevelAsInvoker.Name = "checkBoxLevelAsInvoker";
228 | this.checkBoxLevelAsInvoker.Size = new System.Drawing.Size(73, 17);
229 | this.checkBoxLevelAsInvoker.TabIndex = 11;
230 | this.checkBoxLevelAsInvoker.Text = "asInvoker";
231 | this.checkBoxLevelAsInvoker.UseVisualStyleBackColor = true;
232 | //
233 | // checkBoxhHighestAvailable
234 | //
235 | this.checkBoxhHighestAvailable.AutoSize = true;
236 | this.checkBoxhHighestAvailable.Location = new System.Drawing.Point(14, 74);
237 | this.checkBoxhHighestAvailable.Name = "checkBoxhHighestAvailable";
238 | this.checkBoxhHighestAvailable.Size = new System.Drawing.Size(103, 17);
239 | this.checkBoxhHighestAvailable.TabIndex = 12;
240 | this.checkBoxhHighestAvailable.Text = "highestAvailable";
241 | this.checkBoxhHighestAvailable.UseVisualStyleBackColor = true;
242 | //
243 | // checkBoxRequireAdministrator
244 | //
245 | this.checkBoxRequireAdministrator.AutoSize = true;
246 | this.checkBoxRequireAdministrator.Location = new System.Drawing.Point(14, 51);
247 | this.checkBoxRequireAdministrator.Name = "checkBoxRequireAdministrator";
248 | this.checkBoxRequireAdministrator.Size = new System.Drawing.Size(118, 17);
249 | this.checkBoxRequireAdministrator.TabIndex = 10;
250 | this.checkBoxRequireAdministrator.Text = "requireAdministrator";
251 | this.checkBoxRequireAdministrator.UseVisualStyleBackColor = true;
252 | //
253 | // groupBoxuiAccess
254 | //
255 | this.groupBoxuiAccess.Controls.Add(this.checkBoxUiAccessTrue);
256 | this.groupBoxuiAccess.Controls.Add(this.checkBoxUiAccessFalse);
257 | this.groupBoxuiAccess.Location = new System.Drawing.Point(352, 89);
258 | this.groupBoxuiAccess.Name = "groupBoxuiAccess";
259 | this.groupBoxuiAccess.Size = new System.Drawing.Size(97, 80);
260 | this.groupBoxuiAccess.TabIndex = 14;
261 | this.groupBoxuiAccess.TabStop = false;
262 | this.groupBoxuiAccess.Text = "uiAccess";
263 | //
264 | // checkBoxUiAccessTrue
265 | //
266 | this.checkBoxUiAccessTrue.AutoSize = true;
267 | this.checkBoxUiAccessTrue.Location = new System.Drawing.Point(14, 28);
268 | this.checkBoxUiAccessTrue.Name = "checkBoxUiAccessTrue";
269 | this.checkBoxUiAccessTrue.Size = new System.Drawing.Size(44, 17);
270 | this.checkBoxUiAccessTrue.TabIndex = 11;
271 | this.checkBoxUiAccessTrue.Text = "true";
272 | this.checkBoxUiAccessTrue.UseVisualStyleBackColor = true;
273 | //
274 | // checkBoxUiAccessFalse
275 | //
276 | this.checkBoxUiAccessFalse.AutoSize = true;
277 | this.checkBoxUiAccessFalse.Location = new System.Drawing.Point(14, 51);
278 | this.checkBoxUiAccessFalse.Name = "checkBoxUiAccessFalse";
279 | this.checkBoxUiAccessFalse.Size = new System.Drawing.Size(48, 17);
280 | this.checkBoxUiAccessFalse.TabIndex = 10;
281 | this.checkBoxUiAccessFalse.Text = "false";
282 | this.checkBoxUiAccessFalse.UseVisualStyleBackColor = true;
283 | //
284 | // groupBoxAutoElevate
285 | //
286 | this.groupBoxAutoElevate.Controls.Add(this.checkBoxAutoElevateTrue);
287 | this.groupBoxAutoElevate.Controls.Add(this.checkBoxAutoElevateFalse);
288 | this.groupBoxAutoElevate.Location = new System.Drawing.Point(474, 89);
289 | this.groupBoxAutoElevate.Name = "groupBoxAutoElevate";
290 | this.groupBoxAutoElevate.Size = new System.Drawing.Size(93, 80);
291 | this.groupBoxAutoElevate.TabIndex = 15;
292 | this.groupBoxAutoElevate.TabStop = false;
293 | this.groupBoxAutoElevate.Text = "autoElevate";
294 | //
295 | // checkBoxAutoElevateTrue
296 | //
297 | this.checkBoxAutoElevateTrue.AutoSize = true;
298 | this.checkBoxAutoElevateTrue.Location = new System.Drawing.Point(14, 28);
299 | this.checkBoxAutoElevateTrue.Name = "checkBoxAutoElevateTrue";
300 | this.checkBoxAutoElevateTrue.Size = new System.Drawing.Size(44, 17);
301 | this.checkBoxAutoElevateTrue.TabIndex = 11;
302 | this.checkBoxAutoElevateTrue.Text = "true";
303 | this.checkBoxAutoElevateTrue.UseVisualStyleBackColor = true;
304 | //
305 | // checkBoxAutoElevateFalse
306 | //
307 | this.checkBoxAutoElevateFalse.AutoSize = true;
308 | this.checkBoxAutoElevateFalse.Location = new System.Drawing.Point(14, 51);
309 | this.checkBoxAutoElevateFalse.Name = "checkBoxAutoElevateFalse";
310 | this.checkBoxAutoElevateFalse.Size = new System.Drawing.Size(48, 17);
311 | this.checkBoxAutoElevateFalse.TabIndex = 10;
312 | this.checkBoxAutoElevateFalse.Text = "false";
313 | this.checkBoxAutoElevateFalse.UseVisualStyleBackColor = true;
314 | //
315 | // groupBoxdpiAware
316 | //
317 | this.groupBoxdpiAware.Controls.Add(this.checkBoxDpiAwareTrue);
318 | this.groupBoxdpiAware.Controls.Add(this.checkBoxDpiAwareFalse);
319 | this.groupBoxdpiAware.Location = new System.Drawing.Point(586, 89);
320 | this.groupBoxdpiAware.Name = "groupBoxdpiAware";
321 | this.groupBoxdpiAware.Size = new System.Drawing.Size(93, 80);
322 | this.groupBoxdpiAware.TabIndex = 16;
323 | this.groupBoxdpiAware.TabStop = false;
324 | this.groupBoxdpiAware.Text = "dpiAware";
325 | //
326 | // checkBoxDpiAwareTrue
327 | //
328 | this.checkBoxDpiAwareTrue.AutoSize = true;
329 | this.checkBoxDpiAwareTrue.Location = new System.Drawing.Point(14, 28);
330 | this.checkBoxDpiAwareTrue.Name = "checkBoxDpiAwareTrue";
331 | this.checkBoxDpiAwareTrue.Size = new System.Drawing.Size(44, 17);
332 | this.checkBoxDpiAwareTrue.TabIndex = 11;
333 | this.checkBoxDpiAwareTrue.Text = "true";
334 | this.checkBoxDpiAwareTrue.UseVisualStyleBackColor = true;
335 | //
336 | // checkBoxDpiAwareFalse
337 | //
338 | this.checkBoxDpiAwareFalse.AutoSize = true;
339 | this.checkBoxDpiAwareFalse.Location = new System.Drawing.Point(14, 51);
340 | this.checkBoxDpiAwareFalse.Name = "checkBoxDpiAwareFalse";
341 | this.checkBoxDpiAwareFalse.Size = new System.Drawing.Size(48, 17);
342 | this.checkBoxDpiAwareFalse.TabIndex = 10;
343 | this.checkBoxDpiAwareFalse.Text = "false";
344 | this.checkBoxDpiAwareFalse.UseVisualStyleBackColor = true;
345 | //
346 | // buttonSelectAll
347 | //
348 | this.buttonSelectAll.Location = new System.Drawing.Point(24, 89);
349 | this.buttonSelectAll.Name = "buttonSelectAll";
350 | this.buttonSelectAll.Size = new System.Drawing.Size(82, 23);
351 | this.buttonSelectAll.TabIndex = 17;
352 | this.buttonSelectAll.Text = "Un\\Select All";
353 | this.buttonSelectAll.UseVisualStyleBackColor = true;
354 | this.buttonSelectAll.Click += new System.EventHandler(this.buttonSelectAll_Click);
355 | //
356 | // buttonClearResults
357 | //
358 | this.buttonClearResults.Location = new System.Drawing.Point(24, 118);
359 | this.buttonClearResults.Name = "buttonClearResults";
360 | this.buttonClearResults.Size = new System.Drawing.Size(82, 23);
361 | this.buttonClearResults.TabIndex = 18;
362 | this.buttonClearResults.Text = "Clear results";
363 | this.buttonClearResults.UseVisualStyleBackColor = true;
364 | this.buttonClearResults.Click += new System.EventHandler(this.buttonClearResults_Click);
365 | //
366 | // buttonSaveResults
367 | //
368 | this.buttonSaveResults.Location = new System.Drawing.Point(24, 147);
369 | this.buttonSaveResults.Name = "buttonSaveResults";
370 | this.buttonSaveResults.Size = new System.Drawing.Size(82, 23);
371 | this.buttonSaveResults.TabIndex = 19;
372 | this.buttonSaveResults.Text = "Save results";
373 | this.buttonSaveResults.UseVisualStyleBackColor = true;
374 | this.buttonSaveResults.Click += new System.EventHandler(this.buttonSaveResults_Click);
375 | //
376 | // comboBoxExtensions
377 | //
378 | this.comboBoxExtensions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
379 | this.comboBoxExtensions.FormattingEnabled = true;
380 | this.comboBoxExtensions.Items.AddRange(new object[] {
381 | "All Files",
382 | "*.exe",
383 | "*.com",
384 | "*.dll"});
385 | this.comboBoxExtensions.Location = new System.Drawing.Point(385, 24);
386 | this.comboBoxExtensions.Name = "comboBoxExtensions";
387 | this.comboBoxExtensions.Size = new System.Drawing.Size(121, 21);
388 | this.comboBoxExtensions.TabIndex = 21;
389 | //
390 | // panel1
391 | //
392 | this.panel1.Controls.Add(this.comboBoxExtensions);
393 | this.panel1.Controls.Add(this.buttonSaveResults);
394 | this.panel1.Controls.Add(this.buttonClearResults);
395 | this.panel1.Controls.Add(this.buttonSelectAll);
396 | this.panel1.Controls.Add(this.groupBoxdpiAware);
397 | this.panel1.Controls.Add(this.groupBoxAutoElevate);
398 | this.panel1.Controls.Add(this.groupBoxuiAccess);
399 | this.panel1.Controls.Add(this.groupBoxLevel);
400 | this.panel1.Controls.Add(this.checkBoxRecursive);
401 | this.panel1.Controls.Add(this.textBox1);
402 | this.panel1.Controls.Add(this.label1);
403 | this.panel1.Controls.Add(this.searchButton1);
404 | this.panel1.Controls.Add(this.button1);
405 | this.panel1.Controls.Add(this.menuStrip1);
406 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
407 | this.panel1.Location = new System.Drawing.Point(0, 0);
408 | this.panel1.Name = "panel1";
409 | this.panel1.Size = new System.Drawing.Size(890, 210);
410 | this.panel1.TabIndex = 6;
411 | //
412 | // menuStrip1
413 | //
414 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
415 | this.aboutToolStripMenuItem});
416 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
417 | this.menuStrip1.Name = "menuStrip1";
418 | this.menuStrip1.Size = new System.Drawing.Size(890, 24);
419 | this.menuStrip1.TabIndex = 22;
420 | this.menuStrip1.Text = "menuStrip1";
421 | //
422 | // aboutToolStripMenuItem
423 | //
424 | this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
425 | this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
426 | this.aboutToolStripMenuItem.Text = "About";
427 | this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
428 | //
429 | // Form1
430 | //
431 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
432 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
433 | this.ClientSize = new System.Drawing.Size(890, 563);
434 | this.Controls.Add(this.panel2);
435 | this.Controls.Add(this.splitter1);
436 | this.Controls.Add(this.panel1);
437 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
438 | this.MainMenuStrip = this.menuStrip1;
439 | this.Name = "Form1";
440 | this.Text = "Manifesto";
441 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
442 | this.panel2.ResumeLayout(false);
443 | this.panel2.PerformLayout();
444 | this.statusStrip1.ResumeLayout(false);
445 | this.statusStrip1.PerformLayout();
446 | this.groupBoxLevel.ResumeLayout(false);
447 | this.groupBoxLevel.PerformLayout();
448 | this.groupBoxuiAccess.ResumeLayout(false);
449 | this.groupBoxuiAccess.PerformLayout();
450 | this.groupBoxAutoElevate.ResumeLayout(false);
451 | this.groupBoxAutoElevate.PerformLayout();
452 | this.groupBoxdpiAware.ResumeLayout(false);
453 | this.groupBoxdpiAware.PerformLayout();
454 | this.panel1.ResumeLayout(false);
455 | this.panel1.PerformLayout();
456 | this.menuStrip1.ResumeLayout(false);
457 | this.menuStrip1.PerformLayout();
458 | this.ResumeLayout(false);
459 |
460 | }
461 |
462 | #endregion
463 | private System.Windows.Forms.DataGridViewTextBoxColumn FileColumn;
464 | private System.Windows.Forms.DataGridViewTextBoxColumn LevelColumn;
465 | private System.Windows.Forms.DataGridViewTextBoxColumn uiAccessColumn;
466 | private System.Windows.Forms.DataGridViewTextBoxColumn autoElevateColumn;
467 | private System.Windows.Forms.DataGridViewTextBoxColumn dpiAwareColumn;
468 | private System.Windows.Forms.DataGridView dataGridView1;
469 | private System.Windows.Forms.Splitter splitter1;
470 | private System.Windows.Forms.Panel panel2;
471 | private System.Windows.Forms.StatusStrip statusStrip1;
472 | private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelTotalRows;
473 | private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
474 | private Button button1;
475 | private Button searchButton1;
476 | private Label label1;
477 | private TextBox textBox1;
478 | private CheckBox checkBoxRecursive;
479 | private GroupBox groupBoxLevel;
480 | private CheckBox checkBoxLevelAsInvoker;
481 | private CheckBox checkBoxhHighestAvailable;
482 | private CheckBox checkBoxRequireAdministrator;
483 | private GroupBox groupBoxuiAccess;
484 | private CheckBox checkBoxUiAccessTrue;
485 | private CheckBox checkBoxUiAccessFalse;
486 | private GroupBox groupBoxAutoElevate;
487 | private CheckBox checkBoxAutoElevateTrue;
488 | private CheckBox checkBoxAutoElevateFalse;
489 | private GroupBox groupBoxdpiAware;
490 | private CheckBox checkBoxDpiAwareTrue;
491 | private CheckBox checkBoxDpiAwareFalse;
492 | private Button buttonSelectAll;
493 | private Button buttonClearResults;
494 | private Button buttonSaveResults;
495 | private ComboBox comboBoxExtensions;
496 | private Panel panel1;
497 | private MenuStrip menuStrip1;
498 | private ToolStripMenuItem aboutToolStripMenuItem;
499 | }
500 | }
501 |
502 |
--------------------------------------------------------------------------------
/ManifestoGUI/Form1.cs:
--------------------------------------------------------------------------------
1 | using Manifesto;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Threading;
7 | using System.Windows.Forms;
8 |
9 | namespace ManifestoGUI
10 | {
11 | public partial class Form1 : Form
12 | {
13 | private uint numberOfUpdatedFiles;
14 | private List groupBoxesList;
15 |
16 | public Form1()
17 | {
18 | InitializeComponent();
19 | this.groupBoxesList = getGroupBoxesList();
20 | this.comboBoxExtensions.Text = "All Files";
21 | }
22 |
23 | private List getGroupBoxesList()
24 | {
25 | List groupBoxes = new List();
26 | foreach (Control groupControl in panel1.Controls)
27 | {
28 | if (groupControl is GroupBox)
29 | {
30 | groupBoxes.Add((GroupBox)groupControl);
31 | }
32 | }
33 | return groupBoxes;
34 | }
35 |
36 | private void searchButton1_Click(object sender, EventArgs e)
37 | {
38 | bool recursive = false;
39 | if (checkBoxRecursive.Checked) recursive = true;
40 |
41 | string extension = "*.*";
42 | if (this.comboBoxExtensions.Text != "All Files")
43 | {
44 | extension = comboBoxExtensions.Text;
45 | }
46 | ThreadPool.QueueUserWorkItem(o => search(textBox1.Text, recursive, extension));
47 | //search(textBox1.Text, recursive);
48 | }
49 |
50 | // Original: https://stackoverflow.com/questions/172544/ignore-folders-files-when-directory-getfiles-is-denied-access
51 | // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/file-system/how-to-iterate-through-a-directory-tree
52 | private void search(string root, bool isRecursive, string extension)
53 | {
54 | // Data structure to hold names of subfolders to be
55 | // examined for files.
56 | Stack dirs = new Stack(10);
57 |
58 | if (!System.IO.Directory.Exists(root))
59 | {
60 | throw new ArgumentException();
61 | }
62 | dirs.Push(root);
63 |
64 | while (dirs.Count > 0)
65 | {
66 | string currentDir = dirs.Pop();
67 | updateStatusToolStrip(currentDir);
68 | string[] subDirs;
69 | try
70 | {
71 | subDirs = System.IO.Directory.GetDirectories(currentDir);
72 | }
73 | // An UnauthorizedAccessException exception will be thrown if we do not have
74 | // discovery permission on a folder or file. It may or may not be acceptable
75 | // to ignore the exception and continue enumerating the remaining files and
76 | // folders. It is also possible (but unlikely) that a DirectoryNotFound exception
77 | // will be raised. This will happen if currentDir has been deleted by
78 | // another application or thread after our call to Directory.Exists. The
79 | // choice of which exceptions to catch depends entirely on the specific task
80 | // you are intending to perform and also on how much you know with certainty
81 | // about the systems on which this code will run.
82 | catch (UnauthorizedAccessException e)
83 | {
84 | Console.WriteLine(e.Message);
85 | continue;
86 | }
87 | catch (System.IO.DirectoryNotFoundException e)
88 | {
89 | Console.WriteLine(e.Message);
90 | continue;
91 | }
92 |
93 | string[] files = null;
94 | try
95 | {
96 | files = System.IO.Directory.GetFiles(currentDir, extension);
97 | }
98 |
99 | catch (UnauthorizedAccessException e)
100 | {
101 |
102 | Console.WriteLine(e.Message);
103 | continue;
104 | }
105 |
106 | catch (System.IO.DirectoryNotFoundException e)
107 | {
108 | Console.WriteLine(e.Message);
109 | continue;
110 | }
111 | // Perform the required action on each file here.
112 | // Modify this block to perform your required task.
113 | foreach (string file in files)
114 | {
115 | try
116 | {
117 | ManifestInfo info = Engine.GetManifestInfo(file);
118 | if (info != null && (String.Empty != info.Level + info.uiAccess + info.autoElevate + info.dpiAware))
119 | {
120 | if(UserMatchesFilters(info)) {
121 | //if(isFilteredByCheckboxes(info)){
122 | updateTable(info, file);
123 | }
124 | }
125 | }
126 | catch (System.IO.FileNotFoundException e)
127 | {
128 | // If file was deleted by a separate application
129 | // or thread since the call to TraverseTree()
130 | // then just continue.
131 | Console.WriteLine(e.Message);
132 | continue;
133 | }
134 | }
135 |
136 | if (!isRecursive)
137 | {
138 | break;
139 | }
140 |
141 | // Push the subdirectories onto the stack for traversal.
142 | // This could also be done before handing the files.
143 | foreach (string str in subDirs)
144 | dirs.Push(str);
145 | }
146 |
147 | this.toolStripStatusLabel1.Text = "Done";
148 | }
149 |
150 | private delegate void updateStatusToolStripCallBack(string path);
151 |
152 | void updateStatusToolStrip(string path)
153 | {
154 | if (this.InvokeRequired)
155 | {
156 | updateStatusToolStripCallBack s = new updateStatusToolStripCallBack(updateStatusToolStrip);
157 | this.Invoke(s, new object[] { path });
158 | }
159 | else
160 | {
161 | this.toolStripStatusLabel1.Text = "Status: " + path;
162 | }
163 | }
164 |
165 | bool FieldMatchesFilterGroup(string field, params CheckBox[] group)
166 | {
167 | return group.All(box => !box.Checked)
168 | || group.Any(box => box.Checked && field != null && box.Text.ToLower() == field.ToLower());
169 | }
170 |
171 | bool UserMatchesFilters(ManifestInfo info)
172 | {
173 | return FieldMatchesFilterGroup(info.Level, checkBoxLevelAsInvoker, checkBoxRequireAdministrator, checkBoxhHighestAvailable)
174 | && FieldMatchesFilterGroup(info.autoElevate, checkBoxAutoElevateFalse, checkBoxAutoElevateTrue)
175 | && FieldMatchesFilterGroup(info.dpiAware, checkBoxDpiAwareFalse, checkBoxDpiAwareTrue) // there are other types like "Explorer", "per monitor", ...
176 | // Can be classified to "others"
177 | && FieldMatchesFilterGroup(info.uiAccess, checkBoxUiAccessFalse, checkBoxUiAccessTrue);
178 | }
179 |
180 | private delegate void updateTableCallBack(ManifestInfo info, string path);
181 |
182 | void updateTable(ManifestInfo info, string path)
183 | {
184 | if (this.InvokeRequired)
185 | {
186 | updateTableCallBack s = new updateTableCallBack(updateTable);
187 | this.Invoke(s, new object[] { info, path });
188 | }
189 | else
190 | {
191 | DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[0].Clone();
192 | row.Cells[0].Value = path;
193 | row.Cells[1].Value = info.Level;
194 | row.Cells[2].Value = info.uiAccess;
195 | row.Cells[3].Value = info.autoElevate;
196 | row.Cells[4].Value = info.dpiAware;
197 | dataGridView1.Rows.Add(row);
198 | this.numberOfUpdatedFiles += 1;
199 | this.toolStripStatusLabelTotalRows.Text = "Total Rows: " + this.numberOfUpdatedFiles;
200 | }
201 | }
202 |
203 | private bool isAllCheckboxesAreChecked()
204 | {
205 | bool allAreChecked = false;
206 | int numOfCheckboxes = 0;
207 | int checkedCheckboxes = 0;
208 | foreach (GroupBox groupBox in this.groupBoxesList)
209 | {
210 | foreach (Control c in groupBox.Controls)
211 | {
212 | if (c is CheckBox)
213 | {
214 | numOfCheckboxes++;
215 | if (((CheckBox)c).Checked)
216 | {
217 | checkedCheckboxes++;
218 | }
219 | }
220 | }
221 | }
222 |
223 | if (numOfCheckboxes == checkedCheckboxes)
224 | {
225 | allAreChecked = true;
226 | }
227 |
228 | return allAreChecked;
229 | }
230 |
231 | private void checkOrUncheckAll(bool checkAll)
232 | {
233 | foreach (GroupBox groupBox in this.groupBoxesList)
234 | {
235 | foreach (Control c in groupBox.Controls)
236 | {
237 | if (c is CheckBox)
238 | {
239 | ((CheckBox)c).Checked = checkAll;
240 | }
241 | }
242 | }
243 | }
244 |
245 | private void buttonSelectAll_Click(object sender, EventArgs e)
246 | {
247 | bool checkAll = true;
248 | if (isAllCheckboxesAreChecked())
249 | {
250 | checkAll = false;
251 | }
252 |
253 | checkOrUncheckAll(checkAll);
254 | }
255 |
256 | private void buttonClearResults_Click(object sender, EventArgs e)
257 | {
258 | //this.dataGridView1.DataSource = null;
259 | this.dataGridView1.Rows.Clear();
260 | this.toolStripStatusLabelTotalRows.Text = "Total Rows: 0";
261 | this.numberOfUpdatedFiles = 0;
262 | }
263 |
264 | // Taken from https://stackoverflow.com/a/26259909/2153777
265 | private void saveDataGridViewToCSV(string filename)
266 | {
267 | // Choose whether to write header. Use EnableWithoutHeaderText instead to omit header.
268 | dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
269 | // Select all the cells
270 | dataGridView1.SelectAll();
271 | // Copy selected cells to DataObject
272 | DataObject dataObject = dataGridView1.GetClipboardContent();
273 | // Get the text of the DataObject, and serialize it to a file
274 | File.WriteAllText(filename, dataObject.GetText(TextDataFormat.CommaSeparatedValue));
275 | }
276 |
277 | private void buttonSaveResults_Click(object sender, EventArgs e)
278 | {
279 | SaveFileDialog saveDialog = new SaveFileDialog();
280 | saveDialog.Title = "Save results as CSV";
281 | saveDialog.InitialDirectory = @"c:\";
282 | saveDialog.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
283 | saveDialog.FilterIndex = 2;
284 | saveDialog.RestoreDirectory = true;
285 | if (saveDialog.ShowDialog() == DialogResult.OK)
286 | {
287 | saveDataGridViewToCSV(saveDialog.FileName);
288 | }
289 | }
290 |
291 | private void buttonBrowse_Click_1(object sender, EventArgs e)
292 | {
293 | FolderBrowserDialog browser = new FolderBrowserDialog();
294 | browser.SelectedPath = @"C:\Windows\System32";
295 | if (browser.ShowDialog() == DialogResult.OK)
296 | {
297 | textBox1.Text = browser.SelectedPath;
298 | }
299 | }
300 |
301 | private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
302 | {
303 | MessageBox.Show("Author: Eviatar Gerzi\nVersion: 1.0", "About");
304 | }
305 | }
306 | }
307 |
--------------------------------------------------------------------------------
/ManifestoGUI/ManifestInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Manifesto
8 | {
9 | // https://msdn.microsoft.com/en-us/library/bb756929.aspx
10 | class ManifestInfo
11 | {
12 | private string m_level;
13 | private string m_uiAccess;
14 | private string m_dpiAware;
15 | private string m_autoElevate;
16 |
17 | public string Level
18 | {
19 | get
20 | {
21 | return m_level;
22 | }
23 | set
24 | {
25 | m_level = value;
26 | }
27 | }
28 |
29 | public string uiAccess
30 | {
31 | get
32 | {
33 | return m_uiAccess;
34 | }
35 | set
36 | {
37 | m_uiAccess = value;
38 | }
39 | }
40 |
41 | public string dpiAware
42 | {
43 | get
44 | {
45 | return m_dpiAware;
46 | }
47 | set
48 | {
49 | m_dpiAware = value;
50 | }
51 | }
52 |
53 | public string autoElevate
54 | {
55 | get
56 | {
57 | return m_autoElevate;
58 | }
59 | set
60 | {
61 | m_autoElevate = value;
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ManifestoGUI/ManifestoGUI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C4965C31-B851-4A79-9FDB-340B5F327C39}
8 | WinExe
9 | Properties
10 | ManifestoGUI
11 | ManifestoGUI
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | false
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Form
53 |
54 |
55 | Form1.cs
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | Form1.cs
64 |
65 |
66 | ResXFileCodeGenerator
67 | Resources.Designer.cs
68 | Designer
69 |
70 |
71 | True
72 | Resources.resx
73 | True
74 |
75 |
76 | SettingsSingleFileGenerator
77 | Settings.Designer.cs
78 |
79 |
80 | True
81 | Settings.settings
82 | True
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
99 |
--------------------------------------------------------------------------------
/ManifestoGUI/NativeAPI.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Manifesto
9 | {
10 | class NativeAPI
11 | {
12 | [System.Flags]
13 | public enum LoadLibraryFlags : uint
14 | {
15 | DONT_RESOLVE_DLL_REFERENCES = 0x00000001,
16 | LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x00000010,
17 | LOAD_LIBRARY_AS_DATAFILE = 0x00000002,
18 | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x00000040,
19 | LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020,
20 | LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x00000200,
21 | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000,
22 | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100,
23 | LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800,
24 | LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400,
25 | LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008
26 | }
27 |
28 | public const uint RT_MANIFEST = 24;
29 | public const uint CREATEPROCESS_MANIFEST_RESOURCE_ID = 1;
30 |
31 | [DllImport("kernel32.dll", SetLastError = true)]
32 | public static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hReservedNull, LoadLibraryFlags dwFlags);
33 |
34 | [DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
35 | public static extern IntPtr LoadLibrary(string lpFileName);
36 |
37 | [DllImport("kernel32.dll", SetLastError = true)]
38 | public static extern IntPtr FindResource(IntPtr hModule, uint lpName, uint lpType);
39 | // public static extern IntPtr FindResource(IntPtr hModule, int lpName, uint lpType);
40 |
41 | [DllImport("kernel32.dll", SetLastError = true)]
42 | public static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResInfo);
43 |
44 | [DllImport("kernel32.dll", SetLastError = true)]
45 | public static extern IntPtr LockResource(IntPtr hResData);
46 |
47 | [DllImport("kernel32.dll", SetLastError = true)]
48 | public static extern uint SizeofResource(IntPtr hModule, IntPtr hResInfo);
49 |
50 | [DllImport("kernel32.dll", SetLastError = true)]
51 | public static extern bool EnumResourceNames(IntPtr hModule, string lpType, IntPtr lpEnumFunc, IntPtr lParam);
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/ManifestoGUI/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace ManifestoGUI
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ManifestoGUI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ManifestoGUI")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ManifestoGUI")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c4965c31-b851-4a79-9fdb-340b5f327c39")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/ManifestoGUI/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ManifestoGUI.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ManifestoGUI.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap search__1_ {
67 | get {
68 | object obj = ResourceManager.GetObject("search (1)", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/ManifestoGUI/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\search (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/ManifestoGUI/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ManifestoGUI.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ManifestoGUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ManifestoGUI/ResourceManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Manifesto
9 | {
10 | class ResourceManager
11 | {
12 | public static byte[] GetResourceFromExecutable(string lpFileName, uint lpName, uint lpType)
13 | {
14 | IntPtr hModule = NativeAPI.LoadLibraryEx(lpFileName, IntPtr.Zero, NativeAPI.LoadLibraryFlags.LOAD_LIBRARY_AS_DATAFILE);
15 | if (hModule != IntPtr.Zero)
16 | {
17 | IntPtr hResource = NativeAPI.FindResource(hModule, lpName, lpType);
18 | if (hResource != IntPtr.Zero)
19 | {
20 | uint resSize = NativeAPI.SizeofResource(hModule, hResource);
21 | IntPtr resData = NativeAPI.LoadResource(hModule, hResource);
22 | if (resData != IntPtr.Zero)
23 | {
24 | byte[] uiBytes = new byte[resSize];
25 | IntPtr ipMemorySource = NativeAPI.LockResource(resData);
26 | Marshal.Copy(ipMemorySource, uiBytes, 0, (int)resSize);
27 | return uiBytes;
28 | }
29 | }
30 | }
31 | return null;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/ManifestoGUI/Resources/search (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/g3rzi/Manifesto/0d8cfca4d973f2def0a8580ddb77ceadf9f3e306/ManifestoGUI/Resources/search (1).png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Manifesto
2 | A tool for searching information about multiple files' manifests.
3 | The tool can assist especially by searching for files with `autoElevate` field enabled.
4 |
5 | # Overview
6 |
7 | Some processes contain manifest [file](https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests) that affects the application at start time. Interesting fileds in the manifest file are `autoElevate` and `Level` which determine how the application will work with UAC. Number of [UAC bypasses](https://medium.com/tenable-techblog/uac-bypass-by-mocking-trusted-directories-24a96675f6e) were searching for files with `autoElevate` field enabled in order to bypass UAC.
8 | This tool provides simple GUI that provide better visuality when searching for multiple files and it also have PowerShell version.
9 |
10 | # Usage
11 |
12 | ## GUI
13 | Run the executable and you will get GUI with all the options.
14 |
15 |
16 | ## PowerShell
17 | Import the module
18 | ```powershell
19 | Import-Module Invoke-Manifesto
20 | ```
21 | Run it like that for all the options:
22 | ```powershell
23 | Invoke-Manifesto -FolderPath "C:\Windows\system32"
24 | ```
25 | For all the other switches, check the PowerShell code.
26 |
27 |
--------------------------------------------------------------------------------