@@ -10,9 +10,13 @@ function Get-CSDisassembly
10
10
PowerSploit Function: Get-CSDisassembly
11
11
Author: Matthew Graeber (@mattifestation)
12
12
License: See LICENSE.TXT
13
- Required Dependencies: lib\capstone.dll, lib\libcapstone.dll (64-bit)
13
+ Required Dependencies: lib\capstone.dll, lib\[x86|x64]\ libcapstone.dll
14
14
Optional Dependencies: None
15
15
16
+ . DESCRIPTION
17
+
18
+ Get-CSDisassembly is compatible on 32 and 64-bit.
19
+
16
20
. PARAMETER Architecture
17
21
18
22
Specifies the architecture of the code to be disassembled.
@@ -43,13 +47,13 @@ function Get-CSDisassembly
43
47
44
48
. EXAMPLE
45
49
46
- C:\PS>$Bytes = [Byte[]] @( 0x8d, 0x4c , 0x32, 0x08, 0x01, 0xd8 , 0x81, 0xc6 , 0x34, 0x12, 0x00, 0x00 )
47
- C:\PS> Get-CSDisassembly -Architecture X86 -Mode MODE_16 -Code $Bytes -Offset 0x1000
50
+ C:\PS>$Bytes = [Byte[]] @( 0x8D, 0x4C , 0x32, 0x08, 0x01, 0xD8 , 0x81, 0xC6 , 0x34, 0x12, 0x00, 0x00 )
51
+ Get-CSDisassembly -Architecture X86 -Mode Mode16 -Code $Bytes -Offset 0x1000
48
52
49
53
. EXAMPLE
50
54
51
- C:\PS>$Bytes = [Byte[]] @( 0x8d, 0x4c , 0x32, 0x08, 0x01, 0xd8 , 0x81, 0xc6 , 0x34, 0x12, 0x00, 0x00 )
52
- C:\PS> Get-CSDisassembly -Architecture X86 -Mode MODE_32 -Code $Bytes -Syntax ATT
55
+ C:\PS>$Bytes = [Byte[]] @( 0x8D, 0x4C , 0x32, 0x08, 0x01, 0xD8 , 0x81, 0xC6 , 0x34, 0x12, 0x00, 0x00 )
56
+ Get-CSDisassembly -Architecture X86 -Mode Mode32 -Code $Bytes -Syntax ATT
53
57
54
58
. INPUTS
55
59
@@ -62,20 +66,16 @@ function Get-CSDisassembly
62
66
Capstone.Instruction[]
63
67
64
68
Get-CSDisassembly returns an array of Instruction objects.
65
-
66
- . NOTES
67
-
68
- Get-CSDisassembly must be run from 64-bit PowerShell v3.
69
69
#>
70
70
71
71
[OutputType ([Capstone.Instruction ])]
72
72
[CmdletBinding ()] Param (
73
73
[Parameter (Mandatory )]
74
- [Capstone.ARCH ]
74
+ [Capstone.Architecture ]
75
75
$Architecture ,
76
76
77
77
[Parameter (Mandatory )]
78
- [Capstone.MODE ]
78
+ [Capstone.Mode ]
79
79
$Mode ,
80
80
81
81
[Parameter (Mandatory )]
@@ -103,8 +103,8 @@ function Get-CSDisassembly
103
103
{
104
104
switch ($Syntax )
105
105
{
106
- ' Intel' { $SyntaxMode = [Capstone.OPT _ VALUE ]::SYNTAX_INTEL }
107
- ' ATT' { $SyntaxMode = [Capstone.OPT _ VALUE ]::SYNTAX_ATT }
106
+ ' Intel' { $SyntaxMode = [Capstone.OptionValue ]::SyntaxIntel }
107
+ ' ATT' { $SyntaxMode = [Capstone.OptionValue ]::SyntaxATT }
108
108
}
109
109
110
110
$Disassembly.SetSyntax ($SyntaxMode )
0 commit comments