Skip to content

Commit

Permalink
Fix: cs_close -> [ref]Ptr not Ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzzySecurity committed Nov 12, 2016
1 parent 4088ce5 commit b526229
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bindings/powershell/Capstone/Capstone.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function Get-CapstoneDisassembly {
[DllImport("$DllPath")]
public static extern cs_err cs_close(
IntPtr handle);
ref IntPtr handle);
[DllImport("$DllPath")]
public static extern cs_err cs_option(
Expand Down Expand Up @@ -340,7 +340,7 @@ function Get-CapstoneDisassembly {
if ($CallResult -ne "CS_ERR_OK") {
echo "`n[!] cs_option error: $CallResult"
echo "[>] Quitting..`n"
$CallResult = [Capstone]::cs_close($DisAsmHandle)
$CallResult = [Capstone]::cs_close([ref]$DisAsmHandle)
Return
}

Expand All @@ -359,7 +359,7 @@ function Get-CapstoneDisassembly {
if ($CallResult -ne "CS_ERR_OK") {
echo "`n[!] cs_option error: $CallResult"
echo "[>] Quitting..`n"
$CallResult = [Capstone]::cs_close($DisAsmHandle)
$CallResult = [Capstone]::cs_close([ref]$DisAsmHandle)
Return
}

Expand Down Expand Up @@ -428,9 +428,9 @@ function Get-CapstoneDisassembly {
$BuffOffset = $BuffOffset + $cs_insn_size
}
} else {
echo "[!] Disassembly Failed"
echo "[>] Quitting.."
$CallResult = [Capstone]::cs_close($DisAsmHandle)
echo "`n[!] Disassembly Failed"
echo "[>] Quitting..`n"
$CallResult = [Capstone]::cs_close([ref]$DisAsmHandle)
Return
}

Expand Down

0 comments on commit b526229

Please sign in to comment.