Reverse engineer anything with agents, from app behavior down to native binaries.
TypeScript agent-skillsai-agentsbinary-analysisclaude-codeclicodexcordisdecompilerdeveloper-toolsdshdsh-pluginghidrahopperllmmcpmodel-context-protocolreareverse-engineeringstatic-analysistouhou
import { expect, it } from "vitest";
import { machoImageWithUnknownCommand } from "../artifacts/apple/MachoImage.fixture.js";
import { readRustBinaryImage } from "./RustBinaryImage.js";
import { RustAuditableFormatFailure } from "./RustAuditableReader.js";
it("maps malformed 64-bit Mach-O load-command alignment to Rust input failure", () => {
expect(() =>
readRustBinaryImage(Buffer.from(machoImageWithUnknownCommand(true, 12))),
).toThrow(RustAuditableFormatFailure);
expect(() =>
readRustBinaryImage(Buffer.from(machoImageWithUnknownCommand(true, 12))),
).toThrow(expect.objectContaining({ kind: "malformed" }));
});
it.each([
{ wide: true, size: 16 },
{ wide: false, size: 12 },
])(
"accepts $size-byte Rust Mach-O command for wide=$wide",
({ wide, size }) => {
expect(
readRustBinaryImage(Buffer.from(machoImageWithUnknownCommand(wide, size)))
.format,
).toBe("macho");
},
);