Jump to content

romero

Special Members
  • Content Count

    746
  • Joined

  • Last visited

  • Days Won

    33

romero last won the day on January 17 2018

romero had the most liked content!

Community Reputation

115 Excellent

About romero

  • Rank
    Greatest Member
  • Birthday 03/07/1979

Profile Information

  • Gender
    Male

Previous Fields

  • Team
    none
  1. RetDec - Retargetable Decompiler RetDec is an open-source machine-code decompiler based on LLVM. The decompiler is not limited to any particular target architecture, operating system, or executable file format: Supported file formats: ELF, PE, Mach-O, COFF, AR (archive), Intel HEX, and raw machine code. Supported architectures (32b only): Intel x86, ARM, MIPS, PIC32, and PowerPC. Features Static analysis of executable files with detailed information. Compiler and packer detection. Loading and instruction decoding. Signature-based removal of statically linked library code. Extraction and utilization of debugging information (DWARF, PDB). Reconstruction of instruction idioms. Detection and reconstruction of C++ class hierarchies (RTTI, vtables). Demangling of symbols from C++ binaries (GCC, MSVC, Borland). Reconstruction of functions, types, and high-level constructs. Integrated disassembler. Output in two high-level languages: C and a Python-like language. Generation of call graphs, control-flow graphs, and various statistics. https://retdec.com/ https://github.com/avast-tl/retdec
  2. ahh got it ,) nice tool again thanks
  3. wtf .. all governments try to fool us .. but TOR got invented by the FEDs anyhow . at least i read somewhere
  4. Very nice indeed .. haven't tried scripts at all with dnspy .. now i will ;9
  5. thanks bro .. maybe codecracker can reup ,)
  6. please make local mirror thanks ;)
  7. please make local mirror thanks ;)
  8. when i try your solution .. gives a error : var myInstance = Activator.CreateInstance(myType, null); var myMethodInfo = myType.GetMethod("createRandomSalt", new Type[] { typeof(int) }); var invokeValue = myMethodInfo.Invoke(myInstance, new object[] { 1337 }); var result = DynamicCasting.Cast(myMethodInfo.ReturnType, invokeValue); -----> class DynamicCasting { public static T Cast<T>(T type, object input) { return (T)input; <------------------------------------------------------ Object of Type "System.Byte[]" can't be casted to Type "System.Type" . } } Console.WriteLine("RETURN TYPE: " + result);
  9. i alredy tried someshing like this dynamic DynamicCast(object entity, Type to) { var openCast = this.GetType().GetMethod("Cast", BindingFlags.Static | BindingFlags.NonPublic); var closeCast = openCast.MakeGenericMethod(to); return closeCast.Invoke(entity, new[] { entity }); } static T Cast<T>(object entity) where T : class { return entity as T; } var dync = DynamicCast(tresult, mi.ReturnType); but thats in general the same as dynamic a = handler.blahbl.... what i wanted to archive is a enhance method invoker like in SAE. So i searched a way to cast the object you get by Invoke to its real return ReturnType in a easy way. But it seems there is no way than our examples above. And for non known types i would have to import them somehow ... so aim was to archive something like this .. just psydo code !! var mi = t.GetMethod("createRandomSalt", new Type[] { typeof(int) }); if (mi == null) { // never throw generic Exception - replace this with some other exception type throw new Exception("No such method exists."); } Type rett = mi.ReturnType; // Fullname in this case system.byte[] string typestring = mi.ReturnType.FullName; object result = mi.Invoke(t, new object[] { 100 }); and now cast the result object back to real mi.ReturnType system.byte[] without having to do someting like the if block if (mi is string) result = mi as string; if (mi is byte[]) result = mi as byte[]; if (mi is int) result = (int)mi; with something like ... (rett)result <--- this wont work for sure ,) but how to cast back to ReturnType
  10. Is there a way to cast the resulting object result = mi.Invoke(t, ...); to it's proper MethodInfo.ReturnType ? For now i ended up with something like this var assembly = Assembly.LoadFile(@"F:\CRACK\xxx.exe"); BindingFlags eFlags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; Type t = assembly.GetType("xxx.aaa"); var o = Activator.CreateInstance(t, null); var mi = t.GetMethod("blahblah", new Type[] { typeof(int) }); if (mi == null) { // never throw generic Exception - replace this with some other exception type throw new Exception("No such method exists."); } Type rett = mi.ReturnType; string typestring = mi.ReturnType.FullName; Console.WriteLine("RETURN TYPE: " + typestring); if (mi != null && typeof(int).IsAssignableFrom(mi.ReturnType)) { int result = (int)mi.Invoke(t, new object[] { 100 }); Console.WriteLine("int " + result); } if (mi != null && typeof(string).IsAssignableFrom(mi.ReturnType)) { string result = (string)mi.Invoke(t, new object[] { 200 }); Console.WriteLine("string "+ result); } if (mi != null && typeof(byte[]).IsAssignableFrom(mi.ReturnType)) { .----------------------------------------------------------------------------------------------- or with dynamic dynamic handler = Activator.CreateInstance(t, null); dynamic a = handler.blahblah(7); Since i know i will get Type byte[] from ReturnType i just show the bytes foreach (byte rb in a) Console.Write("{0:X2}", rb);. . but how to cast properly back to the real returntype in this case byte[] ?
×
×
  • Create New...