mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
refactor(switch): share NSO and NRO header fields (#16954)
This commit is contained in:
1 parent
070362bf24
commit
d98d463ccf
1 file changed
+9
-14
@@ -42,18 +42,21 @@ export interface NsoSegment {
|
||||
readonly truncated: boolean;
|
||||
}
|
||||
|
||||
export interface NsoHeader {
|
||||
readonly format: "nso";
|
||||
interface SwitchModuleHeader<Segment> {
|
||||
readonly version: number;
|
||||
readonly flags: number;
|
||||
/** Flag bits outside the six that name compression and hash checks. */
|
||||
readonly unknownFlags: number;
|
||||
readonly moduleId: string;
|
||||
readonly bssSize: number;
|
||||
readonly embedded: SwitchExtent;
|
||||
readonly dynstr: SwitchExtent;
|
||||
readonly dynsym: SwitchExtent;
|
||||
readonly segments: readonly NsoSegment[];
|
||||
readonly segments: readonly Segment[];
|
||||
}
|
||||
|
||||
export interface NsoHeader extends SwitchModuleHeader<NsoSegment> {
|
||||
readonly format: "nso";
|
||||
/** Flag bits outside the six that name compression and hash checks. */
|
||||
readonly unknownFlags: number;
|
||||
}
|
||||
|
||||
export interface NroSegment {
|
||||
@@ -64,19 +67,11 @@ export interface NroSegment {
|
||||
readonly truncated: boolean;
|
||||
}
|
||||
|
||||
export interface NroHeader {
|
||||
export interface NroHeader extends SwitchModuleHeader<NroSegment> {
|
||||
readonly format: "nro";
|
||||
readonly version: number;
|
||||
readonly flags: number;
|
||||
/** Total NRO image size; an asset section, when present, starts here. */
|
||||
readonly size: number;
|
||||
readonly mod0Offset: number;
|
||||
readonly moduleId: string;
|
||||
readonly bssSize: number;
|
||||
readonly embedded: SwitchExtent;
|
||||
readonly dynstr: SwitchExtent;
|
||||
readonly dynsym: SwitchExtent;
|
||||
readonly segments: readonly NroSegment[];
|
||||
}
|
||||
|
||||
export type SwitchAssetName = "icon" | "nacp" | "romfs";
|
||||
|
||||
Reference in new issue
Block a user