Function at 0x4139b0
Capabilities:
Check if file exists
Get file attributes
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x66f9a8
push 0x5dfbd0
mov eax, dword fs:[0]
push eax
sub esp, 0x36c
mov eax, dword [0x6aae14]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov esi, dword [ebp + 8]
mov dword [ebp - 0x370], esi
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x358], ebx
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x364], eax
mov dword [ebp - 4], 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x413a28
mov dword [ebp - 4], 0xfffffffe
mov eax, 0x200
jmp 0x413f96
push 0
push 0
push 3
push 0
push 1
push connect
push esi
call fcn.004e0400
add esp, 0x1c
mov esi, eax
cmp esi, 0xffffffff
je 0x413a17
push 0
push esi
mov edi, dword [sym.imp.KERNEL32.dll_GetFileSize]
call edi
mov dword [ebp - 0x35c], eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x413acc
mov dword [ebp - 0x354], 0
push 1
push 0
push 0x2c
lea ecx, [ebp - 0x354]
push ecx
lea edx, [ebp - 0x224]
push edx
push ebx
call fcn.004e1380
add esp, 0x18
cmp dword [ebp - 0x354], 0xffffffff
je 0x413acc
push 0
push 0
push 3
push 0
push 1
push connect
lea eax, [ebp - 0x224]
push eax
call fcn.004e0400
add esp, 0x1c
mov esi, eax
cmp esi, 0xffffffff
je 0x413a6d
push 0
push esi
call edi
add dword [ebp - 0x35c], eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x413a6d
mov eax, dword [ebp - 0x35c]
lea ecx, [eax + eax]
mov dword [ebp - 0x35c], ecx
mov esi, dword [ebp - 0x364]
push esi
mov edx, dword [ebp - 0x370]
push edx
call fcn.004dfec0
add esp, 8
mov ebx, eax
mov dword [ebp - 0x364], ebx
test ebx, ebx
jne 0x413b0e
mov dword [ebp - 4], 0xfffffffe
mov eax, 0x800
jmp 0x413f96
push esi
mov eax, dword [ebp - 0x35c]
push eax
push 0
call fcn.004e7570
add esp, 0xc
mov dword [ebp - 0x354], eax
test eax, eax
jne 0x413b55
push ebx
call fcn.004d5750
add esp, 4
push ebx
test al, al
je 0x413f16
call fcn.004e0250
add esp, 4
mov dword [ebp - 4], 0xfffffffe
mov eax, 0x400
jmp 0x413f96
xor edi, edi
mov dword [ebp - 0x360], edi
mov dword [ebp - 0x378], edi
lea ecx, [ebp - 0x350]
push ecx
push 0xffffffffffffffff
push ebx
call fcn.004d5700
add esp, 0xc
mov esi, eax
mov edx, dword [ebp - 0x350]
mov dword [ebp - 0x374], edx
test esi, esi
je 0x413bc1
push ebx
call fcn.004d5750
add esp, 4
push ebx
test al, al
je 0x413b9c
call fcn.004e0250
jmp 0x413ba1
call fcn.004e76c0
add esp, 4
mov eax, dword [ebp - 0x354]
push eax
call fcn.004e76c0
add esp, 4
mov dword [ebp - 4], 0xfffffffe
mov eax, esi
jmp 0x413f96
xor eax, eax
mov dword [ebp - 0x368], eax
lea esp, [esp]
cmp eax, dword [ebp - 0x374]
jge 0x413da9
lea ecx, [ebp - 0x350]
push ecx
push eax
push ebx
call fcn.004d5700
add esp, 0xc
mov esi, eax
test esi, esi
je 0x413c23
push ebx
call fcn.004d5750
add esp, 4
push ebx
test al, al
je 0x413c12
call fcn.004e0250
add esp, 4
mov edx, dword [ebp - 0x354]
push edx
jmp 0x413bab
call fcn.004e76c0
add esp, 4
mov edx, dword [ebp - 0x354]
push edx
jmp 0x413bab
xor ebx, ebx
mov dword [ebp - 0x36c], ebx
push 1
push ebx
push 0x2c
lea eax, [ebp - 0x36c]
push eax
lea ecx, [ebp - 0x224]
push ecx
mov edx, dword [ebp - 0x358]
push edx
call fcn.004e1380
add esp, 0x18
cmp dword [ebp - 0x36c], 0xffffffff
je 0x413ca9
push 0x5c
lea eax, [ebp - 0x224]
push eax
call fcn.005e0a00
add esp, 8
test eax, eax
je 0x413c6e
inc eax
jmp 0x413c74
lea eax, [ebp - 0x224]
push eax
lea ecx, [ebp - 0x34c]
push ecx
call fcn.005f095a
add esp, 8
test eax, eax
je 0x413d92
push 1
push 0
push 0x2c
lea edx, [ebp - 0x36c]
push edx
lea eax, [ebp - 0x224]
push eax
mov ecx, dword [ebp - 0x358]
push ecx
jmp 0x413c45
test ebx, ebx
jne 0x413d92
test byte [ebp - 0x248], 0x10
je 0x413d0a
lea edx, [ebp - 0x34c]
push edx
mov ebx, dword [ebp - 0x354]
push ebx
call fcn.004e7620
add esp, 8
mov esi, eax
test esi, esi
je 0x413d92
mov edi, dword [ebp - 0x364]
push edi
call fcn.004d5750
add esp, 4
push edi
test al, al
je 0x413cfc
call fcn.004e0250
add esp, 4
push ebx
jmp 0x413bab
call fcn.004e76c0
add esp, 4
push ebx
jmp 0x413bab
cmp dword [ebp - 0x228], edi
jle 0x413d42
mov eax, dword [ebp - 0x360]
test eax, eax
je 0x413d25
push eax
call fcn.005e132a
add esp, 4
mov edi, dword [ebp - 0x228]
add edi, edi
mov dword [ebp - 0x378], edi
push edi
call fcn.005ddec6
add esp, 4
mov dword [ebp - 0x360], eax
push edi
mov eax, dword [ebp - 0x360]
push eax
mov ecx, dword [ebp - 0x368]
push ecx
mov ebx, dword [ebp - 0x364]
push ebx
call fcn.004e0200
add esp, 0x10
mov esi, eax
test esi, esi
jne 0x413bf3
push edi
mov eax, dword [ebp - 0x360]
push eax
lea ecx, [ebp - 0x34c]
push ecx
mov edx, dword [ebp - 0x354]
push edx
call fcn.004e75d0
add esp, 0x10
mov esi, eax
test esi, esi
jne 0x413b87
inc dword [ebp - 0x368]
mov ebx, dword [ebp - 0x364]
mov eax, dword [ebp - 0x368]
jmp 0x413bd0
mov ecx, dword [ebp - 0x360]
push ecx
call fcn.005e132a
add esp, 4
mov edi, dword [ebp - 0x358]
test edi, edi
je 0x413ea4
mov dword [ebp - 0x358], 0
push 1
push 0
push 0x2c
lea edx, [ebp - 0x358]
push edx
lea eax, [ebp - 0x224]
push eax
push edi
call fcn.004e1380
add esp, 0x18
lea ecx, [ecx]
cmp dword [ebp - 0x358], 0xffffffff
je 0x413e9c
push 0x5c
lea ecx, [ebp - 0x224]
push ecx
call fcn.005e0a00
add esp, 8
test eax, eax
je 0x413e15
inc eax
jmp 0x413e1b
lea eax, [ebp - 0x224]
lea edx, [ebp - 0x224]
push edx
push eax
mov eax, dword [ebp - 0x354]
push eax
call fcn.004e7590
add esp, 0xc
mov esi, eax
test esi, esi
je 0x413e6e
push ebx
call fcn.004d5750
add esp, 4
push ebx
test al, al
je 0x413e5a
call fcn.004e0250
add esp, 4
mov ecx, dword [ebp - 0x354]
push ecx
jmp 0x413bab
call fcn.004e76c0
add esp, 4
mov ecx, dword [ebp - 0x354]
push ecx
jmp 0x413bab
lea edx, [ebp - 0x224]
push edx
call fcn.004e0670
push 1
push 0
push 0x2c
lea eax, [ebp - 0x358]
push eax
lea ecx, [ebp - 0x224]
push ecx
push edi
call fcn.004e1380
add esp, 0x1c
jmp 0x413df0
test esi, esi
jne 0x413bf3
mov edi, dword [ebp - 0x354]
push ebx
call fcn.004d5750
add esp, 4
push ebx
test al, al
je 0x413ebf
call fcn.004e0250
jmp 0x413ec4
call fcn.004e76c0
mov esi, eax
add esp, 4
test esi, esi
je 0x413ed3
push edi
jmp 0x413bab
lea eax, [ebp - 0x35c]
push eax
lea ecx, [ebp - 0x360]
push ecx
push edi
call fcn.004e7660
add esp, 0xc
mov esi, eax
test esi, esi
jne 0x413ecd
push eax
push 0x80
push 2
push eax
push eax
push 0x40000000
mov edx, dword [ebp - 0x370]
push edx
call fcn.004e0400
add esp, 0x1c
mov esi, eax
cmp esi, 0xffffffff
jne 0x413f2c
push edi
call fcn.004e76c0
add esp, 4
mov dword [ebp - 4], 0xfffffffe
mov eax, 0x400
jmp 0x413f96
push 0
lea eax, [ebp - 0x37c]
push eax
mov ecx, dword [ebp - 0x35c]
push ecx
mov edx, dword [ebp - 0x360]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004e76c0
add esp, 4
test eax, eax
je 0x413f67
mov dword [ebp - 4], 0xfffffffe
jmp 0x413f96
mov dword [ebp - 4], 0xfffffffe
xor eax, eax
jmp 0x413f96
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.005dfbbe
mov esp, ebp
pop ebp
ret