/*
//////////////////////////////////////////////////
Назначение скрипта : Позволяет получить все хеши в оригинальном файле
Author : Djeck
OS : OllyDbg 1.10, Plugin Phantom, WinXP-Win7
Date : 12.11.2013
/////////////////////////////////////////////////
*/

var ORIGINAL_HASH_FILENAME
var CRC_ADDRESS
var CRC
var ADDRESS
var INFO

var MEMORY_SIZE

// check ODBGScript Version
cmp $VERSION, "1.82"
je START_SCRIPT
ja START_SCRIPT
msg "Update your ODBG-Script plugin!!! Minimum version 1.82"
ret

//****************************************************************************//
START_SCRIPT:
mov ORIGINAL_HASH_FILENAME, "Original_CRC.txt" // set filename for original hash
// clear all breakpoints
bc
bphwc
bpmc
bphws esp-4, "r"

ask "Enter address where hash write"
cmp $RESULT, 0
je FINISH
mov CRC_ADDRESS, $RESULT
bphws CRC_ADDRESS, "x"

GO_EIP:
run
cmp eip, CRC_ADDRESS
jne GO_EIP


wrt ORIGINAL_HASH_FILENAME, "This file contents HASH Fuck VMProtect"
wrta ORIGINAL_HASH_FILENAME, "-----------------------------------------"


WRITE_HASH:
cmp eip, CRC_ADDRESS
jne FINISH
mov CRC, eax
mov ADDRESS, edx
eval "CRC: {CRC}  Address: {ADDRESS}"
mov INFO, $RESULT
wrta ORIGINAL_HASH_FILENAME, INFO
cmp eip, CRC_ADDRESS
jne FINISH
run
jmp WRITE_HASH

FINISH:
bc
bphwc
bpmc
MSG "Script finished"
ret