public BackTraceArgs Modify( int boundary = -1, int interrupt = -1, int vftable = -1, int checkCall = -1) { BackTraceArgs newArgs = this; if (boundary != -1) { newArgs.Boundary = boundary; } if (interrupt != -1) { newArgs.InterruptAmount = interrupt; } if (vftable != -1) { newArgs.CheckVFTable = vftable == 1; } if (checkCall != -1) { newArgs.CheckCallBoundary = checkCall; } return(newArgs); }
public static IntPtr BackTraceToFuncStart( this SigScanner scanner, IntPtr ptr, BackTraceArgs args) => BackTraceToFuncStart( scanner, ptr, args.Boundary, args.InterruptAmount, args.CheckVFTable, args.CheckCallBoundary);
public static IntPtr FindFuncThroughStringRef( this SigScanner scanner, string targString, BackTraceArgs backTraceArgs, int strPtrOff = 0, int strRefPtrOff = -1, Printer pr = null) { void report(IntPtr a, string name = "", PrintLevel level = PrintLevel.Normal) { if (pr == null) { a.Report(name, level); } else { a.Report(pr, name, level); } } IntPtr ptr = scanner.FindStringPtr(targString) + strPtrOff; report(ptr, "string"); if (ptr == IntPtr.Zero) { return(ptr); } Signature sig = new Signature(ptr.GetByteString(), strRefPtrOff); ptr = scanner.Scan(sig); report(ptr, "string ref"); if (ptr == IntPtr.Zero) { return(ptr); } ptr = scanner.BackTraceToFuncStart(ptr, backTraceArgs); report(ptr, "estimated", PrintLevel.BlueBG); return(ptr); }