Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 7f0be86

Browse files
author
Matt Graeber
committed
Added ps1xml file for Get-ILDisassembly
Output from Get-ILDisassembly is slightly cleaner.
1 parent 9bb31fc commit 7f0be86

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<View>
5+
<Name>ILInstructionView</Name>
6+
<ViewSelectedBy>
7+
<TypeName>IL_INSTRUCTION</TypeName>
8+
</ViewSelectedBy>
9+
<TableControl>
10+
<AutoSize/>
11+
<TableHeaders>
12+
<TableColumnHeader>
13+
<Label>Position</Label>
14+
</TableColumnHeader>
15+
<TableColumnHeader>
16+
<Label>Instruction</Label>
17+
</TableColumnHeader>
18+
<TableColumnHeader>
19+
<Label>Operand</Label>
20+
</TableColumnHeader>
21+
</TableHeaders>
22+
<TableRowEntries>
23+
<TableRowEntry>
24+
<TableColumnItems>
25+
<TableColumnItem>
26+
<PropertyName>Position</PropertyName>
27+
</TableColumnItem>
28+
<TableColumnItem>
29+
<PropertyName>Instruction</PropertyName>
30+
</TableColumnItem>
31+
<TableColumnItem>
32+
<PropertyName>Operand</PropertyName>
33+
</TableColumnItem>
34+
</TableColumnItems>
35+
</TableRowEntry>
36+
</TableRowEntries>
37+
</TableControl>
38+
</View>
39+
</ViewDefinitions>
40+
</Configuration>

ReverseEngineering/Get-ILDisassembly.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-335.pdf
201201
}
202202

203203
# Return a custom object containing a position, instruction, and fully-qualified operand
204-
New-Object PSObject -Property $Instruction
204+
$InstructionObject = New-Object PSObject -Property $Instruction
205+
$InstructionObject.PSObject.TypeNames.Insert(0, 'IL_INSTRUCTION')
205206

207+
$InstructionObject
208+
206209
# Adjust the position in the opcode array accordingly
207210
$Position += $OperandLength
208211
}

ReverseEngineering/ReverseEngineering.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ PowerShellVersion = '2.0'
5252
# TypesToProcess = @()
5353

5454
# Format files (.ps1xml) to be loaded when importing this module
55-
FormatsToProcess = 'Get-PEB.format.ps1xml', 'Get-NtSystemInformation.format.ps1xml'
55+
FormatsToProcess = 'Get-PEB.format.ps1xml', 'Get-NtSystemInformation.format.ps1xml', 'Get-ILDisassembly.format.ps1xml'
5656

5757
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
5858
# NestedModules = @()
@@ -76,7 +76,7 @@ ModuleList = @(@{ModuleName = 'ReverseEngineering'; ModuleVersion = '1.0.0.0'; G
7676
FileList = 'ReverseEngineering.psm1', 'ReverseEngineering.psd1', 'Get-ILDisassembly.ps1', 'Get-NtSystemInformation.format.ps1xml',
7777
'Get-NtSystemInformation.ps1', 'Get-Member.ps1', 'Get-MethodAddress.ps1', 'Get-PEB.format.ps1xml',
7878
'Get-PEB.ps1', 'Get-Strings.ps1', 'Get-StructFromMemory.ps1', 'ConvertTo-String.ps1',
79-
'New-Object.ps1', 'Usage.md'
79+
'New-Object.ps1', 'Get-ILDisassembly.format.ps1xml', 'Usage.md'
8080

8181
# Private data to pass to the module specified in RootModule/ModuleToProcess
8282
# PrivateData = ''

0 commit comments

Comments
 (0)