From 7c51e9331b084d6fe6d05b9711b5ab66fb396040 Mon Sep 17 00:00:00 2001 From: mattifestation Date: Sat, 25 Jan 2014 11:48:53 -0500 Subject: 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. --- Capstone/Capstone.psm1 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Capstone/Capstone.psm1') diff --git a/Capstone/Capstone.psm1 b/Capstone/Capstone.psm1 index b9829e7..6f55c1e 100644 --- a/Capstone/Capstone.psm1 +++ b/Capstone/Capstone.psm1 @@ -148,6 +148,11 @@ function Get-CSDisassembly $Disassembly = New-Object Capstone.Capstone($Architecture, $Mode) + if ($Disassembly.Version -ne [Capstone.Capstone]::BindingVersion) + { + Write-Error "capstone.dll version ($([Capstone.Capstone]::BindingVersion.ToString())) should be the same as libcapstone.dll version. Otherwise, undefined behavior is likely." + } + if ($Syntax) { switch ($Syntax) -- cgit v1.2.3