Exemple #1
0
void 
G64Archive::selectItem(int n)
{
    fp = getStartOfItem(n);
    fp += 2; // skip length information
    fp_eof = fp + getSizeOfItem(n);
}
void
T64Archive::dumpDirectory()
{
    Archive::dumpDirectory();
    
    for (unsigned i = 0; i < getNumberOfItems(); i++) {
        fprintf(stderr, "  Item %2d:      %s (%d bytes, load address: %d)\n",
                i, getNameOfItem(i), getSizeOfItem(i), getDestinationAddrOfItem(i));
    }
}
Exemple #3
0
void
Archive::dumpDirectory()
{
    msg("Archive:           %s\n", getName());
    msg("-------\n");
    msg("  Path:            %s\n", getPath());
    msg("  Items:           %d\n", getNumberOfItems());

    for (unsigned i = 0; i < getNumberOfItems(); i++) {
        msg("  Item %2d:      %s (%d bytes, load address: %d)\n",
                i, getNameOfItem(i), getSizeOfItem(i), getDestinationAddrOfItem(i));
        msg("                 ");
        selectItem(i);
        for (unsigned j = 0; j < 8; j++) {
            int byte = getByte();
            if (byte != -1)
                msg("%02X ", byte);
        }
        msg("\n");
    }
}
Exemple #4
0
void
T64File::selectItem(unsigned item)
{
    // Invalidate the file pointer if a non-existing item is requested.
    if (item >= numberOfItems()) {
        iFp = -1;
        return;
    }
    
    // Remember the selection
    selectedItem = item;
    
    // Set file pointer and end of file index
    unsigned i = 0x48 + (item * 0x20);
    iFp = LO_LO_HI_HI(data[i], data[i+1], data[i+2], data[i+3]);
    iEof = iFp + getSizeOfItem();
    
    // Check for inconsistent values. As all inconsistencies should have
    // been ruled out by repair(), the if condition should never hit.
    if (iFp > size || iEof > size) {
        assert(false);
    }
}