Function at 0x473030
Capabilities:
Delete file
Read file on windows

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x3b4
push ebx
xor ebx, ebx
push ebp
push esi
cmp eax, ebx
push edi
mov esi, ecx
je 0x47304d
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x7f4]
mov dword [esi + 0x848], ebx
mov dword [esi + 0x840], ebx
cmp eax, ebx
mov dword [esi + 0x814], ebx
mov dword [esi + 0x84c], ebx
mov dword [esi + 0x844], ebx
mov dword [esi + 0x850], ebx
je 0x47308a
push eax
call fcn.004c2eb0
add esp, 4
mov dword [esi + 0x7f4], ebx
mov eax, dword [esi + 0x7ec]
lea edi, [esi + 0x58]
push eax
lea ecx, [esi + 0x18]
push edi
push ecx
push 0x5965b8
push str._shistory_s_s_d.hst
lea edx, [esp + 0x1d8]
push 0x1ff
push edx
mov dword [esi + 0x7fc], ebx
mov dword [esi + 0x7f8], ebx
mov dword [esp + 0x2c], edi
call dword [sym.imp.MSVCRT.dll__snprintf]
lea eax, [esp + 0x1e0]
push 0x581660
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 0x24
cmp ebp, ebx
je 0x47332d
push ebp
push 1
lea ecx, [esp + 0x1c]
push 0x94
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
jne 0x4733a1
cmp dword [esp + 0x14], 0x190
jne 0x4733a1
mov byte [esp + 0x63], bl
lea eax, [esp + 0x58]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [edi]
jne 0x47313f
cmp cl, bl
je 0x47313b
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [edi + 1]
jne 0x47313f
add eax, 2
add edi, 2
cmp cl, bl
jne 0x47311b
xor eax, eax
jmp 0x473144
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x47334e
mov eax, dword [esp + 0x64]
mov ecx, dword [esi + 0x7ec]
cmp eax, ecx
jne 0x47334e
mov ecx, dword [esp + 0x6c]
mov dword [esi + 0x808], ecx
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.MSVCRT.dll__filelength]
mov ecx, eax
mov eax, 0xba2e8ba3
sub ecx, 0x94
add esp, 4
mul ecx
shr edx, 5
cmp edx, 1
mov dword [esi + 0x800], edx
jge 0x4731a1
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
jmp 0x47332d
mov edi, dword [esi + 0x854]
cmp edx, edi
jg 0x4731ad
mov edi, edx
sub edx, edi
push ebx
lea eax, [edx + edx*4]
lea ecx, [edx + eax*2]
lea edx, [ecx*4 + 0x94]
push edx
push ebp
call dword [sym.imp.MSVCRT.dll_fseek]
lea eax, [edi + edi*4 + 0x28a]
lea ecx, [edi + eax*2 + 0x82]
shl ecx, 2
push ecx
call fcn.004c2e90
add esp, 0x10
cmp eax, ebx
mov dword [esi + 0x7f4], eax
jne 0x47321b
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x3cc]
add esp, 4
cmp eax, ebx
je 0x473205
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esi + 0x7ec]
mov eax, dword [esp + 0x10]
push edx
push eax
push str.HistoryBase:_not_enough_memory_for__s_d
jmp 0x4733d6
lea ecx, [edi + 0x80]
lea edx, [edi + edi*4]
mov dword [esi + 0x7fc], ecx
push ebp
lea ecx, [edi + edx*2]
push 1
shl ecx, 2
push ecx
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
push ebp
je 0x473277
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x3cc]
add esp, 4
cmp eax, ebx
je 0x47325f
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esi + 0x7ec]
mov eax, dword [esp + 0x10]
push edx
push eax
push str.HistoryBase:_error_reading__s_d
push 1
jmp 0x4733d8
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x74]
add esp, 4
cmp eax, ebx
mov dword [esi + 0x7f8], edi
mov dword [esi + 0x858], ecx
jl 0x47329e
mov dword [esi + 0x7e8], eax
mov ecx, esi
call fcn.00473400
mov edx, dword [esi + 0x800]
mov ecx, esi
push edx
call fcn.00473680
mov ecx, dword [esi + 0x7f4]
mov edi, dword [esi + 0x804]
add edi, 0x64
mov eax, dword [ecx]
mov dword [esi + 0x804], edi
mov dword [esi + 0x85c], eax
mov eax, dword [esi + 0x7f8]
cmp eax, ebx
jle 0x4732ea
lea edx, [eax + eax*4]
lea eax, [eax + edx*2]
mov ecx, dword [ecx + eax*4 - 0x2c]
mov dword [esi + 0x850], ecx
mov eax, dword [esi + 0x80c]
mov edx, dword [esp + 0x70]
cmp eax, ebx
mov dword [esi + 0x858], edx
jge 0x47332d
lea eax, [esp + 0xa8]
mov ecx, 0x593d48
push eax
call fcn.0042f650
mov eax, dword [esi + 0x7f8]
mov ecx, dword [esp + 0xbc]
sub eax, ecx
mov dword [esi + 0x80c], eax
jns 0x47332d
mov dword [esi + 0x80c], ebx
cmp dword [esp + 0x3c8], ebx
je 0x4733e5
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3b4
ret 4
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x3cc]
add esp, 4
cmp eax, ebx
je 0x47336a
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esi + 0x7ec]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x64]
push ecx
push edx
lea ecx, [esp + 0x60]
push eax
push ecx
push str.HistoryBase:_database__s_d_instead__s_d
push 4
push 0x596558
call fcn.004aa400
add esp, 0x1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3b4
ret 4
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
lea edx, [esp + 0x1c4]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [esp + 0x3c8], ebx
je 0x4733c9
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x7ec]
push eax
push edi
push str.HistoryBase:_invalid_database_header_for__s_d
push 4
push 0x596558
call fcn.004aa400
add esp, 0x14
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3b4
ret 4