test(package): share validated native dossier fixtures
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
import { functionDossierSchema } from "../../dist/domain/hopperValues.js";
|
||||||
|
|
||||||
|
/** Validated synthetic native observations shared by managed verification lanes. */
|
||||||
|
export const functionDossier = (name) =>
|
||||||
|
functionDossierSchema.parse({
|
||||||
|
procedure: {
|
||||||
|
address: "0x401000",
|
||||||
|
name,
|
||||||
|
classification: {
|
||||||
|
external: false,
|
||||||
|
thunk: false,
|
||||||
|
thunk_target: null,
|
||||||
|
provenance: "synthetic-provider",
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
available: false,
|
||||||
|
reason: "Synthetic provider does not supply function body ranges.",
|
||||||
|
},
|
||||||
|
signature: null,
|
||||||
|
locals: [],
|
||||||
|
},
|
||||||
|
pseudocode: "",
|
||||||
|
assembly: [],
|
||||||
|
comments: [],
|
||||||
|
callers: [],
|
||||||
|
callees: [],
|
||||||
|
incoming_references: [],
|
||||||
|
outgoing_references: [],
|
||||||
|
referenced_strings: [],
|
||||||
|
referenced_names: [],
|
||||||
|
basic_blocks: [],
|
||||||
|
native_api: null,
|
||||||
|
native_value_flow: null,
|
||||||
|
limitations: [],
|
||||||
|
});
|
||||||
@@ -69,32 +69,3 @@ export const pathExists = async (path) => {
|
|||||||
throw cause;
|
throw cause;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Synthetic function dossier for managed/native verification fixtures. */
|
|
||||||
export const functionDossier = (name) => {
|
|
||||||
return {
|
|
||||||
procedure: {
|
|
||||||
address: "0x401000",
|
|
||||||
name,
|
|
||||||
classification: {
|
|
||||||
external: false,
|
|
||||||
thunk: false,
|
|
||||||
thunk_target: null,
|
|
||||||
provenance: "synthetic-provider",
|
|
||||||
},
|
|
||||||
signature: null,
|
|
||||||
locals: [],
|
|
||||||
},
|
|
||||||
pseudocode: "",
|
|
||||||
assembly: [],
|
|
||||||
comments: [],
|
|
||||||
callers: [],
|
|
||||||
callees: [],
|
|
||||||
incoming_references: [],
|
|
||||||
outgoing_references: [],
|
|
||||||
referenced_strings: [],
|
|
||||||
referenced_names: [],
|
|
||||||
basic_blocks: [],
|
|
||||||
limitations: [],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { join } from "node:path";
|
|||||||
|
|
||||||
import { createEvidence } from "../dist/domain/evidence.js";
|
import { createEvidence } from "../dist/domain/evidence.js";
|
||||||
import { buildManagedPeFixture } from "./fixtures/managed/pe.mjs";
|
import { buildManagedPeFixture } from "./fixtures/managed/pe.mjs";
|
||||||
import { functionDossier, json, run } from "./lib/verify-package-core.mjs";
|
import { functionDossier } from "./fixtures/function-dossier.mjs";
|
||||||
|
import { json, run } from "./lib/verify-package-core.mjs";
|
||||||
|
|
||||||
const buildManagedFixtures = async (workspace) => {
|
const buildManagedFixtures = async (workspace) => {
|
||||||
const managedPath = join(workspace, "managed-fixture.exe");
|
const managedPath = join(workspace, "managed-fixture.exe");
|
||||||
|
|||||||
@@ -50,37 +50,3 @@ export const comparisonLimits = {
|
|||||||
export const defaultIlBody = Buffer.from([
|
export const defaultIlBody = Buffer.from([
|
||||||
0x32, 0x02, 0x7b, 0x01, 0x00, 0x00, 0x04, 0x28, 0x01, 0x00, 0x00, 0x0a, 0x2a,
|
0x32, 0x02, 0x7b, 0x01, 0x00, 0x00, 0x04, 0x28, 0x01, 0x00, 0x00, 0x0a, 0x2a,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function functionDossier(name) {
|
|
||||||
return {
|
|
||||||
procedure: {
|
|
||||||
address: "0x401000",
|
|
||||||
name,
|
|
||||||
classification: {
|
|
||||||
external: false,
|
|
||||||
thunk: false,
|
|
||||||
thunk_target: null,
|
|
||||||
provenance: "synthetic-provider",
|
|
||||||
},
|
|
||||||
body: {
|
|
||||||
available: false,
|
|
||||||
reason: "Synthetic provider does not supply function body ranges.",
|
|
||||||
},
|
|
||||||
signature: null,
|
|
||||||
locals: [],
|
|
||||||
},
|
|
||||||
pseudocode: "",
|
|
||||||
assembly: [],
|
|
||||||
comments: [],
|
|
||||||
callers: [],
|
|
||||||
callees: [],
|
|
||||||
incoming_references: [],
|
|
||||||
outgoing_references: [],
|
|
||||||
referenced_strings: [],
|
|
||||||
referenced_names: [],
|
|
||||||
basic_blocks: [],
|
|
||||||
native_api: null,
|
|
||||||
native_value_flow: null,
|
|
||||||
limitations: [],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { projectManagedApplicationGraphEvidence } from "../../../dist/applicatio
|
|||||||
import { traceApplicationFeatureEvidence } from "../../../dist/application/javascript/JavaScriptApplicationWorkflowService.js";
|
import { traceApplicationFeatureEvidence } from "../../../dist/application/javascript/JavaScriptApplicationWorkflowService.js";
|
||||||
import { MANAGED_STATIC_PROVIDER } from "../../../dist/application/InvestigationProviders.js";
|
import { MANAGED_STATIC_PROVIDER } from "../../../dist/application/InvestigationProviders.js";
|
||||||
import { createEvidence } from "../../../dist/domain/evidence.js";
|
import { createEvidence } from "../../../dist/domain/evidence.js";
|
||||||
|
import { functionDossier } from "../../fixtures/function-dossier.mjs";
|
||||||
import {
|
import {
|
||||||
alternateMvid,
|
alternateMvid,
|
||||||
buildNativePeFixture,
|
buildNativePeFixture,
|
||||||
@@ -21,7 +22,6 @@ import { createManagedConformanceSupport } from "./support.mjs";
|
|||||||
import {
|
import {
|
||||||
comparisonLimits,
|
comparisonLimits,
|
||||||
defaultIlBody,
|
defaultIlBody,
|
||||||
functionDossier,
|
|
||||||
inspectionLimits,
|
inspectionLimits,
|
||||||
memberLimits,
|
memberLimits,
|
||||||
nativeBoundaryLimits,
|
nativeBoundaryLimits,
|
||||||
|
|||||||
Vendored
+8
@@ -87,6 +87,11 @@ const enhancedFixtureResult = (method) => {
|
|||||||
procedure: {
|
procedure: {
|
||||||
address: "0x1000",
|
address: "0x1000",
|
||||||
name: "fixture",
|
name: "fixture",
|
||||||
|
classification: null,
|
||||||
|
body: {
|
||||||
|
available: false,
|
||||||
|
reason: "The fixture has no function body-extent observation.",
|
||||||
|
},
|
||||||
signature: null,
|
signature: null,
|
||||||
locals: [],
|
locals: [],
|
||||||
},
|
},
|
||||||
@@ -100,6 +105,9 @@ const enhancedFixtureResult = (method) => {
|
|||||||
referenced_strings: [],
|
referenced_strings: [],
|
||||||
referenced_names: [],
|
referenced_names: [],
|
||||||
basic_blocks: [{ start: "0x1000", end: "0x1001", successors: [] }],
|
basic_blocks: [{ start: "0x1000", end: "0x1001", successors: [] }],
|
||||||
|
native_api: null,
|
||||||
|
native_value_flow: null,
|
||||||
|
limitations: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case "search_strings":
|
case "search_strings":
|
||||||
|
|||||||
Reference in New Issue
Block a user