public uint BonfireWarp() { byte[] asm = (byte[])DSRAssembly.BonfireWarp.Clone(); byte[] bytes = BitConverter.GetBytes(ChrClassBasePtr.Resolve().ToInt64()); Array.Copy(bytes, 0, asm, 0x2, 8); bytes = BitConverter.GetBytes(BonfireWarpAddr.Resolve().ToInt64()); Array.Copy(bytes, 0, asm, 0x18, 8); return(Execute(asm)); }
public List <DS3GXLightBase> GetLights() { if (!IsValid()) { return(null); } PHPointer arrayBase = Hook.CreateChildPointer(BasePointer, Offset + 0x10); PHPointer arrayTail = Hook.CreateChildPointer(BasePointer, Offset + 0x18); long size = (arrayTail.Resolve().ToInt64() - arrayBase.Resolve().ToInt64()) / 8; List <DS3GXLightBase> lights = new List <DS3GXLightBase>(); for (int i = 0; i < size; i++) { PHPointer light = Hook.CreateChildPointer(arrayBase, i * 8); ulong vtable = light.ReadUInt64(0); if (vtable == 0x143D3A7D8) { lights.Add(new DS3GXPointLight(Hook, light, i)); } else if (vtable == 0x143D3A8B8) { lights.Add(new DS3GXSpotLight(Hook, light, i)); } } return(lights); }
public bool IsValid() { if (!Hook.Hooked) { return(false); } if (BasePointer == null) { return(false); } // See if vtable pointer is valid if (BasePointer.ReadUInt64(Offset) != 0x143D08498) { Debug.Log("Lightman base: " + String.Format("0x{0:X8}", BasePointer.Resolve().ToInt64())); Debug.Log("Lightman invalid pointer: " + String.Format("0x{0:X8}", BasePointer.ReadUInt64(0x0))); return(false); } Debug.Log("Found lightman base: " + String.Format("0x{0:X8}", BasePointer.Resolve().ToInt64())); return(true); }
public uint GetItem(int category, int id, int quantity) { byte[] asm = (byte[])DSRAssembly.GetItem.Clone(); byte[] bytes = BitConverter.GetBytes(category); Array.Copy(bytes, 0, asm, 0x1, 4); bytes = BitConverter.GetBytes(quantity); Array.Copy(bytes, 0, asm, 0x7, 4); bytes = BitConverter.GetBytes(id); Array.Copy(bytes, 0, asm, 0xD, 4); bytes = BitConverter.GetBytes((ulong)ChrClassBasePtr.Resolve()); Array.Copy(bytes, 0, asm, 0x19, 8); bytes = BitConverter.GetBytes((ulong)ItemGetAddr.Resolve()); Array.Copy(bytes, 0, asm, 0x46, 8); return(Execute(asm)); }