Skip to content

Commit

Permalink
PowerShell.Binding-Rework
Browse files Browse the repository at this point in the history
A rework of the pull request based on feedback for the same pull
request in Keystone
  • Loading branch information
FuzzySecurity committed Nov 5, 2016
1 parent 12ce2b3 commit b9f38ed
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 203 deletions.
155 changes: 26 additions & 129 deletions bindings/powershell/Invoke-Capstone.ps1

Large diffs are not rendered by default.

58 changes: 0 additions & 58 deletions bindings/powershell/Out-UnmanagedDll.ps1

This file was deleted.

26 changes: 10 additions & 16 deletions bindings/powershell/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Usage

Invoke-Capstone is ready for use, there are two options to access the capstone
library from PowerShell:
Invoke-Capstone requires an architecture appropriate (x32/64) compiled Capstone DLL.
A pre-compiled version can be found on the Capstone download page at the following
URL:

* http://www.capstone-engine.org/download.html

Once downloaded, the DLL should be placed in a directory which is part of the SafeDllSearchMode search order. In practice, any folder which is part of the Windows PATH environment variable will work.

The Invoke-Capstone function itself can be initialized using one of the following methods:

* Script dot sourcing:

Expand All @@ -13,17 +20,4 @@ library from PowerShell:
%Windir%\System32\WindowsPowerShell\v1.0\Modules

# User PSModulePath path
%UserProfile%\Documents\WindowsPowerShell\Modules

Notes

* Invoke-Capstone drops the Capstone DLL, x32/64 respectively, to the user's
temporary folder the first time it runs. Further runs will use this cached DLL.

* The "Out-UnmanagedDll" script can be used to generate a compressed DLL which
allows for easy integration with Invoke-Capstone. This script is based on
@mattifestation’s post here
http://www.exploit-monday.com/2012/12/in-memory-dll-loading.html.

# Redirect script output to file
PS C:\> Out-UnmanagedDll -FilePath C:\Some\Path\capstone.dll
%UserProfile%\Documents\WindowsPowerShell\Modules

0 comments on commit b9f38ed

Please sign in to comment.