Function at 0x403e40
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x67f1d6
mov eax, dword fs:[0]
push eax
sub esp, 0xa28
mov eax, dword [0x6fd284]
xor eax, esp
mov dword [esp + 0xa24], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6fd284]
xor eax, esp
push eax
lea eax, [esp + 0xa3c]
mov dword fs:[0], eax
mov eax, dword [esp + 0xa4c]
mov edx, dword [esp + 0xa54]
xor edi, edi
push edi
push edi
push 2
push edi
push 1
mov ebp, ecx
mov ecx, dword [esp + 0xa64]
push 0x40000000
push eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
sub ebx, 0xffffffff
neg ebx
sbb ebx, ebx
and ebx, eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0xa44], edi
je 0x4040a4
xor esi, esi
mov dword [esp + 0x28], esi
xor eax, eax
cmp dword [ebp], eax
mov byte [esp + 0xa44], 1
mov dword [esp + 0x20], 0xffffffff
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], eax
jle 0x40405c
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 4]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
cmp dword [eax + ecx + 8], edx
lea eax, [eax + ecx + 8]
je 0x403f6e
mov eax, dword [eax]
push eax
mov dword [esp + 0x24], eax
mov eax, dword [0x6fd200]
add eax, 0x61
push eax
lea ecx, [esp + 0x40]
push 0x680368
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0
push 0
push 3
push 0
push 1
push closesocket
lea edx, [esp + 0x50]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
test esi, esi
mov edi, eax
je 0x403f57
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, edi
sub esi, 0xffffffff
neg esi
sbb esi, esi
and esi, edi
mov dword [esp + 0x28], esi
je 0x40409d
xor edi, edi
mov eax, dword [ebp + 4]
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + eax]
cmp edi, eax
je 0x403f98
mov edi, eax
push 0
push 0
mov edx, edi
shl edx, 0xb
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x404092
mov eax, dword [ebp + 4]
mov ecx, dword [esp + 0x14]
cmp edi, dword [eax + ecx + 4]
jae 0x404038
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x403fd1
mov ecx, dword [esp + 0x18]
test cl, 0xf
jne 0x403fd1
mov edx, dword [esp + 0x30]
push edx
mov edx, dword [ebp + 0x10]
push edx
push ecx
call eax
add esp, 0xc
test al, al
je 0x4040a9
push 0
lea eax, [esp + 0x20]
push eax
push 0x800
lea ecx, [esp + 0x244]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x1c], 0x800
jne 0x404092
push 0
lea edx, [esp + 0x20]
push edx
push 0x800
lea eax, [esp + 0x244]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x1c], 0x800
jne 0x404092
mov ecx, dword [ebp + 4]
mov edx, dword [esp + 0x14]
add dword [esp + 0x18], 1
add edi, 1
cmp edi, dword [ecx + edx + 4]
jb 0x403fa9
mov eax, dword [esp + 0x24]
add dword [esp + 0x14], 0x10
add eax, 1
cmp eax, dword [ebp]
mov dword [esp + 0x24], eax
jl 0x403ef8
test esi, esi
je 0x40405c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
mov ecx, dword [esp + 0xa3c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xa24]
xor ecx, esp
call fcn.00404e9c
add esp, 0xa34
ret 0xc
test esi, esi
je 0x40409d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x404068
test esi, esi
je 0x4040b4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x404068