wowdump 0.2.1 → 0.3.2

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 (63) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +17 -111
  3. package/dist/adapters/reader.js +33 -0
  4. package/dist/analysis/disassemble.js +77 -0
  5. package/dist/{frida-runtime.js → analysis/frida-runtime.js} +3 -25
  6. package/dist/analysis/runtime-script.js +36 -0
  7. package/dist/cli.js +563 -0
  8. package/dist/core/profile-engine.js +238 -0
  9. package/dist/frida-worker.js +99 -0
  10. package/dist/reader/broker.js +475 -0
  11. package/dist/reader/client.js +1 -0
  12. package/dist/reader/launcher.js +219 -0
  13. package/dist/reader/main.js +100 -0
  14. package/dist/reader/protocol.js +1 -0
  15. package/dist/reader/windows.js +242 -0
  16. package/dist/reader-main.js +2 -0
  17. package/dist/toolchain.js +123 -0
  18. package/package.json +19 -37
  19. package/skills/wowdump/SKILL.md +22 -0
  20. package/skills/wowdump/references/commands.md +63 -0
  21. package/skills/wowdump/references/disassemble.md +18 -0
  22. package/skills/wowdump/references/dynamic.md +54 -0
  23. package/skills/wowdump/references/evidence-workflow.md +41 -0
  24. package/skills/wowdump/references/profiles.md +34 -0
  25. package/skills/wowdump/references/request-schema.md +28 -0
  26. package/skills/wowdump/references/workflow.md +44 -0
  27. package/skills/wowdump/scripts/dynamic-session.js +133 -0
  28. package/dist/agent.js +0 -1335
  29. package/dist/analysis-path.js +0 -38
  30. package/dist/analysis-process-log.js +0 -146
  31. package/dist/broker-client.js +0 -411
  32. package/dist/broker-codec.js +0 -148
  33. package/dist/broker-core.js +0 -1045
  34. package/dist/broker-gateway.js +0 -447
  35. package/dist/broker-ledger.js +0 -196
  36. package/dist/broker-main.js +0 -291
  37. package/dist/broker-protocol.js +0 -119
  38. package/dist/broker-runtime.js +0 -1283
  39. package/dist/broker-server.js +0 -466
  40. package/dist/build-bundle-loader.js +0 -183
  41. package/dist/build-bundle.js +0 -11
  42. package/dist/discovery.js +0 -59
  43. package/dist/dry-run.js +0 -38
  44. package/dist/error-log.js +0 -71
  45. package/dist/focus-errors.js +0 -63
  46. package/dist/focus-service.js +0 -1855
  47. package/dist/focused-session.js +0 -1357
  48. package/dist/mcp-main.js +0 -51
  49. package/dist/mcp.js +0 -924
  50. package/dist/observability.js +0 -41
  51. package/dist/process-log-lock.js +0 -195
  52. package/dist/processes.js +0 -47
  53. package/dist/runtime-config.js +0 -399
  54. package/dist/session.js +0 -145
  55. package/dist/storage.js +0 -12
  56. package/dist/wow-analysis.js +0 -1430
  57. package/resources/builds/retail/12.0.7.68974/build-profile.json +0 -290
  58. package/resources/builds/retail/12.0.7.68974/data-sources.json +0 -1633
  59. package/resources/builds/retail/12.0.7.68974/lua-targets.jsonl +0 -5130
  60. package/resources/builds/retail/12.0.7.68974/manifest.json +0 -63
  61. package/resources/builds/retail/12.0.7.68974/signatures.json +0 -260
  62. /package/dist/{adapters.js → core/build-adapters.js} +0 -0
  63. /package/dist/{types.js → core/types.js} +0 -0
