Skip to content

Commit

Permalink
Dont flag unnamed symbols in :is*
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 12, 2023
1 parent 68639ff commit 211ffaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/agent/lib/info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ export function listSymbols(args: string[]) {
export function listSymbolsR2(args: string[]) {
return listSymbolsJson(args)
.filter(({ address }) => !address.isNull())
.filter(({ name }) => name !== "")
.map(({ name, address }) => {
return ['f', 'sym.' + sanitizeString(name), '=', address].join(' ');
})
Expand Down
5 changes: 4 additions & 1 deletion src/agent/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ declare let Swift: any;

const minPrintable = ' '.charCodeAt(0);
const maxPrintable = '~'.charCodeAt(0);
let globalSymCounter = 0;

export function sanitizeString(str: string): string {
if (str) {
const specialChars = "^/\\`+-${}~|*,;:\"'#@&<> ()[]!?%";
return str.split('').map(c => specialChars.indexOf(c) === -1 ? c : '_').join('');
} else {
globalSymCounter++;
return 'noname.' + globalSymCounter;
}
return str;
}

export function wrapStanza(name: string, stanza: any) {
Expand Down

0 comments on commit 211ffaa

Please sign in to comment.