Function at 0x40e790
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41ff60
mov eax, dword fs:[0]
push eax
sub esp, 0x94
mov eax, dword [0x42807c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor edi, edi
mov esi, ecx
mov dword [ebp - 0x9c], eax
cmp eax, edi
je 0x40ea7a
cmp dword [esi + 0x678], edi
je 0x40ea7a
push 0x2d
lea eax, [ebp - 0x94]
push edi
push eax
call fcn.00412f10
mov edx, dword [esi + 0x674]
mov eax, dword [esi + 0x68c]
mov ecx, dword [esi + 0x670]
mov dword [ebp - 0x74], edx
lea edx, [ebp - 0x84]
mov dword [ebp - 0x6c], eax
mov dword [ebp - 0x70], ecx
mov cl, byte [esi + 0x678]
push edx
lea eax, [esi + 0x62c]
push eax
mov byte [ebp - 0x68], cl
call fcn.0040cd70
add esp, 0x14
xor ecx, ecx
lea eax, [esi + 0x21c]
mov word [ebp - 0x48], cx
mov ecx, eax
mov dword [ebp - 0x34], 7
mov dword [ebp - 0x38], edi
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, di
jne 0x40e843
sub ecx, esi
sar ecx, 1
push ecx
lea ecx, [ebp - 0x48]
call fcn.00401540
push 4
mov eax, str..dt_
lea ecx, [ebp - 0x48]
mov dword [ebp - 4], edi
call fcn.00402bd0
mov ecx, dword [ebp - 0x48]
mov esi, 8
cmp dword [ebp - 0x34], esi
jae 0x40e87d
lea ecx, [ebp - 0x48]
lea ebx, [ebp - 0x2c]
call fcn.00402350
mov byte [ebp - 4], 1
cmp dword [ebp - 0x1c], edi
jne 0x40e8e6
push str.Get_dtFile_Md5_Failed.
push str.kupdate::KHttpDownload::SaveStateToCfg
push str.webhttpdownload.cpp
push edi
mov edx, 0x301
call fcn.00402b80
add esp, 0x10
cmp dword [ebp - 0x18], esi
jb 0x40e8bc
mov edx, dword [ebp - 0x2c]
push edx
call fcn.0040ed52
add esp, 4
xor eax, eax
mov dword [ebp - 0x18], 7
mov dword [ebp - 0x1c], edi
mov word [ebp - 0x2c], ax
cmp dword [ebp - 0x34], esi
jb 0x40ea7a
mov ecx, dword [ebp - 0x48]
push ecx
call fcn.0040ed52
add esp, 4
jmp 0x40ea7a
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x18], esi
jae 0x40e8f1
lea eax, [ebp - 0x2c]
lea edx, [ebp - 0x94]
push edx
push eax
call fcn.0040cd70
mov ebx, dword [ebp - 0x9c]
add esp, 8
xor eax, eax
mov word [ebp - 0x64], ax
mov eax, ebx
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], edi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40e920
sub eax, edx
sar eax, 1
push eax
mov eax, ebx
lea ecx, [ebp - 0x64]
call fcn.00401540
mov eax, dword [ebp - 0x64]
cmp dword [ebp - 0x50], esi
jae 0x40e945
lea eax, [ebp - 0x64]
push edi
push 0x80
push 2
push edi
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, edi
je 0x40e967
cmp esi, 0xffffffff
jne 0x40e9af
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jle 0x40e97b
and eax, 0xffff
or eax, 0x80070000
push eax
push str.Failed_CreateFile
push str.kupdate::KHttpDownload::SaveStateToCfg
push str.webhttpdownload.cpp
push edi
mov edx, 0x30b
call fcn.00402b80
add esp, 0x14
cmp esi, edi
je 0x40ea62
cmp esi, 0xffffffff
je 0x40ea62
jmp 0x40ea5b
push 0x2d
lea ecx, [ebp - 0x94]
push ecx
push edi
call fcn.00401880
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0xc
push edi
lea edx, [ebp - 0x98]
push edx
mov dword [ebp - 0xa0], eax
push 0x2d
lea eax, [ebp - 0x94]
push eax
push esi
mov dword [ebp - 0x98], edi
call ebx
test eax, eax
je 0x40ea29
push edi
lea ecx, [ebp - 0x98]
push ecx
push 4
lea edx, [ebp - 0xa0]
push edx
push esi
call ebx
test eax, eax
je 0x40ea29
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esi, [ebp - 0x64]
call fcn.00401270
lea esi, [ebp - 0x2c]
call fcn.00401270
lea esi, [ebp - 0x48]
call fcn.00401270
mov eax, 1
jmp 0x40ea7c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jle 0x40ea3d
and eax, 0xffff
or eax, 0x80070000
push eax
push str.Failed_WriteFile:_0x_08x.
push str.kupdate::KHttpDownload::SaveStateToCfg
push str.webhttpdownload.cpp
push edi
mov edx, 0x316
call fcn.00402b80
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esi, [ebp - 0x64]
call fcn.00401270
lea esi, [ebp - 0x2c]
call fcn.00401270
lea esi, [ebp - 0x48]
call fcn.00401270
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040ed5d
mov esp, ebp
pop ebp
ret 4