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

Commit 7c51e93

Browse files
author
mattifestation
committed
Generate a non-terminating error if there's a binding/framework version mismatch
The user should at least be made aware if they're using an unsupported framework library version.
1 parent 22cbc47 commit 7c51e93

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Capstone/Capstone.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ function Get-CSDisassembly
148148

149149
$Disassembly = New-Object Capstone.Capstone($Architecture, $Mode)
150150

151+
if ($Disassembly.Version -ne [Capstone.Capstone]::BindingVersion)
152+
{
153+
Write-Error "capstone.dll version ($([Capstone.Capstone]::BindingVersion.ToString())) should be the same as libcapstone.dll version. Otherwise, undefined behavior is likely."
154+
}
155+
151156
if ($Syntax)
152157
{
153158
switch ($Syntax)

Capstone/lib/capstone.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)