Skip to content

Commit

Permalink
Empty scripts shouldnt create empty flagspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Feb 19, 2024
1 parent 15625b7 commit dd8a557
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/agent/lib/info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ export function listEntrypointR2(args: string[]) : string {
.map((entry) => {
return 'f entry' + (n++) + ' = ' + entry.address;
}).join('\n');
if (entries === "") {
return "";
}
return "fs+symbols\n" + entries + "\nfs-";
}

Expand Down Expand Up @@ -260,6 +263,9 @@ export function listImportsR2(args: string[]) {
}
return flags.join('\n');
}).join('\n');
if (res === "") {
return "";
}
return "fs+symbols\n" + res + "\nfs-";
}

Expand Down Expand Up @@ -309,6 +315,9 @@ export function listModulesR2() {
const libs = Process.enumerateModules()
.map(m => 'f lib.' + sanitizeString(m.name) + ' = ' + padPointer(m.base))
.join('\n');
if (libs === "") {
return "";
}
return "fs+libs\n" + libs + "\nfs-";
}

Expand Down Expand Up @@ -518,6 +527,9 @@ export function listAllSymbolsR2(args: string[]) {
.map(({ type, name, address }) => {
return ['f', 'sym.' + type.substring(0, 3) + '.' + sanitizeString(name), '=', address].join(' ');
}).join('\n');
if (symbols === "") {
return "";
}
return "fs symbols\n" + symbols + "\nfs-";
}

Expand All @@ -537,6 +549,9 @@ export function listSymbolsR2(args: string[]) {
return ['f', 'sym.' + sanitizeString(name), '=', address].join(' ');
})
.join('\n');
if (symbols === "") {
return "";
}
return "fs symbols\n" + symbols + "\nfs-";
}

Expand Down

0 comments on commit dd8a557

Please sign in to comment.