-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitialize-Chimera.ps1
More file actions
102 lines (87 loc) · 3.29 KB
/
Copy pathInitialize-Chimera.ps1
File metadata and controls
102 lines (87 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
<#
.SYNOPSIS
Initialize-Chimera.ps1 - Setup & Verification Utility
.DESCRIPTION
1. Creates the complete folder structure for Chimera (Modules, Tools, Config).
2. Adds .gitkeep files to empty tool folders (Essential for Git tracking).
3. Checks if required third-party tools (EZTools, KAPE, AVML) are present.
4. Unblocks scripts to prevent ExecutionPolicy errors.
.AUTHOR
RootGuard
#>
$BaseDir = $PSScriptRoot
# --- 1. DEFINE DIRECTORY STRUCTURE ---
# This matches the structure defined in your INSTALL.md
$Folders = @(
# Modules
"Modules\Common",
"Modules\Windows",
"Modules\Linux",
# Tools - Windows
"Tools\Windows\EZTools",
"Tools\Windows\KAPE",
"Tools\Windows\Hindsight",
"Tools\Windows\Memory",
# Tools - Linux
"Tools\Linux",
"Tools\Linux\Memory",
# Tools - Common
"Tools\Common\volatility3",
# Configuration & Output
"Config",
"Output"
)
# --- 2. CREATE FOLDERS ---
Write-Host "`n[*] Initializing Chimera Directory Structure..." -ForegroundColor Cyan
foreach ($Folder in $Folders) {
$Path = Join-Path $BaseDir $Folder
if (-not (Test-Path $Path)) {
New-Item -Path $Path -ItemType Directory -Force | Out-Null
Write-Host " [+] Created: $Folder" -ForegroundColor Green
} else {
Write-Host " [.] Exists: $Folder" -ForegroundColor Gray
}
# Add .gitkeep to ensure empty folders are tracked by Git
# Without this, empty 'Tools' folders won't show up on GitHub
$GitKeep = Join-Path $Path ".gitkeep"
if (-not (Test-Path $GitKeep)) {
New-Item -Path $GitKeep -ItemType File -Force | Out-Null
}
}
# --- 3. TOOL VERIFICATION ---
Write-Host "`n[*] Verifying Third-Party Tools..." -ForegroundColor Cyan
$CriticalTools = @(
@{ Name="RECmd"; Path="Tools\Windows\EZTools\RECmd.exe" },
@{ Name="KAPE"; Path="Tools\Windows\KAPE\kape.exe" },
@{ Name="Hindsight"; Path="Tools\Windows\Hindsight\hindsight.exe" },
@{ Name="AVML"; Path="Tools\Linux\avml" },
@{ Name="Volatility"; Path="Tools\Common\volatility3\vol.py" }
)
$MissingTools = $false
foreach ($Tool in $CriticalTools) {
$ToolPath = Join-Path $BaseDir $Tool.Path
if (Test-Path $ToolPath) {
Write-Host " [V] Found: $($Tool.Name)" -ForegroundColor Green
} else {
Write-Host " [X] MISSING: $($Tool.Name) (Expected at: $($Tool.Path))" -ForegroundColor Red
$MissingTools = $true
}
}
# --- 4. UNBLOCK SCRIPTS ---
Write-Host "`n[*] Unblocking PowerShell Scripts..." -ForegroundColor Cyan
try {
Get-ChildItem -Path $BaseDir -Recurse -Filter "*.ps1" | Unblock-File
Write-Host " [V] All scripts unblocked." -ForegroundColor Green
} catch {
Write-Warning " [!] Could not unblock scripts. Ensure you are running as Administrator."
}
# --- 5. SUMMARY ---
Write-Host "`n----------------------------------------"
if ($MissingTools) {
Write-Warning "SETUP INCOMPLETE: Some tools are missing."
Write-Host "Please download the missing binaries as described in INSTALL.md." -ForegroundColor Yellow
} else {
Write-Host "SETUP COMPLETE: Chimera is ready to roar! 🦁" -ForegroundColor Green
Write-Host "Run '.\Chimera.ps1' to start the main menu." -ForegroundColor Cyan
}
Write-Host "----------------------------------------`n"