Function at 0x401970
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x474
push ebx
push esi
push edi
xor esi, esi
mov edi, pe_nt_image_headers32
push esi
mov ebx, dword [sym.imp.KERNEL32.DLL_CreateFileA]
push edi
push 3
push esi
push 3
push connect
push dword [ebp + 8]
call ebx
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x401ba3
cmp eax, esi
je 0x401ba3
push esi
push edi
push 2
push esi
push 3
push 0x40000000
push dword [ebp + 0xc]
call ebx
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp + 0xc], edi
je 0x401b9e
cmp edi, esi
je 0x401b9e
push 0x1e
lea eax, [ebp - 0x40]
push esi
push eax
call fcn.004038d0
push 0x2e
lea eax, [ebp - 0x70]
push esi
push eax
call fcn.004038d0
push 0x16
lea eax, [ebp - 0x20]
push esi
push eax
call fcn.004038d0
lea eax, [ebp - 0x34]
mov dword [ebp - 0x40], 0x4034b50
push eax
lea eax, [ebp - 0x36]
push eax
mov word [ebp - 0x3c], 0xa
mov word [ebp - 0x6a], 0xa
mov word [ebp - 0x3a], si
mov word [ebp - 0x68], si
mov word [ebp - 0x38], si
mov word [ebp - 0x66], si
call fcn.00401bab
mov ax, word [ebp - 0x36]
push dword [ebp - 4]
mov word [ebp - 0x64], ax
mov ax, word [ebp - 0x34]
mov word [ebp - 0x62], ax
call fcn.00401c30
mov ebx, dword [sym.imp.KERNEL32.DLL_GetFileSize]
add esp, 0x30
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x60], eax
push esi
push dword [ebp - 4]
call ebx
push esi
mov dword [ebp - 0x2e], eax
push dword [ebp - 4]
mov dword [ebp - 0x5c], eax
call ebx
push dword [ebp + 0x10]
mov ebx, dword [sym.imp.KERNEL32.DLL_lstrlenA]
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x58], eax
call ebx
mov word [ebp - 0x26], ax
mov word [ebp - 0x54], ax
lea eax, [ebp + 8]
push esi
push eax
lea eax, [ebp - 0x40]
push 0x1e
push eax
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_WriteFile]
mov word [ebp - 0x24], si
mov word [ebp - 0x52], si
mov dword [ebp - 0x46], esi
call edi
lea eax, [ebp + 8]
push esi
push eax
push dword [ebp + 0x10]
call ebx
push eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call edi
push dword [ebp + 0x10]
call ebx
push esi
push esi
add eax, 0x1e
push esi
push dword [ebp - 4]
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
lea eax, [ebp + 8]
push esi
push eax
lea eax, [ebp - 0x474]
push 0x400
push eax
push dword [ebp - 4]
mov dword [ebp + 8], esi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x401b06
cmp dword [ebp + 8], esi
je 0x401b06
lea eax, [ebp - 0x74]
push esi
push eax
lea eax, [ebp - 0x474]
push dword [ebp + 8]
push eax
push dword [ebp + 0xc]
call edi
mov eax, dword [ebp + 8]
add dword [ebp - 8], eax
jmp 0x401ac4
mov eax, dword [ebp - 8]
push esi
mov dword [ebp - 0x10], eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x70]
push 0x2e
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x70], 0x2014b50
mov word [ebp - 0x6c], 0x14
mov word [ebp - 0x4c], si
mov dword [ebp - 0x4a], 0x20
call edi
lea eax, [ebp + 8]
push esi
push eax
push dword [ebp + 0x10]
call ebx
push eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call edi
push dword [ebp + 0x10]
call ebx
mov ecx, dword [ebp - 8]
push esi
mov dword [ebp - 0x20], 0x6054b50
mov word [ebp - 0x1c], si
lea eax, [ecx + eax + 0x2e]
mov word [ebp - 0x1a], si
sub eax, dword [ebp - 0x10]
mov word [ebp - 0x18], 1
mov word [ebp - 0x16], 1
mov word [ebp - 0xc], si
mov dword [ebp - 0x14], eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x20]
push 0x16
push eax
push dword [ebp + 0xc]
call edi
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, esi
jmp 0x401ba6
push 2
pop esi
jmp 0x401b91
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret