/**
* Parses Hunk data in Amiga executable file
*
* @see {@link http://amiga-dev.wikidot.com/file-format:hunk}
*/
///
export interface Hunk {
index: number;
hunkType: HunkType;
/** Byte offset of this hunk in executable file */
fileOffset: number;
/** Type of memory to allocate */
memType: MemoryType;
/** Number of bytes to allocate */
allocSize: number;
/** Relocation information */
reloc32: RelocInfo32[];
/** Symbols defined in this hunk (if exported) */
symbols: SourceSymbol[];
/** Offsets of source files / lines (if exported in Line Debug data) */
lineDebugInfo: DebugInfo[];
/** Size of code/data binary in this hunk or to allocate in case of BSS */
dataSize?: number;
/** Byte offset of code/data binary relative to this hunk */
dataOffset?: number;
/** code/data binary */
data?: Buffer;
}
export declare enum HunkType {
CODE = "CODE",
DATA = "DATA",
BSS = "BSS"
}
export declare enum MemoryType {
ANY = "ANY",
CHIP = "CHIP",
FAST = "FAST"
}
export interface RelocInfo32 {
target: number;
offsets: number[];
}
export interface SourceSymbol {
name: string;
offset: number;
}
export interface SourceLine {
line: number;
offset: number;
}
export interface DebugInfo {
sourceFilename: string;
baseOffset: number;
lines: SourceLine[];
}
/**
* Extract an array of Hunks from an Amiga executable file
*/
export declare function parseHunksFromFile(filename: string): Promise;
/**
* Extract an array of Hunks from Amiga executable file data
*/
export declare function parseHunks(contents: Buffer): Hunk[];