rocketleaguesdk 1.0.0

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.
Files changed (53) hide show
  1. package/README.md +152 -0
  2. package/classes/AkAudio.ts +577 -0
  3. package/classes/Core.ts +1559 -0
  4. package/classes/Engine.ts +23515 -0
  5. package/classes/GFxUI.ts +425 -0
  6. package/classes/IpDrv.ts +1902 -0
  7. package/classes/OnlineSubsystemEOS.ts +800 -0
  8. package/classes/ProjectX.ts +13294 -0
  9. package/classes/TAGame.ts +49959 -0
  10. package/classes/WinDrv.ts +110 -0
  11. package/classes/XAudio2.ts +15 -0
  12. package/classes/index.ts +19 -0
  13. package/constants/Core.ts +27 -0
  14. package/constants/Engine.ts +109 -0
  15. package/constants/IpDrv.ts +13 -0
  16. package/constants/ProjectX.ts +19 -0
  17. package/constants/TAGame.ts +78 -0
  18. package/constants/index.ts +14 -0
  19. package/enums/AkAudio.ts +121 -0
  20. package/enums/Core.ts +1528 -0
  21. package/enums/Engine.ts +3761 -0
  22. package/enums/GFxUI.ts +111 -0
  23. package/enums/IpDrv.ts +321 -0
  24. package/enums/OnlineSubsystemEOS.ts +25 -0
  25. package/enums/ProjectX.ts +593 -0
  26. package/enums/TAGame.ts +2586 -0
  27. package/enums/index.ts +17 -0
  28. package/examples/basic.ts +236 -0
  29. package/index.ts +33 -0
  30. package/package.json +100 -0
  31. package/parameters/AkAudio.ts +598 -0
  32. package/parameters/Core.ts +4062 -0
  33. package/parameters/Engine.ts +30205 -0
  34. package/parameters/GFxUI.ts +1282 -0
  35. package/parameters/IpDrv.ts +6486 -0
  36. package/parameters/OnlineSubsystemEOS.ts +3733 -0
  37. package/parameters/ProjectX.ts +23169 -0
  38. package/parameters/TAGame.ts +92073 -0
  39. package/parameters/WinDrv.ts +237 -0
  40. package/parameters/index.ts +18 -0
  41. package/structs/AkAudio.ts +115 -0
  42. package/structs/Core.ts +666 -0
  43. package/structs/Engine.ts +5185 -0
  44. package/structs/GFxUI.ts +117 -0
  45. package/structs/IpDrv.ts +601 -0
  46. package/structs/OnlineSubsystemEOS.ts +20 -0
  47. package/structs/ProjectX.ts +2110 -0
  48. package/structs/TAGame.ts +6273 -0
  49. package/structs/index.ts +17 -0
  50. package/tsconfig.json +28 -0
  51. package/types/core.ts +16 -0
  52. package/types/index.ts +8 -0
  53. package/types/offsets.ts +29 -0
