Gehe zu deutscher Webseite

ViaThinkSoft CodeLib

This article is in:
CodeLibProgramming aidsC / C++

bool update_pe_timestamp(const char* filename, time_t timestamp) {
        size_t peoffset;
        FILE* fptr;
        
        fptr = fopen(filename, "rb+");
        if (fptr == NULL) return false;

        fseek(fptr, 0x3C, SEEK_SET);
        fread(&peoffset, sizeof(peoffset), 1, fptr);

        fseek(fptr, (long)peoffset + 8, SEEK_SET);
        fwrite(&timestamp, sizeof(time_t), 1, fptr);

        fclose(fptr);

        return true;
}
Daniel Marschall
ViaThinkSoft Co-Founder

Feedback? Problems? Please drop us a message!

Your name (optional):

E-mail address (optional):

Message: