From 65f1e4d550524e4cad234f0d5545dece3d3a931e Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Wed, 21 Sep 2016 09:47:52 +0200 Subject: [PATCH] [haskell-bindings] Fixed ARM THUMB sample as per issue #638 --- bindings/haskell/samples/SampleArm.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bindings/haskell/samples/SampleArm.hs b/bindings/haskell/samples/SampleArm.hs index 3de51f36..37fac093 100644 --- a/bindings/haskell/samples/SampleArm.hs +++ b/bindings/haskell/samples/SampleArm.hs @@ -4,6 +4,7 @@ import Unicorn import Unicorn.Hook import qualified Unicorn.CPU.Arm as Arm +import Data.Bits import qualified Data.ByteString as BS import Data.Word import qualified Numeric as N (showHex) @@ -112,7 +113,7 @@ testThumb = do -- Emulate machine code in infinite time (last param = Nothing), or -- when finishing all the code let codeLen = codeLength thumbCode - start uc address (address + codeLen) Nothing Nothing + start uc (address .|. 1) (address + codeLen) Nothing Nothing -- Return the results sp <- regRead uc Arm.Sp