PDA

View Full Version : Game files integrity check - XHash Library


BLACKFIRE69
03-09-2020, 05:52
Game files integrity check - XHash Library


What's New:


Stable.
Faster.
Supports both generate and verify checksum procedures.
support for multiple algorithms in one hash file (ex: hash_mixed.md5) for verification. (Only for CRC32, MD5, SHA1, SHA256, SHA512)



ChecksumX
USAGE:
ChecksumX.exe (generate) (autoclose) (/x=<ExcludeFile>) <Checksum_File> <Algorithm_Index> <Base_Path>

OPTIONS:
generate - Generate a checksumfile.
autoclose - Automatically close when the process is done.
/x=<file> - Exclude file masks list for generate only.
_Algorithm:

CRC32
MD5
SHA1
SHA256
SHA512
SHA512_256
SHA3_256
SHA3_512
BLAKE2_128
BLAKE2_256
BLAKE3_256
HAVAL3_128
HAVAL3_256
RIPEMD_128
RIPEMD_256
TIGER_128
TIGER_192
TIGER2_128
TIGER2_192
MURMURHASH_32
XXHASH_32

BLACKFIRE69
05-09-2020, 11:58
XHash Update 1.1v



Added more Algos.

- md5
- sha1
- sha256
- sha512


Fixed some bugs.


_

Balaji007
05-10-2020, 10:15
I am appreciating your work friend. Your tools are pretty cool

Epic Titan 69
20-02-2021, 21:37
XHash Update 1.1v



Added more Algos.

- md5
- sha1
- sha256
- sha512


Fixed some bugs.


_
Can You Add This Option (Game files integrity check - XHash Library)
To This Script (https://fileforums.com/showthread.php?t=102774&highlight=windows)

BLACKFIRE69
08-02-2022, 11:24
Update available!



What's New:


Stable.
Faster.
Supports both generate and verify checksums.



ChecksumX
USAGE:
ChecksumX.exe [generate] [autoclose] [/x=<ExcludeFile>] <Checksum_File> <Algorithm_Index> <Base_Path>

OPTIONS:
generate - Generate a checksumfile.
autoclose - Automatically close when the process is done.
/x=<file> - Excluding file masks list for generate only.
_

Lord.Freddy
05-08-2022, 04:29
Hello. Your file is good, but if I use the VclStyle skin, when the dll file wants to show the error box, the installation file closes suddenly. can you remove the error box from dll :D?

BLACKFIRE69
05-08-2022, 06:32
Hello. Your file is good, but if I use the VclStyle skin, when the dll file wants to show the error box, the installation file closes suddenly. can you remove the error box from dll :D?

can you specify what the error message is?

Lord.Freddy
05-08-2022, 07:32
can you specify what the error message is?

https://cdn.discordapp.com/attachments/1002146885181653094/1005120262926249994/Rec_0001.mp4

See the error in this link:)

BLACKFIRE69
05-08-2022, 07:47
https://cdn.discordapp.com/attachments/1002146885181653094/1005120262926249994/Rec_0001.mp4

See the error in this link:)

sorry i didn't see any error with VclStyle. anyway i'll attach the non-messagebox version of XHash.
if this doesn't work either, send me your sample script so i can take a look.

.

Lord.Freddy
05-08-2022, 11:10
sorry i didn't see any error with VclStyle. anyway i'll attach the non-messagebox version of XHash.
if this doesn't work either, send me your sample script so i can take a look.

.

here is my script, please fix the problem(Setup Crash when i chose Cancel button). thank:)

Cesar82
05-08-2022, 21:20
here is my script, please fix the problem(Setup Crash when i chose Cancel button). thank:)

From what I could understand you can't use MesageBox inside the Callback.
Try with the script attached.

BLACKFIRE69
09-08-2022, 06:20
XHash_Next v1.0

-- Added more algorithms.
-- Added log file for verification.
-- Added support for multiple algorithms in one hash file (ex: hash_mixed.md5) for verification. (Only for MD5, SHA1, SHA256, SHA512)


hash_mixed.md5

