diff --git a/src/agent/lib/info/index.ts b/src/agent/lib/info/index.ts index 7599d2a5..802bd4fb 100644 --- a/src/agent/lib/info/index.ts +++ b/src/agent/lib/info/index.ts @@ -2,7 +2,7 @@ import { getModuleByAddress } from './lookup.js'; import config from '../../config.js'; import { parseElfHeader, listElfSections, listElfSegments } from '../elf/index.js'; import { getCwd } from '../fs.js'; -import {JavaAvailable, performOnJavaVM } from '../java/index.js'; +import { JavaAvailable, performOnJavaVM } from '../java/index.js'; import r2 from '../r2.js'; import sys from '../sys.js'; import { ObjCAvailable, getSections, getSegments, listMachoSections, listMachoSegments } from '../darwin/index.js'; diff --git a/src/agent/lib/utils.ts b/src/agent/lib/utils.ts index bda957c7..206b70b6 100644 --- a/src/agent/lib/utils.ts +++ b/src/agent/lib/utils.ts @@ -10,7 +10,8 @@ let globalSymCounter = 0; export function sanitizeString(str: string): string { if (str) { const specialChars = "^/\\`+-${}~|*,;:\"'#@&<> ()[]!?%"; - return str.split('').map(c => specialChars.indexOf(c) === -1 ? c : '_').join(''); + const nonspecial = str.split('').map(c => specialChars.indexOf(c) === -1 ? c : '_').join(''); + return nonspecial.replace(/[\x00-\x1F\x7F]/g, ""); } else { globalSymCounter++; return 'noname.' + globalSymCounter;