public void Setup() { sw = new StringWriter(); formatter = new TextFormatter(sw); cf = new CodeFormatter(formatter); m = new ExpressionEmitter(); }
public ConditionCodeEliminator(SsaState ssa, IPlatform arch) { this.ssa=ssa; this.ssaIds = ssa.Identifiers; this.platform = arch; this.m = new ExpressionEmitter(); }
public OperandRewriter(IntelArchitecture arch, ExpressionEmitter emitter, Frame frame, IRewriterHost host) { this.arch = arch; this.m = emitter; this.frame = frame; this.host = host; }
public void Setup() { this.m = new ExpressionEmitter(); this.store = new TypeStore(); this.factory = new TypeFactory(); var arch = new FakeArchitecture(); var platform = new DefaultPlatform(null, arch); this.exa = new ExpressionTypeAscender(platform, store, factory); }
public TypedExpressionRewriter(Program program) { this.program = program; this.globals = program.Globals; this.compTypes = new DataTypeComparer(); this.tcr = new TypedConstantRewriter(program); this.m = new ExpressionEmitter(); this.unifier = new Unifier(); }
public TypedExpressionRewriter(Program program, DecompilerEventListener eventListener) { this.program = program; this.globals = program.Globals; this.eventListener = eventListener; this.compTypes = new DataTypeComparer(); this.tcr = new TypedConstantRewriter(program, eventListener); this.m = new ExpressionEmitter(); this.unifier = new Unifier(); }
public TypedExpressionRewriter(Program prog) { this.prog = prog; this.platform = prog.Platform; this.store = prog.TypeStore; this.globals = prog.Globals; this.compTypes = new DataTypeComparer(); this.tcr = new TypedConstantRewriter(prog); this.m = new ExpressionEmitter(); this.unifier = new Unifier(); }
public void Setup() { this.m = new ExpressionEmitter(); this.store = new TypeStore(); this.factory = new TypeFactory(); this.arch = new FakeArchitecture(); this.program = new Program { Architecture = arch, Platform = new DefaultPlatform(null, arch) }; this.exa = new ExpressionTypeAscender(program, store, factory); this.exd = new ExpressionTypeDescender(program, store, factory); store.EnsureExpressionTypeVariable(factory, program.Globals, "globals_t"); }
public void Setup() { sp = new RegisterStorage("sp", 42, 0, PrimitiveType.Pointer32); arch = new FakeArchitecture(); arch.StackRegister = sp; sce = new FakeProcessorState(arch); idSp = new Identifier(sp.Name, sp.DataType, sp); m = new ExpressionEmitter(); }
public IndirectCallRewriter( Program program, SsaState ssa, DecompilerEventListener eventListener) { this.program = program; this.proc = ssa.Procedure; this.ssa = ssa; this.asc = new IndirectCallTypeAscender(program); this.expander = new IndirectCallExpander(ssa); this.ssaIdTransformer = new SsaIdentifierTransformer(ssa); this.eventListener = eventListener; this.m = new ExpressionEmitter(); }
public void Setup() { store = new TypeStore(); factory = new TypeFactory(); globals = new Identifier("globals", PrimitiveType.Word32, null); StructureType point = new StructureType("Point", 0) { Fields = { { 0, PrimitiveType.Word32, null }, { 4, PrimitiveType.Word32, null } } }; TypeVariable tvPoint = store.CreateTypeVariable(factory); EquivalenceClass eq = new EquivalenceClass(tvPoint) { DataType = point }; tvPoint.DataType = eq; ptrPoint = new Pointer(eq, 4); UnionType u = new UnionType("RealInt", null) { Alternatives = { new UnionAlternative("w", PrimitiveType.Word32, 0), new UnionAlternative("r", PrimitiveType.Real32, 1), } }; TypeVariable tvUnion = store.CreateTypeVariable(factory); eq = new EquivalenceClass(tvUnion) { DataType = u }; tvUnion.DataType = eq; ptrUnion = new Pointer(eq, 4); ptrInt = new Pointer(PrimitiveType.Int32, 4); ptrWord = new Pointer(PrimitiveType.Word32, 4); m = new ExpressionEmitter(); }
private TextViewModel GenerateSimulatedHllCode() { var code = new List<AbsynStatement>(); var ase = new Structure.AbsynStatementEmitter(code); var m = new ExpressionEmitter(); var a_id = new Identifier("a", PrimitiveType.Int32, null); var sum_id = new Identifier("sum", PrimitiveType.Int32, null); ase.EmitAssign(a_id, Constant.Int32(10)); ase.EmitAssign(sum_id, Constant.Int32(0)); var tsf = new TextSpanFormatter(); var fmt = new AbsynCodeFormatter(tsf); fmt.InnerFormatter.UseTabs = false; foreach (var stm in code) { stm.Accept(fmt); } return tsf.GetModel(); }
public void Setup() { m = new ExpressionEmitter(); }
public CompoundConditionCoalescer(Procedure proc) { this.proc = proc; this.m = new ExpressionEmitter(); }
public void ApplySignatureToProcedure(Address addr, FunctionType sig, Procedure proc) { proc.Signature = sig; int i = 0; var stmts = proc.EntryBlock.Succ[0].Statements; var linAddr = addr.ToLinear(); var m = new ExpressionEmitter(); foreach (var param in sig.Parameters) { var starg = param.Storage as StackArgumentStorage; if (starg != null) { proc.Frame.EnsureStackArgument( starg.StackOffset, param.DataType, param.Name); var fp = proc.Frame.FramePointer; stmts.Insert(i, linAddr, new Store( m.Load(param.DataType, m.IAdd(fp, starg.StackOffset)), param)); } else { var paramId = proc.Frame.EnsureIdentifier(param.Storage); paramId.DataType = param.DataType; // Need to take an extra step with parameters being passed // in a register. It's perfectly possible for a user to // create a variable which they want to call 'r2' but which // the calling convention of the machine wants to call 'r1'. // To avoid this, we create a temporary identifier for // the formal parameter, and inject an copy statement in the // entry block that moves the parameter value into the // register. stmts.Insert(i, linAddr, NewMethod(param, paramId)); } ++i; } }
public abstract OperandRewriter CreateOperandRewriter(IntelArchitecture arch, ExpressionEmitter m, Frame frame, IRewriterHost host);
public override OperandRewriter CreateOperandRewriter(IntelArchitecture arch, ExpressionEmitter m, Frame frame, IRewriterHost host) { return new OperandRewriter64(arch, m, frame, host); }
public OperandRewriter64(IntelArchitecture arch, ExpressionEmitter m, Frame frame, IRewriterHost host) : base(arch, m, frame, host) { }