Skip to content

Commit 72f53cb

Browse files
authored
Refactor OffsetInspect module and enhance documentation
Updated module documentation and improved parameter handling.
1 parent c03a9d7 commit 72f53cb

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

module/OffsetInspect.psm1

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
Module wrapper for OffsetInspect — PE Offset & Hex Context Inspector
44
55
.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.
6+
Exposes Invoke-OffsetInspect, which wraps OffsetInspect.ps1 in the repo root
7+
and supports multi-file inspection.
108
119
.AUTHOR
1210
Jared Perry (Velkris)
@@ -21,23 +19,28 @@ function Invoke-OffsetInspect {
2119
[Parameter(Mandatory = $true, Position = 1)]
2220
[string[]]$OffsetInputs,
2321

24-
[int]$ByteWindow = 32,
22+
[int]$ByteWindow = 32,
2523
[int]$ContextLines = 3
2624
)
2725

28-
# Resolve tool path relative to module directory
29-
$scriptPath = Join-Path -Path $PSScriptRoot -ChildPath "..\OffsetInspect.ps1"
26+
# Resolve tool path relative to the module directory
27+
$scriptPath = Join-Path -Path $PSScriptRoot -ChildPath 'OffsetInspect.ps1'
3028

3129
if (-not (Test-Path -LiteralPath $scriptPath)) {
3230
throw "OffsetInspect.ps1 not found at expected location: $scriptPath"
3331
}
3432

35-
# Invoke the actual script with parameters
3633
& $scriptPath `
3734
-FilePaths $FilePaths `
3835
-OffsetInputs $OffsetInputs `
3936
-ByteWindow $ByteWindow `
4037
-ContextLines $ContextLines
4138
}
4239

43-
Export-ModuleMember -Function Invoke-OffsetInspect
40+
Export-ModuleMember -Function Invoke-OffsetInspect -FilePaths $FilePaths `
41+
-OffsetInputs $OffsetInputs `
42+
-ByteWindow $ByteWindow `
43+
-ContextLines $ContextLines
44+
}
45+
46+
Export-ModuleMember -Function Invoke-OffsetInspect

0 commit comments

Comments
 (0)