lib/pe32-support.js
/**
     * Replaces an address used in a jmp or call instruction by its label.
     *  Does not replace an address if it has an offset.
     *
     * @param {int} lineIdx 
     * @param {regex} regex 
     */
Replaces an address used in a jmp or call instruction by its label.
Does not replace an address if it has an offset.

@param {int} lineIdx
@param {regex} regex
Replaces an address used in a jmp or call instruction by its label . Does not replace an address if it has an offset . @param { int } lineIdx @param { regex } regex
addAddressAsLabelAndReplaceLine(lineIdx, regex) {
        const line = this.asmLines[lineIdx];
        let matches = line.match(regex);
        if (matches) {
            const address = matches[3];
            if (!address.includes('+') && !address.includes('-')) {
                let labelName = 'L' + address;
                const namedAddr = this.mapFileReader.getSymbolAt(false, parseInt(address, 16));
                if (namedAddr) {
                    labelName = namedAddr.displayName;
                }
                if (!this.dontLabelUnmappedAddresses || namedAddr) {
                    this.addressesToLabel.push(address);
                    this.asmLines[lineIdx] = line.replace(regex, ' ' + matches[1] + matches[2] + labelName);
                }
            }
        }
    }
addAddressAsLabelAndReplaceLine ( lineIdx , regex ) { const line = this . asmLines [ lineIdx ] ; let matches = line . match ( regex ) ; if ( matches ) { const address = matches [ 3 ] ; if ( ! address . includes ( '+' ) && ! address . includes ( '-' ) ) { let labelName = 'L' + address ; const namedAddr = this . mapFileReader . getSymbolAt ( false , parseInt ( address , 16 ) ) ; if ( namedAddr ) { labelName = namedAddr . displayName ; } if ( ! this . dontLabelUnmappedAddresses || namedAddr ) { this . addressesToLabel . push ( address ) ; this . asmLines [ lineIdx ] = line . replace ( regex , ' ' + matches [ 1 ] + matches [ 2 ] + labelName ) ; } } } }
Replaces an address used in a jmp or call instruction by its label.
Replaces an address used in a jmp or call instruction by its label .