; Generator: XHashNext DLL v1.0
; Algorithm: MD5 (128 bits)
; No. Files: 14

; MD5
AC3856A351B3C13556B2386CD13BB6CA cover.jpg
12F6B355C84327092D1115E5B1DB97D1 GameInfo.txt
ABD14375A3126F9296DCD88132E9652F OverviewInfo.txt
18FAD69BBCE73113C4A6FB211E6A844F PicForm.png

; SHA1
F81A451604B9C3606925A2AB3F406CC5C56C729E PicForm0.png
4B65BA757C862625850D480D574200CEFCDFF162 Reqirements.txt
544A11C86AD0BCBF0ED01019E8250F64A30594EE Ubuntu.ttf

; SHA256
26D21E5C309FAB938F378A83825284E231B056F0A1894078CF 4750F015A7DFC3 wallpapers1.jpg
AE9EE7E81B55B54745B1B5A60F715A52DEDCE1527F154871F3 BBDFEAEC9D52EB wallpapers2.jpg
22022B461C6AF2EBFC3EF817EA941EE5BF7A53B163BFCD26F0 CB2C66DC7EC7B0 wallpapers3.jpg
B9232B0D21C4EE1ADAB083C04505322C6F22A6C7008E3E8118 5ABBC06F6590F5 wallpapers4.jpg

; SHA512
40268B8DF3C4369930AC928B2793F29DF8007D237D3323A7E4 F1EF7BBE1CD270035B2E8C01C4DE0E08492914CB6E2FB2146B BB878143172153D480B3FC80B1AD wallpapers5.jpg
9A06694CB047301BC9DA1120139A70EFA9BCF7439C23705B59 0844B4D812504462CD023459BB5914BCD4542F512A5FDE0FF6 17568C016E149451D60FDE19CFF1 Wallpaper_color.jpg
A640305651EFE50B6F62BC0BBF9E53F8E23936B971E1C05289 C0B38FF576C86DB3A305F6E02E42CA6E1C493664BE10C930BA A15433EBF3956A3C9D49670635A6 Wallpaper_color2.jpg



Algorithm:

CRC32
MD5
SHA1
SHA256
SHA512
SHA512_256
SHA3_256
SHA3_512
BLAKE2_128
BLAKE2_256
BLAKE3_256
HAVAL3_128
HAVAL3_256
RIPEMD_128
RIPEMD_256
TIGER_128
TIGER_192
TIGER2_128
TIGER2_192
MURMURHASH_32
XXHASH_32


Functions:

{ Directory }
function CalculateHashesForDir(ChecksumFile, BasePath: WideString; HashAlgo: Integer; Callback: TMultiHashCallback): Integer;
function VerifyHashesFromFile(ChecksumFile, BasePath: WideString; HashAlgo: Integer; LogFile: Boolean; Callback: TMultiHashCallback): Integer;
function VerifyHashesAutoFromFile(ChecksumFile, BasePath: WideString; LogFile: Boolean; Callback: TMultiHashCallback): Integer;

{ Single file }
function CalculateFileHash(const FileName: WideString; const HashAlgo: Integer; Callback: TSingleFileHashCallback): WideString;
function VerifyFileHash(FileName, HashHexStr: WideString; HashAlgo: Integer; LogFile: Boolean; Callback: TSingleFileHashCallback): Integer;

{ Other }
function SetHashLogMessage(const MessageText: WideString; const MsgID: Integer): Boolean;
procedure SetHashLogFile(const FileName: WideString);
procedure StopHashProcess;
procedure PauseHashProcess;
procedure ResumeHashProcess;



thanks to @Cesar82 for the suggestions for the XHash_Next and testing it.

.

BLACKFIRE69
09-08-2022, 13:00
XHash_Next - Update

Also added CRC32 support for the "VerifyHashesAutoFromFile".

(currently "VerifyHashesAutoFromFile" supports crc32, md5, sha1, sha256 and sha512)

.

Grumpy
10-08-2022, 09:30
Thanks for all these BLACKFIRE69, nice work, keep it up :)

BLACKFIRE69
17-08-2022, 05:20
XHashNext - Update

