bun-memory 1.1.45 → 1.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/structs/Memory.ts +34 -0
package/package.json
CHANGED
package/structs/Memory.ts
CHANGED
|
@@ -1993,6 +1993,40 @@ class Memory {
|
|
|
1993
1993
|
return this;
|
|
1994
1994
|
}
|
|
1995
1995
|
|
|
1996
|
+
/**
|
|
1997
|
+
* Reads or writes a TArray (Data at 0x00, Count at 0x08, Max at 0x0c) as a BigUint64Array.
|
|
1998
|
+
* @param address Address of the TArray structure.
|
|
1999
|
+
* @param values Optional BigUint64Array to write.
|
|
2000
|
+
* @param force When writing, if true temporarily changes page protection to allow the write.
|
|
2001
|
+
* @returns A BigUint64Array containing the elements, or this instance if writing.
|
|
2002
|
+
* @example
|
|
2003
|
+
* ```ts
|
|
2004
|
+
* const rl = new Memory('RocketLeague.exe');
|
|
2005
|
+
* const myArray = rl.tArray(0x12345678n);
|
|
2006
|
+
* rl.tArray(0x12345678n, new BigUint64Array([1n, 2n, 3n]));
|
|
2007
|
+
* ```
|
|
2008
|
+
*/
|
|
2009
|
+
public tArray(address: bigint): BigUint64Array;
|
|
2010
|
+
public tArray(address: bigint, values: BigUint64Array, force?: boolean): this;
|
|
2011
|
+
public tArray(address: bigint, values?: BigUint64Array, force?: boolean): BigUint64Array | this {
|
|
2012
|
+
const dataPtr = this.u64(address);
|
|
2013
|
+
|
|
2014
|
+
if (values === undefined) {
|
|
2015
|
+
const count = this.u32(address + 0x08n);
|
|
2016
|
+
const scratch = new BigUint64Array(count);
|
|
2017
|
+
|
|
2018
|
+
void this.read(dataPtr, scratch);
|
|
2019
|
+
|
|
2020
|
+
return scratch;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
this.u32(address + 0x08n, values.length, force);
|
|
2024
|
+
|
|
2025
|
+
void this.write(dataPtr, values, force);
|
|
2026
|
+
|
|
2027
|
+
return this;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
1996
2030
|
/**
|
|
1997
2031
|
* Reads or writes a Vector2 (object with x, y).
|
|
1998
2032
|
* @param address Address to access.
|