fix(cli): remove ignored result limits

This commit is contained in:
morluto
2026-09-29 09:22:57 +08:00
parent 7acac615ca
commit f3645aa51e
8 changed files with 7 additions and 45 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ const endpointTargetSchema = z.object({
attached: z.boolean().default(false), attached: z.boolean().default(false),
webSocketDebuggerUrl: z.string().min(1).max(2_048).optional(), webSocketDebuggerUrl: z.string().min(1).max(2_048).optional(),
}); });
const endpointTargetsSchema = z.array(endpointTargetSchema).max(1_000); const endpointTargetsSchema = z.array(endpointTargetSchema);
/** Validated direct CDP WebSocket bound to one discovered page target. */ /** Validated direct CDP WebSocket bound to one discovered page target. */
interface CdpPageWebSocketEndpoint { interface CdpPageWebSocketEndpoint {
+1 -1
View File
@@ -30,7 +30,7 @@ const targetSchema = z
webSocketDebuggerUrl: z.string().min(1).max(2_048), webSocketDebuggerUrl: z.string().min(1).max(2_048),
}) })
.passthrough(); .passthrough();
const targetsSchema = z.array(targetSchema).max(1_000); const targetsSchema = z.array(targetSchema);
export interface V8InspectorTarget { export interface V8InspectorTarget {
readonly id: string; readonly id: string;
+2 -33
View File
@@ -250,26 +250,12 @@ const registerInstructionsCommand = (
logger: Logger, logger: Logger,
): void => { ): void => {
cli.command(CLI_COMMANDS.instructions, { cli.command(CLI_COMMANDS.instructions, {
description: "Read one bounded raw-instruction window without decompiling", description: "Read every raw instruction without decompiling",
args: z.object({ args: z.object({
path: z.string().describe("App or program path"), path: z.string().describe("App or program path"),
address: z.string().describe("Procedure name or address"), address: z.string().describe("Procedure name or address"),
}), }),
options: z.object({ options: z.object({
offset: z
.number()
.int()
.min(0)
.max(100_000)
.default(0)
.describe("Zero-based instruction offset"),
limit: z
.number()
.int()
.min(1)
.max(500)
.default(64)
.describe("Maximum raw instructions to return"),
snapshot: z snapshot: z
.string() .string()
.min(1) .min(1)
@@ -284,8 +270,6 @@ const registerInstructionsCommand = (
"read_function_instructions", "read_function_instructions",
{ {
procedure: args.address, procedure: args.address,
offset: options.offset,
limit: options.limit,
}, },
directAnalysisOptions(logger, options.snapshot, options.provider), directAnalysisOptions(logger, options.snapshot, options.provider),
), ),
@@ -295,7 +279,7 @@ const registerInstructionsCommand = (
const registerSearchCommand = (cli: CliInstance, logger: Logger): void => { const registerSearchCommand = (cli: CliInstance, logger: Logger): void => {
cli.command(CLI_COMMANDS.search, { cli.command(CLI_COMMANDS.search, {
description: "Search analyzed strings or procedure names", description: "Search every analyzed string or procedure name",
args: z.object({ args: z.object({
path: z.string().describe("App or program path"), path: z.string().describe("App or program path"),
pattern: z.string().min(1).describe("Literal text or regex pattern"), pattern: z.string().min(1).describe("Literal text or regex pattern"),
@@ -313,19 +297,6 @@ const registerSearchCommand = (cli: CliInstance, logger: Logger): void => {
.boolean() .boolean()
.default(false) .default(false)
.describe("Match the pattern with exact letter case"), .describe("Match the pattern with exact letter case"),
offset: z
.number()
.int()
.min(0)
.default(0)
.describe("Zero-based matching-item offset"),
limit: z
.number()
.int()
.min(1)
.max(100)
.default(100)
.describe("Maximum matching items to return"),
snapshot: z snapshot: z
.string() .string()
.min(1) .min(1)
@@ -343,8 +314,6 @@ const registerSearchCommand = (cli: CliInstance, logger: Logger): void => {
pattern: args.pattern, pattern: args.pattern,
mode: options.mode, mode: options.mode,
case_sensitive: options.caseSensitive, case_sensitive: options.caseSensitive,
offset: options.offset,
limit: options.limit,
}, },
directAnalysisOptions(logger, options.snapshot, options.provider), directAnalysisOptions(logger, options.snapshot, options.provider),
), ),
+1 -2
View File
@@ -85,13 +85,12 @@ const registerNativeCommands = (cli: CliInstance, logger: Logger): void => {
), ),
}); });
cli.command(CLI_COMMANDS.demangleSwift, { cli.command(CLI_COMMANDS.demangleSwift, {
description: "Demangle a bounded Swift symbol batch without Hopper", description: "Demangle Swift symbols without Hopper",
args: z.object({ args: z.object({
path: z.string().describe("Artifact path used for evidence identity"), path: z.string().describe("Artifact path used for evidence identity"),
symbols: z symbols: z
.array(z.string().min(1)) .array(z.string().min(1))
.min(1) .min(1)
.max(500)
.describe("Swift mangled symbols to demangle"), .describe("Swift mangled symbols to demangle"),
}), }),
run: ({ args }) => run: ({ args }) =>
@@ -308,7 +308,7 @@ describe("reconstruction verification", () => {
createEvidenceBundle([left, comparison, right]), createEvidenceBundle([left, comparison, right]),
); );
expect(result.status).toBe("unknown"); expect(result.status).toBe("unknown");
expect(result.recommended_probes[0]?.operation).toBe("inventory_artifact"); expect(result.recommended_probes[0]?.operation).toBe("inspect_artifact");
}); });
}); });
+1 -1
View File
@@ -163,7 +163,7 @@ describe("compiled CLI output boundary", () => {
await writeFile(join(`${archive}.unpacked`, "main.js"), "changed();\n"); await writeFile(join(`${archive}.unpacked`, "main.js"), "changed();\n");
const result = await cli.run({ const result = await cli.run({
arguments: ["--json", "inventory-artifact", archive], arguments: ["--json", "inspect-artifact", archive],
}); });
expect(result.exitCode).toBe(1); expect(result.exitCode).toBe(1);
const output = JSON.stringify(result.json); const output = JSON.stringify(result.json);
@@ -36,7 +36,6 @@ type FixtureMode =
| "wrong_identity" | "wrong_identity"
| "malformed" | "malformed"
| "contradictory" | "contradictory"
| "oversized_whitespace"
| "future_id" | "future_id"
| "analysis_timeout" | "analysis_timeout"
| "remote_error" | "remote_error"
@@ -208,7 +207,6 @@ describe("GhidraClient", () => {
["wrong_identity", "protocol"], ["wrong_identity", "protocol"],
["malformed", "protocol"], ["malformed", "protocol"],
["contradictory", "protocol"], ["contradictory", "protocol"],
["oversized_whitespace", "protocol"],
["future_id", "protocol"], ["future_id", "protocol"],
["analysis_timeout", "analysis_timeout"], ["analysis_timeout", "analysis_timeout"],
["exit", "process"], ["exit", "process"],
-4
View File
@@ -143,10 +143,6 @@ const handlePing = (socket, request, state) => {
); );
return; return;
} }
if (state.mode === "oversized_whitespace") {
socket.write(`${" ".repeat(1024 * 1024 + 1)}\n`);
return;
}
if (state.mode === "future_id") { if (state.mode === "future_id") {
socket.write( socket.write(
`${JSON.stringify({ id: request.id + 10, ok: true, result: null })}\n`, `${JSON.stringify({ id: request.id + 10, ok: true, result: null })}\n`,