If Firebird database is corrupted, please follow these steps to fix it:
gfix.exe -v -full -user SYSDBA -pass masterkey path_to_your_database
gfix.exe -mend -user SYSDBA -pass masterkey path_to_your_database
gbak -b -v -user SYSDBA -pass masterkey path_to_your_database path_to_backup
gbak -c -v -user SYSDBA -pass masterkey path_to_backup path_to_database