package/enums/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Enums Index
3
+ * Auto-generated by Stev Peifer
4
+ *
5
+ * Enums are exported as namespaces for consistency.
6
+ * Usage: import { TAGame } from "rocketleaguesdk/enums";
7
+ * TAGame.EBoostType
8
+ */
9
+
10
+ export * as Engine from './Engine';
11
+ export * as Core from './Core';
12
+ export * as IpDrv from './IpDrv';
13
+ export * as GFxUI from './GFxUI';
14
+ export * as AkAudio from './AkAudio';
15
+ export * as OnlineSubsystemEOS from './OnlineSubsystemEOS';
16
+ export * as ProjectX from './ProjectX';
17
+ export * as TAGame from './TAGame';
@@ -0,0 +1,236 @@
1
+ /**
2
+ * Basic SDK Usage Example
3
+ *
4
+ * This example demonstrates step-by-step how to read game data
5
+ * from Rocket League using the generated SDK types.
6
+ *
7
+ * All memory reading logic is inline so you can see exactly how it works.
8
+ *
9
+ * Run with: bun run examples/basic.ts
10
+ */
11
+
12
+ import Memory from 'bun-memory';
13
+
14
+ // Import SDK types for type safety
15
+ import type { Structs } from '..';
16
+
17
+ // =============================================================================
18
+ // OFFSETS (from SDK generation)
19
+ // =============================================================================
20
+
21
+ // GNames and GObjects offsets discovered during SDK generation
22
+ // See: types/offsets.ts for the full list
23
+ const GNAMES_OFFSET = 0x23ed570n;
24
+ const GOBJECTS_OFFSET = 0x23ed5b8n;
25
+
26
+ // UObject layout (UE3 structure)
27
+ // These are the byte offsets to each field within a UObject
28
+ const UObject = {
29
+ Outer: 0x40, // Pointer to outer object (package/owner)
30
+ Name: 0x48, // FName index - lookup in GNames to get string name
31
+ Class: 0x50, // Pointer to the UClass that describes this object
32
+ } as const;
33
+
34
+ // FNameEntry layout - structure in GNames array
35
+ const FNameEntry = {
36
+ Name: 0x18, // Offset to the actual name string (wide string)
37
+ } as const;
38
+
39
+ // CarComponent_Boost_TA offsets
40
+ // Found in: classes/TAGame.ts - search for "CarComponent_Boost_TA"
41
+ // These offsets define where boost-related data is stored in the component
42
+ const BoostOffsets = {
43
+ CurrentBoostAmount: 0x0338, // float - current boost (0.0 to MaxBoostAmount)
44
+ MaxBoostAmount: 0x032C, // float - maximum boost capacity
45
+ } as const;
46
+
47
+ // =============================================================================
48
+ // MEMORY ACCESS
49
+ // =============================================================================
50
+
51
+ // Open the process
52
+ const rl = new Memory('RocketLeague.exe');
53
+ const module = rl.modules['RocketLeague.exe'];
54
+
55
+ if (!module) {
56
+ throw new Error('RocketLeague.exe not found. Is the game running?');
57
+ }
58
+
59
+ const base = module.base;
60
+
61
+ // Calculate absolute addresses from base + offset
62
+ const gNamesPtr = rl.uPtr(base + GNAMES_OFFSET);
63
+ const gObjectsPtr = rl.uPtr(base + GOBJECTS_OFFSET);
64
+
65
+ console.log('=== Rocket League SDK Example ===');
66
+ console.log(`Base: 0x${base.toString(16).toUpperCase()}`);
67
+ console.log(`GNames: 0x${gNamesPtr.toString(16).toUpperCase()}`);
68
+ console.log(`GObjects: 0x${gObjectsPtr.toString(16).toUpperCase()}`);
69
+ console.log();
70
+
71
+ // =============================================================================
72
+ // NAME RESOLUTION
73
+ // =============================================================================
74
+
75
+ /**
76
+ * Get a name string from GNames by index.
77
+ * GNames is a global array of all unique name strings in the engine.
78
+ *
79
+ * @param index - Index into the GNames array
80
+ * @returns The name string
81
+ */
82
+ function getName(index: number): string {
83
+ try {
84
+ // GNames is an array of pointers, 8 bytes each (64-bit)
85
+ const entryPtr = rl.uPtr(gNamesPtr + BigInt(index) * 8n);
86
+ if (entryPtr === 0n) return "";
87
+
88
+ // Read the wide string at FNameEntry.Name offset
89
+ // FNameEntry structure: [0x00-0x0F: metadata] [0x10+: name string]
90
+ const namePtr = entryPtr + BigInt(FNameEntry.Name);
91
+
92
+ // Read up to 256 characters (512 bytes for UTF-16)
93
+ const buf = Buffer.allocUnsafe(512);
94
+ rl.read(namePtr, buf);
95
+ const str = buf.toString('utf16le');
96
+ const nullIdx = str.indexOf('\0');
97
+ return nullIdx >= 0 ? str.slice(0, nullIdx) : str;
98
+ } catch {
99
+ return "<error>";
100
+ }
101
+ }
102
+
103
+ // =============================================================================
104
+ // OBJECT ITERATION
105
+ // =============================================================================
106
+
107
+ /**
108
+ * Get the class name of a UObject.
109
+ *
110
+ * Every UObject has a Class pointer that points to its UClass.
111
+ * The UClass itself is a UObject, so we can get its name.
112
+ *
113
+ * @param objPtr - Pointer to the UObject
114
+ * @returns Class name string
115
+ */
116
+ function getClassName(objPtr: bigint): string {
117
+ try {
118
+ // Read the Class pointer from the UObject
119
+ const classPtr = rl.uPtr(objPtr + BigInt(UObject.Class));
120
+ if (classPtr === 0n) return "";
121
+
122
+ // Get the name index from the class UObject
123
+ const nameIndex = rl.i32(classPtr + BigInt(UObject.Name));
124
+ return getName(nameIndex);
125
+ } catch {
126
+ return "<error>";
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Get the full name of a UObject (including outer chain).
132
+ *
133
+ * Format: "ClassName OuterChain.ObjectName"
134
+ * Example: "CarComponent_Boost_TA TAGame.Default__Car_TA.BoostComponent"
135
+ *
136
+ * @param objPtr - Pointer to the UObject
137
+ * @returns Full name string
138
+ */
139
+ function getObjectFullName(objPtr: bigint): string {
140
+ try {
141
+ const className = getClassName(objPtr);
142
+ const nameIndex = rl.i32(objPtr + BigInt(UObject.Name));
143
+ const name = getName(nameIndex);
144
+
145
+ // Build outer chain (package path)
146
+ const outers: string[] = [];
147
+ let outer = rl.uPtr(objPtr + BigInt(UObject.Outer));
148
+ while (outer !== 0n) {
149
+ const outerNameIdx = rl.i32(outer + BigInt(UObject.Name));
150
+ outers.unshift(getName(outerNameIdx));
151
+ outer = rl.uPtr(outer + BigInt(UObject.Outer));
152
+ }
153
+
154
+ const path = outers.length > 0 ? outers.join('.') + '.' + name : name;
155
+ return `${className} ${path}`;
156
+ } catch {
157
+ return "<error>";
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Find all objects of a specific class.
163
+ *
164
+ * This iterates through GObjects (up to MAX_OBJECTS) and filters by class name.
165
+ *
166
+ * @param className - The class name to search for
167
+ * @yields Object pointer and full name
168
+ */
169
+ function* findByClass(className: string): Generator<{ ptr: bigint; fullName: string }> {
170
+ const MAX_OBJECTS = 500_000;
171
+
172
+ for (let i = 0; i < MAX_OBJECTS; i++) {
173
+ try {
174
+ // GObjects is an array of pointers, 8 bytes each
175
+ const ptr = rl.uPtr(gObjectsPtr + BigInt(i) * 8n);
176
+ if (ptr === 0n) continue;
177
+
178
+ // Check if this object is the class we want
179
+ if (getClassName(ptr) === className) {
180
+ yield { ptr, fullName: getObjectFullName(ptr) };
181
+ }
182
+ } catch {
183
+ // Skip unreadable objects
184
+ }
185
+ }
186
+ }
187
+
188
+ // =============================================================================
189
+ // SDK TYPE USAGE EXAMPLE
190
+ // =============================================================================
191
+
192
+ /**
193
+ * Read an FVector struct from memory.
194
+ *
195
+ * FVector is a Core struct - see: structs/Core.ts
196
+ * Layout: { X: f32, Y: f32, Z: f32 } at offsets 0x00, 0x04, 0x08
197
+ *
198
+ * @param address - Memory address of the FVector
199
+ * @returns FVector object with X, Y, Z components
200
+ */
201
+ function readFVector(address: bigint): Structs.Core.FVector {
202
+ const v = rl.vector3(address);
203
+ return { X: v.x, Y: v.y, Z: v.z };
204
+ }
205
+
206
+ // =============================================================================
207
+ // MAIN: FIND AND DISPLAY BOOST AMOUNTS
208
+ // =============================================================================
209
+
210
+ console.log('Searching for CarComponent_Boost_TA objects...');
211
+ console.log('(Make sure you are in a match to see results)');
212
+ console.log();
213
+
214
+ let found = 0;
215
+ for (const { ptr, fullName } of findByClass('CarComponent_Boost_TA')) {
216
+ // Read boost values using the offsets from classes/TAGame.ts
217
+ const currentBoost = rl.f32(ptr + BigInt(BoostOffsets.CurrentBoostAmount));
218
+ const maxBoost = rl.f32(ptr + BigInt(BoostOffsets.MaxBoostAmount));
219
+ const percentage = maxBoost > 0 ? (currentBoost / maxBoost * 100).toFixed(1) : "0";
220
+
221
+ console.log(`Found: ${fullName}`);
222
+ console.log(` Address: 0x${ptr.toString(16).toUpperCase()}`);
223
+ console.log(` Boost: ${currentBoost.toFixed(2)} / ${maxBoost.toFixed(2)} (${percentage}%)`);
224
+ console.log();
225
+ found++;
226
+ }
227
+
228
+ if (found === 0) {
229
+ console.log('No boost components found.');
230
+ console.log('Make sure you are in a match (not main menu or replay).');
231
+ } else {
232
+ console.log(`Total: ${found} boost component(s) found`);
233
+ }
234
+
235
+ // Clean up
236
+ rl.close();
package/index.ts ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Rocket League SDK
3
+ * Auto-generated by Stev Peifer
4
+ *
5
+ * Usage:
6
+ * import { Structs, Classes, Enums } from "rocketleaguesdk";
7
+ * Structs.TAGame.FCarStateData
8
+ * Classes.TAGame.UCar_TA
9
+ * Enums.TAGame.EBoostType
10
+ *
11
+ * Or import directly from subdirectories:
12
+ * import { TAGame } from "rocketleaguesdk/classes";
13
+ * TAGame.UCar_TA
14
+ */
15
+
16
+ // Core types (FName, FScriptDelegate)
17
+ export * from './types';
18
+
19
+ // Structs namespace
20
+ export * as Structs from './structs';
21
+
22
+ // Classes namespace
23
+ export * as Classes from './classes';
24
+
25
+ // Enums namespace
26
+ export * as Enums from './enums';
27
+
28
+ // Parameters namespace
29
+ export * as Parameters from './parameters';
30
+
31
+ // Note: Constants are available via separate imports:
32
+ // import { ... } from 'rocketleaguesdk/constants'
33
+ // import { ... } from 'rocketleaguesdk/constants/TAGame'
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "rocketleaguesdk",
3
+ "version": "1.0.0",
4
+ "description": "TypeScript SDK for Rocket League - Auto-generated type definitions",
5
+ "type": "module",
6
+ "main": "index.ts",
7
+ "module": "index.ts",
8
+ "types": "index.ts",
9
+ "exports": {
10
+ ".": {
11
+ "bun": "./index.ts",
12
+ "import": "./index.ts",
13
+ "types": "./index.ts"
14
+ },
15
+ "./types": {
16
+ "bun": "./types/index.ts",
17
+ "import": "./types/index.ts",
18
+ "types": "./types/index.ts"
19
+ },
20
+ "./types/*": {
21
+ "bun": "./types/*.ts",
22
+ "import": "./types/*.ts",
23
+ "types": "./types/*.ts"
24
+ },
25
+ "./structs": {
26
+ "bun": "./structs/index.ts",
27
+ "import": "./structs/index.ts",
28
+ "types": "./structs/index.ts"
29
+ },
30
+ "./structs/*": {
31
+ "bun": "./structs/*.ts",
32
+ "import": "./structs/*.ts",
33
+ "types": "./structs/*.ts"
34
+ },
35
+ "./classes": {
36
+ "bun": "./classes/index.ts",
37
+ "import": "./classes/index.ts",
38
+ "types": "./classes/index.ts"
39
+ },
40
+ "./classes/*": {
41
+ "bun": "./classes/*.ts",
42
+ "import": "./classes/*.ts",
43
+ "types": "./classes/*.ts"
44
+ },
45
+ "./enums": {
46
+ "bun": "./enums/index.ts",
47
+ "import": "./enums/index.ts",
48
+ "types": "./enums/index.ts"
49
+ },
50
+ "./enums/*": {
51
+ "bun": "./enums/*.ts",
52
+ "import": "./enums/*.ts",
53
+ "types": "./enums/*.ts"
54
+ },
55
+ "./parameters": {
56
+ "bun": "./parameters/index.ts",
57
+ "import": "./parameters/index.ts",
58
+ "types": "./parameters/index.ts"
59
+ },
60
+ "./parameters/*": {
61
+ "bun": "./parameters/*.ts",
62
+ "import": "./parameters/*.ts",
63
+ "types": "./parameters/*.ts"
64
+ },
65
+ "./constants": {
66
+ "bun": "./constants/index.ts",
67
+ "import": "./constants/index.ts",
68
+ "types": "./constants/index.ts"
69
+ },
70
+ "./constants/*": {
71
+ "bun": "./constants/*.ts",
72
+ "import": "./constants/*.ts",
73
+ "types": "./constants/*.ts"
74
+ }
75
+ },
76
+ "keywords": [
77
+ "rocket-league",
78
+ "unreal-engine",
79
+ "sdk",
80
+ "types",
81
+ "typescript",
82
+ "bun"
83
+ ],
84
+ "author": "Stev Peifer",
85
+ "license": "MIT",
86
+ "repository": {
87
+ "type": "git",
88
+ "url": "https://github.com/ObscuritySRL/RocketLeagueSDK"
89
+ },
90
+ "engines": {
91
+ "bun": ">=1.0.0"
92
+ },
93
+ "devDependencies": {
94
+ "@types/bun": "latest"
95
+ },
96
+ "peerDependencies": {
97
+ "bun-memory": "^1",
98
+ "typescript": "^5"
99
+ }
100
+ }