Function at 0x40a997
Capabilities:
Write file on windows

Disassembly:
push 0x94
mov eax, 0x41f561
call fcn.0040e3fe
mov ebx, edx
xor edi, edi
mov esi, ecx
cmp ebx, edi
je 0x40abda
cmp dword [esi + 0x678], edi
je 0x40abda
push 0x2d
lea eax, [ebp - 0x94]
push edi
push eax
call fcn.00411bc0
mov eax, dword [esi + 0x670]
mov dword [ebp - 0x70], eax
mov eax, dword [esi + 0x674]
mov dword [ebp - 0x74], eax
mov eax, dword [esi + 0x68c]
mov dword [ebp - 0x6c], eax
mov al, byte [esi + 0x678]
mov byte [ebp - 0x68], al
lea eax, [ebp - 0x84]
push eax
lea eax, [esi + 0x62c]
push eax
call fcn.004097ea
add esp, 0x14
add esi, 0x21c
push esi
lea esi, [ebp - 0x48]
call fcn.00401183
push str..dt_
mov eax, esi
push eax
mov dword [ebp - 4], edi
call fcn.004026b1
cmp dword [ebp - 0x34], 8
mov ecx, dword [ebp - 0x48]
jae 0x40aa33
mov ecx, esi
lea eax, [ebp - 0x2c]
push eax
call fcn.0040209e
pop ecx
mov byte [ebp - 4], 1
cmp dword [ebp - 0x1c], edi
jne 0x40aa68
push str.Get_dtFile_Md5_Failed.
push str.kupdate::KHttpDownload::SaveStateToCfg
push 0x2f2
push edi
mov ecx, str.webhttpdownload.cpp
call fcn.00402697
add esp, 0x10
jmp 0x40abc4
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x40aa74
lea eax, [ebp - 0x2c]
lea ecx, [ebp - 0x94]
push ecx
push eax
call fcn.004097ea
pop ecx
pop ecx
push ebx
lea esi, [ebp - 0x64]
call fcn.00401183
cmp dword [ebp - 0x50], 8
mov eax, dword [ebp - 0x64]
jae 0x40aa97
mov eax, esi
push edi
push 0x80
push 2
push edi
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
lea eax, [ebp - 0x9c]
mov dword [ebp - 0x9c], ebx
call fcn.00403334
test al, al
je 0x40aaee
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jle 0x40aad9
and eax, 0xffff
or eax, 0x80070000
push eax
push str.Failed_CreateFile
push str.kupdate::KHttpDownload::SaveStateToCfg
push 0x2fc
jmp 0x40ab9a
push 0x2d
lea eax, [ebp - 0x94]
push eax
push edi
call fcn.00401698
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0xc
push edi
mov dword [ebp - 0xa0], eax
lea eax, [ebp - 0x98]
push eax
push 0x2d
lea eax, [ebp - 0x94]
push eax
push ebx
mov dword [ebp - 0x98], edi
call esi
test eax, eax
je 0x40ab76
push edi
lea eax, [ebp - 0x98]
push eax
push 4
lea eax, [ebp - 0xa0]
push eax
push ebx
call esi
test eax, eax
je 0x40ab76
cmp ebx, edi
je 0x40ab52
cmp ebx, 0xffffffff
je 0x40ab52
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
inc ebx
push ebx
xor edi, edi
lea esi, [ebp - 0x64]
call fcn.004013ee
push ebx
lea esi, [ebp - 0x2c]
call fcn.004013ee
push ebx
lea esi, [ebp - 0x48]
call fcn.004013ee
mov eax, ebx
jmp 0x40abdc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jle 0x40ab8a
and eax, 0xffff
or eax, 0x80070000
push eax
push str.Failed_WriteFile:_0x_08x.
push str.kupdate::KHttpDownload::SaveStateToCfg
push 0x307
push edi
mov ecx, str.webhttpdownload.cpp
call fcn.00402697
add esp, 0x14
cmp ebx, edi
je 0x40abb8
cmp ebx, 0xffffffff
je 0x40abb8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
xor edi, edi
lea esi, [ebp - 0x64]
call fcn.004013ee
push 1
xor edi, edi
lea esi, [ebp - 0x2c]
call fcn.004013ee
push 1
lea esi, [ebp - 0x48]
call fcn.004013ee
xor eax, eax
call fcn.0040e481
ret