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

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
mov esi, dword [esp + 0x2c]
push edi
xor edi, edi
cmp esi, edi
jne 0x4f13fb
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret
push esi
call fcn.004f4990
add esp, 4
test eax, eax
jne 0x4f1410
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov eax, dword [esi]
mov dword [esp + 0x10], edi
cmp eax, 1
jne 0x4f15b6
mov ebx, dword [esi + 4]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push edi
push edi
push ebx
call ebp
mov esi, eax
cmp esi, 0xffffffff
jne 0x4f143f
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [esp + 0x14], 0
sub edi, esi
test edi, edi
mov dword [esp + 0x24], edi
jle 0x4f149b
push edi
call fcn.004fbd3c
add esp, 4
lea ecx, [esp + 0x20]
mov dword [esp + 0x14], eax
push 0
push ecx
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4f1493
mov edx, dword [esp + 0x14]
push edx
call fcn.004fb722
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
push 0
push 0
push esi
push ebx
call ebp
mov ecx, dword [esp + 0x2c]
mov eax, 1
cmp ecx, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], eax
jle 0x4f1555
lea ebp, [esp + 0x3c]
mov eax, dword [ebp + 8]
mov dword [esp + 0x18], 0
cmp eax, reloc.WS2_32.dll_connect
jne 0x4f14cf
mov esi, dword [ebp]
jmp 0x4f14e6
push ebp
call fcn.004f47f0
mov esi, eax
add esp, 4
test esi, esi
je 0x4f152a
mov dword [esp + 0x18], 1
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
jle 0x4f150d
push eax
lea eax, [esp + 0x24]
push eax
push ecx
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4f150d
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4f151e
push esi
call fcn.004fbd4a
add esp, 4
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4f1595
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
inc eax
add ebp, 0xc
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x4f14b8
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4f1595
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, 1
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x4f16bf
push eax
push 0
push 0
push ebx
call ebp
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x20]
push 0
push ecx
push edi
push edx
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4f158d
push 0
push 0
push esi
push ebx
call ebp
jmp 0x4f1595
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4f16bf
push eax
call fcn.004fb722
mov eax, dword [esp + 0x14]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
cmp eax, 2
jne 0x4f16bf
mov ebx, dword [esi + 4]
mov ecx, ebx
mov eax, dword [ebx]
call dword [eax + 0x14]
mov edx, dword [ebx]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x24]
push eax
push ecx
push 0xffffffffffffffff
push edi
mov ecx, ebx
call dword [edx + 0x30]
mov ebp, eax
mov dword [esp + 0x1c], edi
cmp ebp, edi
mov dword [esp + 0x18], ebp
jle 0x4f160e
push ebp
call fcn.004fbd3c
mov esi, dword [esp + 0x28]
mov ecx, ebp
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
add esp, 4
and ecx, 3
mov dword [esp + 0x1c], eax
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x10], 1
cmp eax, 1
jle 0x4f1692
dec eax
lea ebp, [esp + 0x3c]
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x2c], 0
cmp eax, reloc.WS2_32.dll_connect
jne 0x4f163f
mov esi, dword [ebp]
jmp 0x4f1656
push ebp
call fcn.004f47f0
mov esi, eax
add esp, 4
test esi, esi
je 0x4f1680
mov dword [esp + 0x2c], 1
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
jle 0x4f166f
mov eax, dword [ebx]
push ecx
push esi
mov ecx, ebx
call dword [eax + 0x24]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x4f1680
push esi
call fcn.004fbd4a
add esp, 4
mov eax, dword [esp + 0x20]
add ebp, 0xc
dec eax
mov dword [esp + 0x20], eax
jne 0x4f1628
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
test edi, edi
je 0x4f16bf
mov edx, dword [ebx]
mov ecx, ebx
call dword [edx + 0x14]
mov esi, eax
mov eax, dword [ebx]
push ebp
push edi
mov ecx, ebx
call dword [eax + 0x24]
push edi
call fcn.004fb722
mov edx, dword [ebx]
add esp, 4
mov ecx, ebx
push 0
push esi
call dword [edx + 0x18]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret