fix(javascript): exclude TypeScript this annotations from runtime parameters (#2761)
* fix(javascript): exclude TypeScript this annotations from runtime parameters * test(javascript): assert exact typed argument bindings * test(apple): keep dyld slice regression portable * fix(process): report no remaining time after a provider deadline fires Node timers can fire while performance.now() is still a fraction of a millisecond short of the monotonic deadline. ProviderStartupDeadline then reported interruption "timeout" and an aborted signal while remainingMs() returned ceil(0.x) = 1, so polling loops guarded by remainingMs() > 0 (Hopper and Ghidra startup) could run past an elapsed deadline, and the real-timer test "aborts a bounded wait when its real monotonic deadline expires" failed intermittently in CI (expected 1 to be 0). Once the deadline's own timer has classified a timeout, report zero remaining time. A deterministic regression test fires the timer with the monotonic clock 0.4 ms short of the deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): restore descriptor and fixture validation * test(ci): retain verification coverage within lint limits * fix(test): share admitted Ghidra profile installation fixtures * fix(ci): isolate timing report fixtures from workflow state --------- Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
co-authored by
hhang
Kaoru0822
Claude Opus 5.5
morluto
parent
02987d8e8c
commit
1ae9000587
@@ -98,7 +98,7 @@ const textCoverage = z.strictObject({
|
||||
text: z.string(),
|
||||
reported_total_bytes: z.number().int().nonnegative().nullable(),
|
||||
});
|
||||
/** A DEX prototype: parameter descriptors followed by the return descriptor. */
|
||||
/** A DEX prototype; hex parentheses also keep the advertised class valid in v mode. */
|
||||
export const dexDescriptorSchema = z
|
||||
.string()
|
||||
.regex(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as t from "@babel/types";
|
||||
import { runtimeFunctionParameters } from "./javascriptAstValues.js";
|
||||
import { JavaScriptSymbolicBindings } from "./javascriptSymbolicBindings.js";
|
||||
import {
|
||||
symbolicVariants,
|
||||
@@ -447,7 +448,9 @@ export const collectElectronWrappedCallPaths = (
|
||||
const entry = `${key.value}.${name}`;
|
||||
functionBody(
|
||||
fn,
|
||||
fn.node.params.map(() => symbolicUnknown("public API argument")),
|
||||
runtimeFunctionParameters(fn.node).map(() =>
|
||||
symbolicUnknown("public API argument"),
|
||||
),
|
||||
{
|
||||
...memberContext,
|
||||
entryNode: node,
|
||||
|
||||
@@ -7,6 +7,7 @@ import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
||||
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
||||
import {
|
||||
propertyName,
|
||||
runtimeFunctionParameters,
|
||||
semanticStaticPropertyKey,
|
||||
} from "./javascriptAstValues.js";
|
||||
import { stringValue } from "./javascriptStaticAnalysisHelpers.js";
|
||||
@@ -38,15 +39,13 @@ export const collectJavaScriptExports = (
|
||||
bindings?: JavaScriptSemanticAnalysisState,
|
||||
): StaticExports => {
|
||||
const exports = new Set<string>();
|
||||
const parameter = t.isFunction(node)
|
||||
? runtimeFunctionParameters(node)[1]
|
||||
: undefined;
|
||||
const factoryExports =
|
||||
bindings !== undefined &&
|
||||
t.isFunction(node) &&
|
||||
t.isIdentifier(node.params[1])
|
||||
? resolveSemanticBindingState(
|
||||
bindings,
|
||||
node.params[1],
|
||||
node.params[1].name,
|
||||
)?.bindingId
|
||||
bindings !== undefined && t.isFunction(node) && t.isIdentifier(parameter)
|
||||
? resolveSemanticBindingState(bindings, parameter, parameter.name)
|
||||
?.bindingId
|
||||
: undefined;
|
||||
const isExportsAlias = (reference: t.Node | null): boolean => {
|
||||
if (!t.isIdentifier(reference)) return false;
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import * as t from "@babel/types";
|
||||
import type { JavaScriptSemanticPrimitive } from "./javascriptSemanticValueTypes.js";
|
||||
|
||||
/** TypeScript receiver annotations occupy no positional runtime parameter slot. */
|
||||
export const runtimeFunctionParameters = (
|
||||
node: t.Function,
|
||||
): t.Function["params"] =>
|
||||
t.isIdentifier(node.params[0], { name: "this" })
|
||||
? node.params.slice(1)
|
||||
: node.params;
|
||||
|
||||
/**
|
||||
* Remove wrappers that affect TypeScript or Flow checking but not runtime
|
||||
* expression identity. The returned depth lets bounded evaluators account for
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import * as t from "@babel/types";
|
||||
|
||||
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
|
||||
import {
|
||||
semanticStaticPropertyKey,
|
||||
runtimeFunctionParameters,
|
||||
} from "./javascriptAstValues.js";
|
||||
import { moduleFactory } from "./javascriptStaticAnalysisHelpers.js";
|
||||
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
||||
import {
|
||||
@@ -27,7 +30,7 @@ export const javascriptBootstrapAt = (
|
||||
(!t.isFunctionExpression(call.callee) &&
|
||||
!t.isArrowFunctionExpression(call.callee)) ||
|
||||
!t.isBlockStatement(call.callee.body) ||
|
||||
call.callee.params.length !== 0 ||
|
||||
runtimeFunctionParameters(call.callee).length !== 0 ||
|
||||
call.arguments.length !== 0
|
||||
)
|
||||
return undefined;
|
||||
@@ -63,10 +66,10 @@ export const javascriptBootstrapAt = (
|
||||
!t.isFunctionDeclaration(loader) ||
|
||||
loader.id === null ||
|
||||
loader.id === undefined ||
|
||||
loader.params.length !== 1
|
||||
runtimeFunctionParameters(loader).length !== 1
|
||||
)
|
||||
continue;
|
||||
const parameter = loader.params[0];
|
||||
const parameter = runtimeFunctionParameters(loader)[0];
|
||||
if (!t.isIdentifier(parameter)) continue;
|
||||
const loaderName = loader.id.name;
|
||||
const loaderBindingId = bindingId(state, loader.id);
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
import { SemanticPropertyPathCoverage } from "./javascriptSemanticPropertyPaths.js";
|
||||
import {
|
||||
readExactJavaScriptLiteral,
|
||||
runtimeFunctionParameters,
|
||||
unwrapJavaScriptExpression,
|
||||
} from "./javascriptAstValues.js";
|
||||
|
||||
@@ -662,10 +663,10 @@ const identityFunction = (
|
||||
!t.isFunction(node) ||
|
||||
node.async ||
|
||||
node.generator ||
|
||||
node.params.length !== 1
|
||||
runtimeFunctionParameters(node).length !== 1
|
||||
)
|
||||
return false;
|
||||
const parameter = node.params[0];
|
||||
const parameter = runtimeFunctionParameters(node)[0];
|
||||
const result = t.isBlockStatement(node.body)
|
||||
? node.body.body.length === 1 && t.isReturnStatement(node.body.body[0])
|
||||
? node.body.body[0].argument
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
} from "./javascriptSemanticProjection.js";
|
||||
import {
|
||||
semanticObjectPatternKeys,
|
||||
runtimeFunctionParameters,
|
||||
semanticStaticPropertyKey,
|
||||
semanticWriteTargets,
|
||||
} from "./javascriptAstValues.js";
|
||||
@@ -717,7 +718,7 @@ function* collectDefinitionsSteps(
|
||||
functionBodies.push({
|
||||
body: node,
|
||||
scope: nested,
|
||||
parameters: parent.params,
|
||||
parameters: runtimeFunctionParameters(parent),
|
||||
});
|
||||
}
|
||||
const scope = currentSemanticScope(stack);
|
||||
@@ -1076,7 +1077,7 @@ const scopeKind = (
|
||||
};
|
||||
|
||||
const functionParametersHaveExpressions = (node: t.Function): boolean => {
|
||||
const pending: t.Node[] = [...node.params];
|
||||
const pending: t.Node[] = [...runtimeFunctionParameters(node)];
|
||||
while (pending.length > 0) {
|
||||
const parameter = pending.pop();
|
||||
if (t.isAssignmentPattern(parameter)) return true;
|
||||
@@ -1133,7 +1134,7 @@ const bindFunctionLocals = (
|
||||
scope: JavaScriptSemanticScopeState,
|
||||
state: JavaScriptSemanticAnalysisState,
|
||||
): void => {
|
||||
for (const parameter of node.params)
|
||||
for (const parameter of runtimeFunctionParameters(node))
|
||||
bindPattern({
|
||||
pattern: t.isTSParameterProperty(parameter)
|
||||
? parameter.parameter
|
||||
|
||||
@@ -6,7 +6,10 @@ import type {
|
||||
} from "./javascriptSemanticIr.js";
|
||||
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
||||
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
|
||||
import { unwrapJavaScriptExpression } from "./javascriptAstValues.js";
|
||||
import {
|
||||
unwrapJavaScriptExpression,
|
||||
runtimeFunctionParameters,
|
||||
} from "./javascriptAstValues.js";
|
||||
import {
|
||||
resolveSemanticBindingState,
|
||||
type JavaScriptSemanticAnalysisState,
|
||||
@@ -194,14 +197,15 @@ const parameterAcceptsArgument = (
|
||||
): boolean => {
|
||||
const node = state.callableNodesById.get(callable.callableId);
|
||||
if (!t.isFunction(node)) return false;
|
||||
const parameterIndex = node.params.findIndex((parameter) =>
|
||||
const parameters = runtimeFunctionParameters(node);
|
||||
const parameterIndex = parameters.findIndex((parameter) =>
|
||||
rangeContains(range(parameter), location),
|
||||
);
|
||||
if (parameterIndex === argumentIndex) return true;
|
||||
return (
|
||||
parameterIndex >= 0 &&
|
||||
parameterIndex < argumentIndex &&
|
||||
t.isRestElement(node.params[parameterIndex])
|
||||
t.isRestElement(parameters[parameterIndex])
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createHash } from "node:crypto";
|
||||
|
||||
import * as t from "@babel/types";
|
||||
import { runtimeFunctionParameters } from "./javascriptAstValues.js";
|
||||
|
||||
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
||||
import type { JavaScriptSemanticCallAnalysis } from "./javascriptSemanticCalls.js";
|
||||
@@ -279,7 +280,7 @@ const relationShape = (
|
||||
];
|
||||
|
||||
const callableParameterArity = (node: t.Node): number =>
|
||||
t.isFunction(node) ? node.params.length : 0;
|
||||
t.isFunction(node) ? runtimeFunctionParameters(node).length : 0;
|
||||
|
||||
const isAsyncCallable = (node: t.Node): boolean =>
|
||||
t.isFunction(node) && node.async;
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as t from "@babel/types";
|
||||
|
||||
import {
|
||||
semanticObjectPatternKeys,
|
||||
runtimeFunctionParameters,
|
||||
semanticStaticPropertyKey,
|
||||
} from "./javascriptAstValues.js";
|
||||
import {
|
||||
@@ -212,7 +213,8 @@ export const semanticIterationSources = (
|
||||
else if (t.isYieldExpression(node) && node.delegate && node.argument != null)
|
||||
add(sources, { node: node.argument, projection: [] }, node, {});
|
||||
else if (t.isFunction(node))
|
||||
for (const parameter of node.params) visit(context, parameter, undefined);
|
||||
for (const parameter of runtimeFunctionParameters(node))
|
||||
visit(context, parameter, undefined);
|
||||
|
||||
return sources;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as t from "@babel/types";
|
||||
import { runtimeFunctionParameters } from "./javascriptAstValues.js";
|
||||
import { javascriptBootstrapAt } from "./javascriptBootstrap.js";
|
||||
import {
|
||||
resolveSemanticBindingState,
|
||||
@@ -304,7 +305,7 @@ const runtimeMetadata = (node: t.Node | null | undefined): RuntimeMetadata => {
|
||||
asyncChunkKeys: [],
|
||||
unknownAsyncChunkKeys: 0,
|
||||
};
|
||||
const parameter = node.params[0];
|
||||
const parameter = runtimeFunctionParameters(node)[0];
|
||||
const requireName = t.isIdentifier(parameter) ? parameter.name : null;
|
||||
if (requireName === null)
|
||||
return {
|
||||
|
||||
@@ -13,6 +13,7 @@ import type {
|
||||
} from "./javascriptStaticAnalysisTypes.js";
|
||||
import {
|
||||
readExactJavaScriptLiteral,
|
||||
runtimeFunctionParameters,
|
||||
semanticStaticPropertyKey,
|
||||
semanticStaticPropertyName,
|
||||
unwrapJavaScriptExpression,
|
||||
@@ -147,7 +148,7 @@ export const modulePropertyName = (
|
||||
export const factoryRequireName = (
|
||||
factory: t.FunctionExpression | t.ArrowFunctionExpression | t.ObjectMethod,
|
||||
): string | null => {
|
||||
const parameter = factory.params[2];
|
||||
const parameter = runtimeFunctionParameters(factory)[2];
|
||||
return t.isIdentifier(parameter) ? parameter.name : null;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as t from "@babel/types";
|
||||
import {
|
||||
semanticStaticPropertyKey,
|
||||
runtimeFunctionParameters,
|
||||
unwrapJavaScriptExpression,
|
||||
} from "./javascriptAstValues.js";
|
||||
import { javascriptBootstrapAt } from "./javascriptBootstrap.js";
|
||||
@@ -387,7 +388,7 @@ export class JavaScriptSymbolicBindings {
|
||||
invocationNode?: t.Node,
|
||||
): SymbolicEnvironment {
|
||||
const values = new Map<string, SymbolicValue>();
|
||||
fn.node.params.forEach((param, index) => {
|
||||
runtimeFunctionParameters(fn.node).forEach((param, index) => {
|
||||
const target = t.isRestElement(param) ? param.argument : param;
|
||||
if (!t.isIdentifier(target)) return;
|
||||
const binding = resolveSemanticBindingState(
|
||||
@@ -866,9 +867,7 @@ export class JavaScriptSymbolicBindings {
|
||||
? {}
|
||||
: { scopeId: this.state.scopeByNode.get(factory)!.scopeId }),
|
||||
};
|
||||
const first = factory.params[0];
|
||||
const second = factory.params[1];
|
||||
const third = factory.params[2];
|
||||
const [first, second, third] = runtimeFunctionParameters(factory);
|
||||
const binding = (n: t.Node | undefined) =>
|
||||
t.isIdentifier(n)
|
||||
? resolveSemanticBindingState(this.state, n, n.name)?.bindingId
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
type GhidraSeedCommitment,
|
||||
type GhidraSeedReport,
|
||||
} from "./GhidraAnalysisSeeds.js";
|
||||
import type { GhidraInstallationHost } from "./GhidraInstallation.js";
|
||||
import { ghidraProfileInstallationHost as host } from "./GhidraInstallation.fixture.js";
|
||||
import { GhidraProvider } from "./GhidraProvider.js";
|
||||
|
||||
const directories: string[] = [];
|
||||
@@ -193,19 +193,6 @@ describe("Ghidra seed session verification", () => {
|
||||
});
|
||||
|
||||
describe("Ghidra seed profile", () => {
|
||||
const host: GhidraInstallationHost = {
|
||||
platform: "linux",
|
||||
architecture: "x64",
|
||||
readText: () => "application.version=12.1.4\napplication.java.min=21\n",
|
||||
executable: () => true,
|
||||
probeJava: () => ({
|
||||
version: "21.0.11",
|
||||
major: 21,
|
||||
home: "/jdk-21",
|
||||
bits: 64,
|
||||
runtime: "jdk",
|
||||
}),
|
||||
};
|
||||
const pe: BinaryTarget = {
|
||||
path: "/fixture.exe",
|
||||
sha256: "a".repeat(64),
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { GhidraInstallationHost } from "./GhidraInstallation.js";
|
||||
|
||||
/** Simulated valid installation for profile tests; never starts Ghidra or Java. */
|
||||
export const ghidraProfileInstallationHost: GhidraInstallationHost = {
|
||||
platform: "linux",
|
||||
architecture: "x64",
|
||||
readText: () => "application.version=12.1.4\napplication.java.min=21\n",
|
||||
executable: () => true,
|
||||
probeJava: () => ({
|
||||
version: "21.0.11",
|
||||
major: 21,
|
||||
home: "/jdk-21",
|
||||
bits: 64,
|
||||
runtime: "jdk",
|
||||
}),
|
||||
};
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
ghidraProfileLanguageOverride,
|
||||
sameGhidraLanguageOverride,
|
||||
} from "./GhidraAnalysisProfile.js";
|
||||
import type { GhidraInstallationHost } from "./GhidraInstallation.js";
|
||||
import { ghidraProfileInstallationHost as host } from "./GhidraInstallation.fixture.js";
|
||||
import {
|
||||
admitGhidraLanguageOverride,
|
||||
parseGhidraLanguageDefinitions,
|
||||
@@ -39,21 +39,6 @@ const X86_LDEFS = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
</language_definitions>
|
||||
`;
|
||||
|
||||
// Fake installation inspection; the language catalog is a real directory.
|
||||
const host: GhidraInstallationHost = {
|
||||
platform: "linux",
|
||||
architecture: "x64",
|
||||
readText: () => "application.version=12.1.4\napplication.java.min=21\n",
|
||||
executable: () => true,
|
||||
probeJava: () => ({
|
||||
version: "21.0.11",
|
||||
major: 21,
|
||||
home: "/jdk-21",
|
||||
bits: 64,
|
||||
runtime: "jdk",
|
||||
}),
|
||||
};
|
||||
|
||||
const pe: BinaryTarget = {
|
||||
path: "/fixture.exe",
|
||||
sha256: "a".repeat(64),
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
ghidraMipsProfileParameters,
|
||||
ghidraPinnedMipsLanguage,
|
||||
} from "./GhidraMipsProfile.js";
|
||||
import type { GhidraInstallationHost } from "./GhidraInstallation.js";
|
||||
import { ghidraProfileInstallationHost as host } from "./GhidraInstallation.fixture.js";
|
||||
import { GHIDRA_SESSION_CAPABILITIES } from "./GhidraSessionValues.js";
|
||||
import type { GhidraMipsSoftFloatReport } from "./GhidraMipsProfile.js";
|
||||
import {
|
||||
@@ -22,20 +22,6 @@ import {
|
||||
ghidraProfileLanguageOverride,
|
||||
} from "./GhidraAnalysisProfile.js";
|
||||
|
||||
// Fake installation inspection tests admission/profile contracts, not Ghidra.
|
||||
const host: GhidraInstallationHost = {
|
||||
platform: "linux",
|
||||
architecture: "x64",
|
||||
readText: () => "application.version=12.1.4\napplication.java.min=21\n",
|
||||
executable: () => true,
|
||||
probeJava: () => ({
|
||||
version: "21.0.11",
|
||||
major: 21,
|
||||
home: "/jdk-21",
|
||||
bits: 64,
|
||||
runtime: "jdk",
|
||||
}),
|
||||
};
|
||||
const parsed = parseConfig({ GHIDRA_INSTALL_DIR: "/ghidra" });
|
||||
if (!parsed.ok) throw parsed.error;
|
||||
const config = parsed.value;
|
||||
@@ -155,7 +141,13 @@ describe("bounded Ghidra MIPS admission", () => {
|
||||
reason: expect.stringContaining(reason),
|
||||
});
|
||||
const resolved = await ghidra.resolveAnalysisProfile(value);
|
||||
expect(resolved.ok).toBe(false);
|
||||
expect(resolved).toMatchObject({
|
||||
ok: false,
|
||||
error: {
|
||||
_tag: "AnalysisUnsupportedTargetError",
|
||||
reason: expect.stringContaining(reason),
|
||||
},
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -180,7 +172,13 @@ describe("recordless legacy MIPS32 admission", () => {
|
||||
status: "unsupported",
|
||||
});
|
||||
const resolved = await ghidra.resolveAnalysisProfile(object);
|
||||
expect(resolved.ok).toBe(false);
|
||||
expect(resolved).toMatchObject({
|
||||
ok: false,
|
||||
error: {
|
||||
_tag: "AnalysisUnsupportedTargetError",
|
||||
reason: expect.stringContaining("ET_EXEC"),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
ghidraProfileLanguageOverride,
|
||||
} from "./GhidraAnalysisProfile.js";
|
||||
import { GhidraProvider } from "./GhidraProvider.js";
|
||||
import type { GhidraInstallationHost } from "./GhidraInstallation.js";
|
||||
import { ghidraProfileInstallationHost as host } from "./GhidraInstallation.fixture.js";
|
||||
|
||||
// Abbreviated from Ghidra 12.1.4 Processors/PowerPC/data/languages/ppc.ldefs.
|
||||
const PPC_LDEFS = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
@@ -32,20 +32,6 @@ const PPC_LDEFS = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
</language_definitions>
|
||||
`;
|
||||
|
||||
// Fake installation inspection tests admission/profile contracts, not Ghidra.
|
||||
const host: GhidraInstallationHost = {
|
||||
platform: "linux",
|
||||
architecture: "x64",
|
||||
readText: () => "application.version=12.1.4\n",
|
||||
executable: () => true,
|
||||
probeJava: () => ({
|
||||
version: "21.0.11",
|
||||
major: 21,
|
||||
home: "/jdk-21",
|
||||
bits: 64,
|
||||
runtime: "jdk",
|
||||
}),
|
||||
};
|
||||
const configFor = (environment: NodeJS.ProcessEnv) => {
|
||||
const parsed = parseConfig({ GHIDRA_INSTALL_DIR: "/ghidra", ...environment });
|
||||
if (!parsed.ok) throw parsed.error;
|
||||
@@ -65,6 +51,7 @@ const target = (change: Partial<PowerPcElfMetadata> = {}): BinaryTarget => ({
|
||||
describe("bounded Ghidra PowerPC admission", () => {
|
||||
it("binds the generic language instead of the loader's e500 choice", async () => {
|
||||
const ghidra = new GhidraProvider(config, silentLogger, {}, host);
|
||||
expect(ghidra.inspectAvailability()).toMatchObject({ status: "available" });
|
||||
expect(ghidra.inspectTargetSupport(target()).status).toBe("supported");
|
||||
const resolved = await ghidra.resolveAnalysisProfile(target());
|
||||
if (!resolved.ok) throw resolved.error;
|
||||
@@ -152,7 +139,13 @@ describe("bounded Ghidra PowerPC admission", () => {
|
||||
reason: expect.stringContaining(reason),
|
||||
});
|
||||
const resolved = await ghidra.resolveAnalysisProfile(value);
|
||||
expect(resolved.ok).toBe(false);
|
||||
expect(resolved).toMatchObject({
|
||||
ok: false,
|
||||
error: {
|
||||
_tag: "AnalysisUnsupportedTargetError",
|
||||
reason: expect.stringContaining(reason),
|
||||
},
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { hopperLoaderArgsForTarget } from "../hopper/HopperAnalysisProfile.js";
|
||||
import { IdaProvider } from "../ida/IdaProvider.js";
|
||||
import { GhidraProvider } from "./GhidraProvider.js";
|
||||
import { ghidraRiscvLimitations } from "./GhidraRiscvProfile.js";
|
||||
import type { GhidraInstallationHost } from "./GhidraInstallation.js";
|
||||
import { ghidraProfileInstallationHost as host } from "./GhidraInstallation.fixture.js";
|
||||
import {
|
||||
ghidraPinnedLanguage,
|
||||
ghidraProfileLanguageOverride,
|
||||
@@ -49,20 +49,6 @@ const RISCV_LDEFS = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
</language_definitions>
|
||||
`;
|
||||
|
||||
// Fake installation inspection tests admission/profile contracts, not Ghidra.
|
||||
const host: GhidraInstallationHost = {
|
||||
platform: "linux",
|
||||
architecture: "x64",
|
||||
readText: () => "application.version=12.1.4\napplication.java.min=21\n",
|
||||
executable: () => true,
|
||||
probeJava: () => ({
|
||||
version: "21.0.11",
|
||||
major: 21,
|
||||
home: "/jdk-21",
|
||||
bits: 64,
|
||||
runtime: "jdk",
|
||||
}),
|
||||
};
|
||||
const configOf = (
|
||||
installDir: string,
|
||||
environment: Record<string, string> = {},
|
||||
|
||||
Reference in New Issue
Block a user