lib/pe32-support.js
/**
     * Injects labels into the assembly where addresses are referred to
     *  if an address doesn't have a mapped name, it is called <Laddress>
     */
Injects labels into the assembly where addresses are referred to
if an address doesn't have a mapped name, it is called 
Injects labels into the assembly where addresses are referred to if an address doesn ' t have a mapped name it is called
insertLabels() {
        let currentSegment = false;
        let segmentChanged = false;
        let lineIdx = 0;
        while (lineIdx < this.asmLines.length) {
            const line = this.asmLines[lineIdx];
            const matches = line.match(this.addressRegex);
            if (matches) {
                const addressStr = matches[1];
                const address = parseInt(addressStr, 16);
                const segmentInfo = this.mapFileReader.getSegmentInfoByStartingAddress(false, address);
                if (segmentInfo) {
                    currentSegment = segmentInfo;
                    segmentChanged = true;
                }
                let namedAddr = false;
                let labelLine = false;
                const isReferenced = this.addressesToLabel.indexOf(addressStr);
                if (isReferenced !== -1) {
                    labelLine = matches[1] + ' <L' + addressStr + '>:';
                    namedAddr = this.mapFileReader.getSymbolAt(false, address);
                    if (namedAddr) {
                        labelLine = matches[1] + ' <' + namedAddr.displayName + '>:';
                    }
                    if (!this.dontLabelUnmappedAddresses || namedAddr) {
                        this.asmLines.splice(lineIdx, 0, labelLine);
                        lineIdx++;
                    }
                } else {
                    namedAddr = this.mapFileReader.getSymbolAt(false, address);
                    if (namedAddr) {
                        labelLine = matches[1] + ' <' + namedAddr.displayName + '>:';
                        this.asmLines.splice(lineIdx, 0, labelLine);
                        lineIdx++;
                    }
                }
                const lineInfo = this.mapFileReader.getLineInfoByAddress(false, address);
                if (lineInfo && currentSegment.unitName) {
                    this.asmLines.splice(lineIdx, 0, '/app/' + currentSegment.unitName + ':' + lineInfo.lineNumber);
                    lineIdx++;
                } else if (segmentChanged) {
                    this.asmLines.splice(lineIdx, 0, '/app/' + currentSegment.unitName + ':0');
                    lineIdx++;
                }
            }
            lineIdx++;
        }
    }
insertLabels ( ) { let currentSegment = false ; let segmentChanged = false ; let lineIdx = 0 ; while ( lineIdx < this . asmLines . length ) { const line = this . asmLines [ lineIdx ] ; const matches = line . match ( this . addressRegex ) ; if ( matches ) { const addressStr = matches [ 1 ] ; const address = parseInt ( addressStr , 16 ) ; const segmentInfo = this . mapFileReader . getSegmentInfoByStartingAddress ( false , address ) ; if ( segmentInfo ) { currentSegment = segmentInfo ; segmentChanged = true ; } let namedAddr = false ; let labelLine = false ; const isReferenced = this . addressesToLabel . indexOf ( addressStr ) ; if ( isReferenced !== - 1 ) { labelLine = matches [ 1 ] + ' <L' + addressStr + '>:' ; namedAddr = this . mapFileReader . getSymbolAt ( false , address ) ; if ( namedAddr ) { labelLine = matches [ 1 ] + ' <' + namedAddr . displayName + '>:' ; } if ( ! this . dontLabelUnmappedAddresses || namedAddr ) { this . asmLines . splice ( lineIdx , 0 , labelLine ) ; lineIdx ++ ; } } else { namedAddr = this . mapFileReader . getSymbolAt ( false , address ) ; if ( namedAddr ) { labelLine = matches [ 1 ] + ' <' + namedAddr . displayName + '>:' ; this . asmLines . splice ( lineIdx , 0 , labelLine ) ; lineIdx ++ ; } } const lineInfo = this . mapFileReader . getLineInfoByAddress ( false , address ) ; if ( lineInfo && currentSegment . unitName ) { this . asmLines . splice ( lineIdx , 0 , '/app/' + currentSegment . unitName + ':' + lineInfo . lineNumber ) ; lineIdx ++ ; } else if ( segmentChanged ) { this . asmLines . splice ( lineIdx , 0 , '/app/' + currentSegment . unitName + ':0' ) ; lineIdx ++ ; } } lineIdx ++ ; } }
Injects labels into the assembly where addresses are referred to
  if an address doesn't have a mapped name, it is called <Laddress>
Injects labels into the assembly where addresses are referred to if an address doesn ' t have a mapped name it is called <Laddress >
// we might have missed the reference to this address, //  but if it's listed as a symbol, we should still label it. // todo: the call might be in <.itext>, should we include that part of the assembly?