-- Some improvements.
-- Fixed a minor bug in reading the checksum file.
-- Fixed percentage issues.
-- Fixed an issue where the process would still run after calling stop when "callback" was "nil".


https://i.ibb.co/SfKdTzM/003510.png

Thanks to @Cesar82

check the first post.

BLACKFIRE69
30-11-2022, 05:42
XHashNext + ChecksumXNext - Updates:

What's new

* Added some new error codes.
* Updated file search.
* Some improvements.


latest version added to first post.


,

BLACKFIRE69
22-12-2022, 08:54
Update available!

What's new:

- Minor improvements.

Carldric Clement
14-01-2023, 08:08
Nothing happen to see the Memo and also the Label which is quite on progressing hash generated on Delphi FMX. But the result works fine. :)

Generate with the directory
function GenerateHashMultiCallback(FileName: WideString; FileSize: extended;
FileProgress, TotalProgress, TotalFiles, FileCounted,
StatusCode: Integer): Boolean;
begin
Form5.Label9.Text := Format(XH_FILENAME, [ExtractFileName(FileName)]);
Form5.Label10.Text := Format(XH_FILEPOSITION, [ByteOrTb((FileSize * FileProgress) / 100), ByteOrTb(FileSize)]);
Form5.Label11.Text := Format(XH_PERCENTAGE, [FileProgress]);

Form5.Label12.Text := Format(XH_PERCENTAGE, [TotalProgress]);
Form5.ProgressBar1.Value := TotalProgress;

case StatusCode of
H_FILE_HASHING_DONE:
Form5.Memo1.Lines.Add(FileName + ' ... Done!');

-1,-4,-5,-6,-7,-8,-9,-10,-12,-13:
Form5.Memo1.Lines.Add('>>> Error code: ' + IntToStr(StatusCode));
end;

Form5.Label14.Text := Format(XH_GENERATESTATUS, [FileCounted, TotalFiles]);

ProcessMessages;
Result := CancelAll;
end;

BLACKFIRE69
14-01-2023, 11:08
Nothing happen to see the Memo and also the Label which is quite on progressing hash generated on Delphi FMX. But the result works fine. :)

Generate with the directory
...



XHashNext lib for Inno does not work on Delphi. ;)

try this one.

PS: i haven't implemented error levels(StatusCode) in the callback functions for this example. you can add them to your project later.


.

BLACKFIRE69
14-01-2023, 23:53
XHashNext lib for Inno does not work on Delphi. ;)

try this one.

@Carldric Clement

sorry, i forgot to mention that you can also use the Inno library for Delphi if the callback functions are method pointers.

this is the example...

.

BLACKFIRE69
15-01-2023, 02:55
Update available!


Reason: Link (https://www.fileforums.com/showpost.php?p=499792&postcount=179)


check the first post...

Carldric Clement
27-01-2023, 08:37
@Carldric Clement

sorry, i forgot to mention that you can also use the Inno library for Delphi if the callback functions are method pointers.

this is the example...

.

can you update your DLL file? my AV detect was a virus. :)
and second, though I've tried many times to make it works with Unit 2. But unfortunately, some labels and progress bar doesn't work on unit 2 using Inno Library which case Form 2 or something that are callback functions. So I'll be hanging these DLLs cause works with a few Forms that I've made before.

Karekas
30-03-2023, 13:32
XHash Update 1.1v



Added more Algos.

- md5
- sha1
- sha256
- sha512


Fixed some bugs.


_


Hello, this addon is very nice.

I'm a little newbie, and I wanted to know if you could provide the code to display this screen, like the one attached to this post, so I can add it to my installer.

thank you and a big hug from this Brazilian.

BLACKFIRE69
29-07-2023, 08:38
Update available!


* Updated file search. (Thanks to Cesar82)
* Minor improvements.


Check out the first post.


,

Lord.Freddy
31-07-2023, 11:32
Hi @BLACKFIRE69, can you update the xxhash algorithm to the last version :D ?
xxHash v0.8.2
(https://github.com/Cyan4973/xxHash/releases)