Ejemplo n.º 1
0
static dip_status FindCV( dig_fhandle fid, unsigned long *offp, unsigned long *sizep )
{
    char        sig[CV_SIG_SIZE];
    dip_status  ds;

    ds = TryFindPE( fid, offp, sizep );
    if( ds & DS_ERR )
        return( ds );
    if( ds != DS_OK ) {
        ds = TryFindTrailer( fid, offp, sizep );
        if( ds != DS_OK ) {
            return( ds );
        }
    }
    if( DCSeek( fid, *offp, DIG_ORG ) != *offp ) {
        return( DS_ERR|DS_FSEEK_FAILED );
    }
    if( DCRead( fid, sig, sizeof( sig ) ) != sizeof( sig ) ) {
        return( DS_ERR|DS_FREAD_FAILED );
    }
    if( memcmp( sig, CV4_NB09, sizeof( sig ) ) != 0 ) {
        return( DS_FAIL );
    }
    return( DS_OK );
}
Ejemplo n.º 2
0
/*
 * Tries to locate HLL debug info within the specified file.
 *
 * Returns DS_OK if found, with '*offp' set to the offset of the debug info
 * (relative to the start of the file) and '*sizep' set to the size of it.
 */
static dip_status FindHLL( imp_image_handle *ii )
{
    dip_status      ds = TryFindInImage( ii );

    if( ds & DS_ERR )
        return( ds );
    if( ds != DS_OK ) {
        ds = TryFindTrailer( ii );
    }
    return( ds );
}