public IntPtr RunScript(string script) { var dataAddress = WriteScriptBytes(Encoding.UTF8.GetBytes(script + "\0")); var offset = _process.GetOffset("runScript"); var result = _process.CallExecutor.CallFunction(offset, dataAddress.ToInt64(), dataAddress.ToInt64(), 0); return(new IntPtr(result)); }
public string FindPlayerNameByGuid(Guid guid) { var nameBaseAddress = process.BaseAddress + process.GetOffset("nameCache"); // ; var playerNameObject = FindInList(nameBaseAddress, 0, p => process.Read <Guid>(p + 0x20) == guid); if (playerNameObject != IntPtr.Zero) { return(process.ReadString(playerNameObject + 0x31)); } return(""); }
public void Move(int flag) { //TODO call update function directly for (int i = 0; i < 16; i++) { // var offset = ((1 << i) & flag) == 0 ? stopOffsets[i] : startOffsets[i]; var offsetName = (((1 << i) & flag) == 0 ? "moveStop_" : "moveStart_") + i; var offset = process.GetOffset(offsetName); if (offset != 0) { process.CallExecutor.CallFunction(offset); } } moveFlag = flag; }
public GameObject IterateObject(Func <GameObject, bool> checkFunction) { var objectManagerAddress = process.Read <IntPtr>(process.BaseAddress + process.GetOffset("objectManager")); var obj = process.Read <IntPtr>(objectManagerAddress + 0x18); var offset = process.Read <int>(objectManagerAddress + 0x08) + 8; while (obj.ToInt64() != 0 && (obj.ToInt64() & 1) == 0) { var gameObject = new GameObject(process, obj); if (checkFunction(gameObject)) { return(gameObject); } obj = process.Read <IntPtr>(obj + offset); } return(null); }
public int GetObjectFlag() { var objectTypeToFlagAddress = process.BaseAddress + process.GetOffset("objectTypeToFlag"); return(process.Read <int>(objectTypeToFlagAddress + GetObjectType() * 4)); }