@@ -1,148 +0,0 @@
1
- import { createHash, randomUUID } from "node:crypto";
2
- import { BrokerProtocolError, BROKER_MAX_INLINE_BYTES } from "./broker-protocol.js";
3
- export const BROKER_BINARY_CODEC = "wow.broker.binary.v1";
4
- export const BROKER_HANDLE_CODEC = "wow.broker.handle.v1";
5
- export class BrokerWireCodec {
6
- ttlMs;
7
- now;
8
- handles = new Map();
9
- constructor(ttlMs = 300_000, now = () => Date.now()) {
10
- this.ttlMs = ttlMs;
11
- this.now = now;
12
- }
13
- encode(value, scope) {
14
- this.prune();
15
- const created = [];
16
- const visiting = new WeakSet();
17
- const walk = (input) => {
18
- if (input === null || typeof input === "string" || typeof input === "boolean")
19
- return input;
20
- if (typeof input === "number") {
21
- if (!Number.isFinite(input))
22
- throw new BrokerProtocolError("FRAME_INVALID", "non-finite numbers cannot cross Broker IPC");
23
- return input;
24
- }
25
- if (typeof input === "bigint")
26
- return input.toString();
27
- if (Buffer.isBuffer(input) || input instanceof Uint8Array || input instanceof ArrayBuffer) {
28
- const bytes = Buffer.isBuffer(input) ? input : input instanceof ArrayBuffer ? Buffer.from(input) : Buffer.from(input.buffer, input.byteOffset, input.byteLength);
29
- if (bytes.length > BROKER_MAX_INLINE_BYTES)
30
- return this.createHandle(input, "binary", scope, created);
31
- return { schema: BROKER_BINARY_CODEC, encoding: "base64", bytes: bytes.length, sha256: createHash("sha256").update(bytes).digest("hex"), data: bytes.toString("base64") };
32
- }
33
- if (typeof input === "undefined")
34
- return null;
35
- if (typeof input === "function")
36
- return this.createHandle(input, "function", scope, created);
37
- if (typeof input === "symbol")
38
- throw new BrokerProtocolError("FRAME_INVALID", "symbols cannot cross Broker IPC");
39
- if (Array.isArray(input)) {
40
- if (visiting.has(input))
41
- return this.createHandle(input, "cyclic-array", scope, created);
42
- visiting.add(input);
43
- const result = input.map(walk);
44
- visiting.delete(input);
45
- return result;
46
- }
47
- if (typeof input === "object") {
48
- if (visiting.has(input))
49
- return this.createHandle(input, "cyclic-object", scope, created);
50
- const prototype = Object.getPrototypeOf(input);
51
- if (prototype !== Object.prototype && prototype !== null)
52
- return this.createHandle(input, prototype?.constructor?.name ?? "host-object", scope, created);
53
- visiting.add(input);
54
- const output = {};
55
- for (const [key, child] of Object.entries(input))
56
- output[key] = walk(child);
57
- visiting.delete(input);
58
- return output;
59
- }
60
- throw new BrokerProtocolError("FRAME_INVALID", "unsupported Broker IPC value");
61
- };
62
- return { value: walk(value), handles: created };
63
- }
64
- decode(value, scope, operation) {
65
- this.prune();
66
- const walk = (input) => {
67
- if (Array.isArray(input))
68
- return input.map(walk);
69
- if (!input || typeof input !== "object")
70
- return input;
71
- const record = input;
72
- if (record.schema === BROKER_BINARY_CODEC) {
73
- const bytes = Buffer.from(String(record.data ?? ""), "base64");
74
- if (bytes.length !== record.bytes || createHash("sha256").update(bytes).digest("hex") !== record.sha256)
75
- throw new BrokerProtocolError("FRAME_INVALID", "binary codec digest mismatch");
76
- return bytes;
77
- }
78
- if (record.schema === BROKER_HANDLE_CODEC) {
79
- if (!["host_call", "script_call", "script_unload", "detach"].includes(operation))
80
- throw new BrokerProtocolError("RESOURCE_NOT_OWNER", `opaque handles are not allowed for ${operation}`);
81
- const handle = this.lookup(String(record.handleId ?? ""));
82
- this.assertScope(handle, scope);
83
- return handle.value;
84
- }
85
- return Object.fromEntries(Object.entries(record).map(([key, child]) => [key, walk(child)]));
86
- };
87
- return walk(value);
88
- }
89
- /** Acquire an existing opaque handle for the same client/target lease. */
90
- acquireResource(resourceId, scope) {
91
- const handle = this.lookup(resourceId);
92
- this.assertScope(handle, scope);
93
- handle.refcount += 1;
94
- handle.expiresAtMs = this.now() + this.ttlMs;
95
- handle.expiresAt = new Date(handle.expiresAtMs).toISOString();
96
- return this.toWire(handle);
97
- }
98
- /** Release one reference. A scoped call is used for external requests. */
99
- releaseResource(resourceId, scope) {
100
- const handle = this.lookup(resourceId);
101
- if (scope)
102
- this.assertScope(handle, scope);
103
- if (handle.refcount <= 0)
104
- throw new BrokerProtocolError("RESOURCE_REF_UNDERFLOW", "opaque handle reference count is already zero");
105
- handle.refcount -= 1;
106
- if (handle.refcount === 0) {
107
- this.handles.delete(handle.handleId);
108
- return null;
109
- }
110
- return this.toWire(handle);
111
- }
112
- releaseClient(clientId) {
113
- for (const [handleId, handle] of this.handles)
114
- if (handle.ownerClientId === clientId)
115
- this.handles.delete(handleId);
116
- }
117
- status() { this.prune(); return [...this.handles.values()].map(handle => this.toWire(handle)); }
118
- lookup(resourceId) {
119
- this.prune();
120
- const handleId = resourceId.startsWith("handle:") ? resourceId.slice("handle:".length) : resourceId;
121
- const handle = this.handles.get(handleId);
122
- if (!handle)
123
- throw new BrokerProtocolError("RESOURCE_NOT_FOUND", "opaque handle is missing or expired", "Use a live Broker-issued resourceId.");
124
- return handle;
125
- }
126
- assertScope(handle, scope) {
127
- if (handle.ownerClientId !== scope.clientId)
128
- throw new BrokerProtocolError("RESOURCE_NOT_OWNER", "opaque handle belongs to another client");
129
- if (handle.pid !== scope.pid || handle.buildKey !== scope.buildKey)
130
- throw new BrokerProtocolError("SESSION_TARGET_MISMATCH", "opaque handle target scope changed");
131
- }
132
- toWire(handle) {
133
- const { value: _value, expiresAtMs: _expiresAtMs, ...wire } = handle;
134
- return wire;
135
- }
136
- createHandle(value, type, scope, created) {
137
- const handleId = randomUUID();
138
- const expiresAtMs = this.now() + this.ttlMs;
139
- const handle = { schema: BROKER_HANDLE_CODEC, handleId, resourceId: `handle:${handleId}`, type, ownerClientId: scope.clientId, pid: scope.pid, buildKey: scope.buildKey, expiresAt: new Date(expiresAtMs).toISOString(), expiresAtMs, refcount: 1, value };
140
- this.handles.set(handleId, handle);
141
- const { value: _value, expiresAtMs: _expiresAtMs, ...wire } = handle;
142
- created.push(wire);
143
- return wire;
144
- }
145
- prune() { for (const [handleId, handle] of this.handles)
146
- if (handle.expiresAtMs <= this.now())
147
- this.handles.delete(handleId); }
148
- }