{-# LANGUAGE PartialTypeSignatures , FlexibleContexts, Strict, DeriveGeneric#-}
module Data.JSON where
import Base
import Generic.Binary
import Analysis.Context
import qualified Generic.Address as GA
import qualified Generic.Operand as GO
import qualified Generic.Instruction as GI
import qualified X86.Instruction as X86
import X86.Opcode
import X86.Prefix
import X86.Register
import Generic.HasSize (HasSize(sizeof))
import qualified Data.Map as M
import qualified Data.IntMap as IM
import qualified Data.IntSet as IS
import qualified Data.Set as S
import Data.Maybe (fromJust,catMaybes,mapMaybe)
import Data.List
import Data.Foldable
import Data.Word
import Data.Aeson
import GHC.Generics
data Address =
AddressRegister Register
| AddressImm Word64
| AddressPlus Address Address
| AddressMinus Address Address
| AddressTimes Address Address
deriving (forall x. Address -> Rep Address x)
-> (forall x. Rep Address x -> Address) -> Generic Address
forall x. Rep Address x -> Address
forall x. Address -> Rep Address x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Address x -> Address
$cfrom :: forall x. Address -> Rep Address x
Generic
data Operand =
Memory Address Int
| EffectiveAddress Address
| Reg Register
| Immediate Word64
deriving (forall x. Operand -> Rep Operand x)
-> (forall x. Rep Operand x -> Operand) -> Generic Operand
forall x. Rep Operand x -> Operand
forall x. Operand -> Rep Operand x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Operand x -> Operand
$cfrom :: forall x. Operand -> Rep Operand x
Generic
data Instruction = Instruction {
Instruction -> Word64
addr :: Word64,
Instruction -> Maybe Prefix
prefix :: Maybe Prefix,
Instruction -> Opcode
opcode :: Opcode,
Instruction -> Maybe Operand
dest :: Maybe Operand,
Instruction -> [Operand]
srcs :: [Operand],
Instruction -> Int
size :: Int
}