Skip to content

Commit 03f451a

Browse files
authored
Create OffsetInspect module wrapper
This module provides a wrapper for the OffsetInspect tool, allowing users to invoke it as a PowerShell function.
1 parent 1fd909a commit 03f451a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

OffsetInspect.psm1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<#
2+
.SYNOPSIS
3+
Module wrapper for OffsetInspect — PE Offset & Hex Context Inspector
4+
5+
.DESCRIPTION
6+
This module exposes the Invoke-OffsetInspect function, which acts as a wrapper
7+
around OffsetInspect.ps1 located in the repository root.
8+
9+
Users can import this module and call the tool like a standard PowerShell function.
10+
11+
.AUTHOR
12+
Jared Perry (Velkris)
13+
#>
14+
15+
function Invoke-OffsetInspect {
16+
[CmdletBinding()]
17+
param(
18+
[Parameter(Mandatory = $true, Position = 0)]
19+
[string[]]$FilePaths,
20+
21+
[Parameter(Mandatory = $true, Position = 1)]
22+
[string[]]$OffsetInputs,
23+
24+
[int]$ByteWindow = 32,
25+
[int]$ContextLines = 3
26+
)
27+
28+
# Resolve tool path relative to module directory
29+
$scriptPath = Join-Path -Path $PSScriptRoot -ChildPath "..\OffsetInspect.ps1"
30+
31+
if (-not (Test-Path -LiteralPath $scriptPath)) {
32+
throw "OffsetInspect.ps1 not found at expected location: $scriptPath"
33+
}
34+
35+
# Invoke the actual script with parameters
36+
& $scriptPath `

0 commit comments

Comments
 (0)