- emit32 (0x9090ffff :: Word32); nop
- cmp eax edx
- sete al
- movzxb eax al
- push eax
- forceRegDump
- return $ Just (trapaddr, InstanceOf $ buildClassID cls cpidx)
+ emit32 (0x9090ffff :: Word32)
+ push (0 :: Word32)
+ let patcher reax reip = do
+ emit32 (0x9090ffff :: Word32)
+ let classname = buildClassID cls cpidx
+ check <- liftIO $ isInstanceOf (fromIntegral reax) classname
+ if check
+ then push (1 :: Word32)
+ else push (0 :: Word32)
+ return (reip + 4)
+ return $ Just (trapaddr, InstanceOf patcher)