Skip to content

Commit 1c47134

Browse files
+Invoke-Capstone.README
1 parent afa99d1 commit 1c47134

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,45 @@ C:\PS> Subvert-PE -Path C:\Path\To\PE.exe -Write
365365

366366
## Utility
367367

368+
### Invoke-Capstone
369+
370+
Powershell wrapper for Capstone v3 (using inline C#). The only Capstone feature
371+
which has not been implemented is the extended architecture-dependent information.
372+
373+
In effect the function directly parses the Capstone dll so it can support any
374+
features implemented by Capstone so long as function calls are prototyped in C#.
375+
376+
```
377+
# ARM simple disassembly
378+
C:\PS> $Bytes = [Byte[]] @( 0x10, 0xf1, 0x10, 0xe7, 0x11, 0xf2, 0x31, 0xe7, 0xdc, 0xa1, 0x2e, 0xf3, 0xe8, 0x4e, 0x62, 0xf3 )
379+
C:\PS> Invoke-Capstone -Architecture ARM -Mode ARM -Bytes $Bytes
380+
381+
sdiv r0, r0, r1
382+
udiv r1, r1, r2
383+
vbit q5, q15, q6
384+
vcgt.f32 q10, q9, q12
385+
386+
# X86 detailed disassembly, ATT syntax
387+
C:\PS> $Bytes = [Byte[]] @( 0xB8, 0x0A, 0x00, 0x00, 0x00, 0xF7, 0xF3 )
388+
C:\PS> Invoke-Capstone -Architecture X86 -Mode 32 -Bytes $Bytes -Syntax ATT -Detailed
389+
390+
Size : 5
391+
Address : 0x100000
392+
Mnemonic : movl
393+
Operands : $0xa, %eax
394+
Bytes : {184, 10, 0, 0...}
395+
RegRead :
396+
RegWrite :
397+
398+
Size : 2
399+
Address : 0x100005
400+
Mnemonic : divl
401+
Operands : %ebx
402+
Bytes : {247, 243, 0, 0...}
403+
RegRead : {eax, edx}
404+
RegWrite : {eax, edx, eflags}
405+
```
406+
368407
### Calculate-Hash
369408

370409
PowerShell v2 compatible script to calculate file hashes. I quickly scripted this together because Get-FileHash is only available in v4+.

0 commit comments

Comments
 (0)