Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

static int searchHeader ( uint8_t *  pb,
size_t  cb,
const char *  pszHeader,
uint8_t **  pbHeader 
) [static]

Find a header in the binary.

pb Where to search for the signature
cb Size of the search area
pbHeader Pointer to the start of the signature
0 if signature was not found, 1 if found or 2 if more than one signature was found

Definition at line 102 of file biossums.c.

References strlen().

    int          fFound = 0;
    unsigned int i;
    size_t       cbSignature = strlen(pszHeader);

    for (i = 0; i < cb; i += 16)
        if (!memcmp(pb + i, pszHeader, cbSignature))
            if (fFound++)
                return 2;
            *pbHeader = pb + i;

    return fFound;

Generated by  Doxygen 1.6.0   Back to index