Function at 0x407f00
Capabilities:
Check if file exists
Write file on windows

Disassembly:
sub esp, 0x230
mov eax, dword [0x5b0c20]
xor eax, esp
mov dword [esp + 0x22c], eax
push ebx
xor ebx, ebx
push edi
mov edi, dword [esp + 0x23c]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ebx
mov dword [esp + 0x18], ebx
cmp dword [edi + 0x37c], ebx
je 0x407f7b
cmp dword [edi + 0x388], ebx
je 0x407f7b
push edi
call fcn.00407e40
push eax
lea eax, [edi + 2]
push eax
lea ecx, [esp + 0x38]
push 0x5516e0
push ecx
call fcn.00525f70
add esp, 0x14
push ebx
push ebx
push 3
push ebx
push 7
push closesocket
lea edx, [esp + 0x44]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x407f97
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x22c]
xor ecx, esp
call fcn.00524d83
add esp, 0x230
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x407f7b
push ebp
push 1
push 0x20000
call fcn.00525178
mov ebp, eax
add esp, 8
mov dword [esp + 0x2c], ebp
cmp ebp, ebx
jne 0x407fd6
pop ebp
pop edi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x22c]
xor ecx, esp
call fcn.00524d83
add esp, 0x230
ret
push esi
cmp dword [edi + 0x370], ebx
jne 0x408055
cmp dword [edi + 0x36c], ebx
jne 0x408055
lea eax, [esp + 0x14]
push eax
lea ecx, [edi + 0x2c92]
push ecx
push edi
call fcn.0044ba10
add esp, 0xc
test eax, eax
je 0x408172
mov esi, dword [edi + 0x35c]
mov edx, dword [edi + 0x2c8e]
mov eax, dword [edi + 0x2c8a]
push 0
push esi
push edx
push eax
call fcn.005269a0
push 0
push ebp
mov ebx, 0x1000
push ebx
lea ecx, [esp + 0x34]
push ecx
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x24]
push esi
push edx
mov dword [esp + 0x40], eax
mov dword [esp + 0x28], ebx
call fcn.00413640
add esp, 0x18
test eax, eax
je 0x408172
jmp 0x408127
mov eax, dword [edi + 0x734]
mov ecx, dword [eax + 8]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], ebp
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], ebx
lea esi, [edi + 0x2b90]
movzx eax, word [esi]
mov edx, 0xffff
cmp ax, dx
je 0x408127
movzx eax, word [esi - 2]
mov ebx, dword [edi + 0x35c]
cdq
shld edx, eax, 0x10
shl eax, 0x10
mov ecx, eax
movzx eax, word [esi - 4]
mov ebp, edx
cdq
or ecx, eax
movzx eax, word [esi - 6]
or ebp, edx
shld ebp, ecx, 0x10
cdq
push 0
push ebx
shl ecx, 0x10
or ebp, edx
or ecx, eax
push ebp
push ecx
call fcn.005269a0
mov dword [esp + 0x28], eax
movzx eax, word [esi]
imul eax, ebx
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x2c], edx
lea edx, [ebx + eax]
mov dword [esp + 0x10], eax
cmp edx, 0x20000
jae 0x408127
mov ecx, dword [esp + 0x18]
push 0
push ecx
mov ecx, dword [esp + 0x1c]
push eax
mov eax, dword [edi + 0x35c]
lea edx, [esp + 0x34]
push edx
push eax
push ecx
call fcn.00413640
add esp, 0x18
test eax, eax
je 0x408172
mov eax, dword [esp + 0x10]
add dword [esp + 0x18], eax
add ebx, eax
mov eax, dword [esp + 0x1c]
inc eax
add esi, 8
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], eax
cmp eax, 0x10
jb 0x408074
push 0
push 0xa0000026
push 2
push 0
push 7
push 0xc0000000
lea edx, [esp + 0x4c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x408172
mov ecx, dword [esp + 0x30]
push 0
lea eax, [esp + 0x14]
push eax
push ebx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408172
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x20], 1
mov edx, dword [esp + 0x30]
push edx
call fcn.005251b8
mov ecx, dword [esp + 0x240]
mov eax, dword [esp + 0x24]
add esp, 4
pop esi
pop ebp
pop edi
pop ebx
xor ecx, esp
call fcn.00524d83
add esp, 0x230
ret