lib/pe32-support.js
/**
     * Remove any assembly or data that isn't part of the given unit
     *
     * @param {string} unitName
     */
Remove any assembly or data that isn't part of the given unit
@param {string} unitName
Remove any assembly or data that isn ' t part of the given unit @param { string } unitName
deleteEverythingBut(unitName) {
        if (this.needsReconstruction) {
            let unitAddressSpaces = this.mapFileReader.getReconstructedUnitAddressSpace(unitName);
            for (let idx = 0; idx < this.mapFileReader.reconstructedSegments.length; idx++) {
                const info = this.mapFileReader.reconstructedSegments[idx];
                if (info.unitName !== unitName) {
                    if (info.segmentLength > 0) {
                        if (
                            !this.mapFileReader.isWithinAddressSpace(
                                unitAddressSpaces,
                                info.addressInt,
                                info.segmentLength,
                            )
                        ) {
                            this.deleteLinesBetweenAddresses(info.addressInt, info.addressInt + info.segmentLength);
                        }
                    }
                }
            }
        } else {
            let idx, info;
            for (idx = 0; idx < this.mapFileReader.segments.length; idx++) {
                info = this.mapFileReader.segments[idx];
                if (info.unitName !== unitName) {
                    this.deleteLinesBetweenAddresses(info.addressInt, info.addressInt + info.segmentLength);
                }
            }
            for (idx = 0; idx < this.mapFileReader.isegments.length; idx++) {
                info = this.mapFileReader.isegments[idx];
                if (info.unitName !== unitName) {
                    this.deleteLinesBetweenAddresses(info.addressInt, info.addressInt + info.segmentLength);
                }
            }
        }
    }
deleteEverythingBut ( unitName ) { if ( this . needsReconstruction ) { let unitAddressSpaces = this . mapFileReader . getReconstructedUnitAddressSpace ( unitName ) ; for ( let idx = 0 ; idx < this . mapFileReader . reconstructedSegments . length ; idx ++ ) { const info = this . mapFileReader . reconstructedSegments [ idx ] ; if ( info . unitName !== unitName ) { if ( info . segmentLength > 0 ) { if ( ! this . mapFileReader . isWithinAddressSpace ( unitAddressSpaces , info . addressInt , info . segmentLength , ) ) { this . deleteLinesBetweenAddresses ( info . addressInt , info . addressInt + info . segmentLength ) ; } } } } } else { let idx , info ; for ( idx = 0 ; idx < this . mapFileReader . segments . length ; idx ++ ) { info = this . mapFileReader . segments [ idx ] ; if ( info . unitName !== unitName ) { this . deleteLinesBetweenAddresses ( info . addressInt , info . addressInt + info . segmentLength ) ; } } for ( idx = 0 ; idx < this . mapFileReader . isegments . length ; idx ++ ) { info = this . mapFileReader . isegments [ idx ] ; if ( info . unitName !== unitName ) { this . deleteLinesBetweenAddresses ( info . addressInt , info . addressInt + info . segmentLength ) ; } } } }
Remove any assembly or data that isn't part of the given unit
 @param {string} unitName
Remove any assembly or data that isn ' t part of the given unit @param { string } unitName