private IntPtr method_0(int snoId) { if (this.dictionary_0.ContainsKey(snoId)) { return(this.dictionary_0[snoId]); } ASMExecutor executor = base.Memory.Injector; lock (executor.publicLock) { using (MemoryInjector class2 = new MemoryInjector(Globals.mem, 4)) { executor.Clear(); executor.AddLineSecured("push {0}", new object[] { 0 }); executor.AddLineSecured("push {0}", new object[] { snoId }); executor.AddLineSecured("mov edx, [{0}]", new object[] { base.BaseAddress }); executor.AddLineSecured("test edx, edx"); executor.AddLineSecured("jz @out"); executor.AddLineSecured("mov ecx, edx"); executor.AddLineSecured("call {0}", new object[] { Offsets.fnGetSnoInfoForSnoId }); executor.AddLineSecured("mov [{0}], eax", class2.Address); executor.AddLineSecured("@out:"); executor.AddLineSecured("retn"); executor.ExecuteBuffer(null); uint recAddress = base.Memory.ReadMemoryAsUint((uint)class2.Address); return(new IntPtr(recAddress)); } } }
public string LookupSNOName(SNO.SNOGroup snoGroup, int snoId) { string str; if (dictionary_0.TryGetValue(new Tuple <SNO.SNOGroup, int>(snoGroup, snoId), out str)) { return(str); } using (MemoryInjector class2 = new MemoryInjector(Globals.mem, 20)) { Globals.mem.Injector.CallFunction(Offsets.gnGetDisplayedNameForSnoId, CallingConvention.Cdecl, new object[] { snoId, (uint)class2.Address, (uint)snoGroup }); str = Globals.mem.ReadMemoryAsString((uint)Globals.mem.ReadMemory <IntPtr>(class2.Address + 4), 0x200, Encoding.UTF8); dictionary_0.Add(new Tuple <SNO.SNOGroup, int>(snoGroup, snoId), str); return(str); } }