Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- OpenDialog1->Execute();
- int hFile= FileOpen(OpenDialog1->FileName.c_str(),fmOpenRead);
- unsigned int valor;
- unsigned int checksum=0;
- //Coloco el puntero en el primer byte a modificar
- FileSeek (hFile,0x10,0);
- for(int i=0;i<0x4BB0;i+=4){
- FileRead(hFile, &valor, 4);
- checksum += valor;
- }
- while(checksum > 0x100000000)
- checksum -= 0x100000000;
- AnsiString salida;
- salida=salida.IntToHex(checksum,8);
- while(salida.Length() < 8)
- salida = "0" + salida;
- FileClose(hFile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement