public Address RegisterEntry(ModuleEntry entry, Address addr) { switch (entry) { case GlobalDefinition global: var glob = RegisterGlobal(global); program.GlobalFields.Fields.Add((int)addr.ToLinear(), glob.DataType, glob.Name); return(addr + 1); case FunctionDefinition fn: var proc = RegisterFunction(fn, addr); program.Procedures.Add(addr, proc); this.Globals[fn.FunctionName] = new Core.Expressions.ProcedureConstant( new Pointer(proc.Signature, program.Platform.PointerType.BitSize), proc); return(addr + 1); case TypeDefinition tydec: RegisterTypeDefinition(tydec); return(addr); case Declaration decl: RegisterDeclaration(decl); return(addr); } throw new NotImplementedException(entry.GetType().Name); }
protected override string exec(MessageEventArgs Msg, string param) { string Response = ""; foreach (BaseModule ModuleEntry in modulehandler.GetAllModules()) { Response += ModuleEntry.GetType().Name.ToString() + " "; } return(Response); }
public void TranslateEntry(ModuleEntry entry) { switch (entry) { case GlobalDefinition _: return; case FunctionDefinition fn: TranslateFunction(fn); return; case Declaration decl: //$TODO return; } throw new NotImplementedException(string.Format("TranslateEntry({0})", entry.GetType())); }
public void TranslateEntry(ModuleEntry entry) { if (entry is GlobalDefinition) { return; } var fn = entry as FunctionDefinition; if (fn != null) { TranslateFunction(fn); return; } var decl = entry as Declaration; if (decl != null) { //$TODO return; } throw new NotImplementedException(string.Format("TranslateEntry({0})", entry.GetType())); }
public Address RegisterEntry(ModuleEntry entry, Address addr) { var global = entry as GlobalDefinition; if (global != null) { var glob = RegisterGlobal(global); program.GlobalFields.Fields.Add((int)addr.ToLinear(), glob.DataType, glob.Name); return(addr + 1); } var fn = entry as FunctionDefinition; if (fn != null) { var proc = RegisterFunction(fn); program.Procedures.Add(addr, proc); this.Globals[fn.FunctionName] = new Core.Expressions.ProcedureConstant( new Pointer(proc.Signature, program.Platform.PointerType.Size), proc); return(addr + 1); } var tydec = entry as TypeDefinition; if (fn != null) { RegisterTypeDefinition(tydec); return(addr); } var decl = entry as Declaration; if (decl != null) { RegisterDeclaration(decl); return(addr); } throw new NotImplementedException(entry.GetType().Name); }