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

Disassembly:
push ebp
mov ebp, esp
push eax
mov eax, 0x20
add esp, 0xfffff004
push eax
dec eax
jne 0x4c087d
add esp, 0xffffff54
mov eax, dword [ebp - 4]
mov eax, 0x4e8094
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
call fcn.0049c448
mov word [ebp - 0x18], 8
lea edx, [ebp - 4]
push edx
call fcn.0049a704
pop ecx
inc dword [ebp - 0xc]
mov word [ebp - 0x18], 0x14
mov dword [ebp - 0x54], 0xffffffff
mov byte [ebp - 0x9d], 0
mov byte [ebp - 0x9e], 0
cmp dword [ebp + 0x14], 0
je 0x4c0e10
mov ecx, dword [ebp + 0x10]
push ecx
push esi
call fcn.004bf9fc
add esp, 8
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x4c0e10
mov edx, dword [ebp + 0x14]
push edx
mov ecx, dword [esi]
push ecx
call fcn.00413cd0
add esp, 8
test al, al
jne 0x4c0912
mov eax, dword [ebp + 0x14]
push eax
mov edx, dword [esi]
push edx
call fcn.00413d94
add esp, 8
mov dword [ebp - 0x4c], 2
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.0049c15c
pop ecx
mov dword [ebp - 0x48], eax
push 0
push 0x80
push 3
push 0
push 3
push closesocket
mov eax, dword [ebp + 0x10]
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x4c0e02
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x9c], 0
mov dword [ebp - 0x98], 0
mov edx, dword [ebp - 0x2c]
push edx
call fcn.00414b4c
pop ecx
mov dword [ebp - 0x54], eax
xor ecx, ecx
mov dword [ebp - 0x50], ecx
mov eax, dword [ebp - 0x50]
cmp eax, dword [ebp - 0x54]
jge 0x4c09f8
lea edx, [ebp - 0x44]
lea ecx, [ebp - 0x40]
push edx
push ecx
mov eax, dword [ebp - 0x50]
push eax
mov edx, dword [ebp - 0x2c]
push edx
call fcn.00414a0c
add esp, 0x10
lea ecx, [ebp - 0x44]
lea eax, [ebp - 0x40]
lea edx, [ebp - 0x78]
push ecx
push eax
push edx
lea ecx, [ebp - 0x70]
push ecx
push esi
call fcn.004bf964
add esp, 0x14
test al, al
je 0x4c09e3
mov eax, dword [ebp - 0x9c]
mov edx, dword [ebp - 0x98]
add eax, dword [ebp - 0x78]
adc edx, dword [ebp - 0x74]
mov dword [ebp - 0x9c], eax
mov dword [ebp - 0x98], edx
mov eax, dword [ebp - 0x40]
push eax
call fcn.0049b6d4
pop ecx
inc dword [ebp - 0x50]
mov edx, dword [ebp - 0x50]
cmp edx, dword [ebp - 0x54]
jl 0x4c0990
xor ecx, ecx
mov dword [ebp - 0x50], ecx
jmp 0x4c0de4
lea eax, [ebp - 0x44]
lea edx, [ebp - 0x40]
push eax
push edx
mov ecx, dword [ebp - 0x50]
push ecx
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00414a0c
add esp, 0x10
lea edx, [ebp - 0x44]
lea ecx, [ebp - 0x40]
lea eax, [ebp - 0x78]
push edx
push ecx
push eax
lea edx, [ebp - 0x70]
push edx
push esi
call fcn.004bf964
add esp, 0x14
test al, al
je 0x4c0dd7
mov ecx, dword [ebp - 0x44]
push ecx
mov eax, dword [ebp - 0x40]
push eax
mov edx, dword [esi + 4]
push edx
call fcn.0049285c
add esp, 0xc
mov dword [ebp - 0x58], eax
lea ecx, [ebp - 0x38]
lea eax, [ebp - 0x3c]
push 0
push 0
push ecx
push 0
push 0
push eax
mov edx, dword [ebp - 0x58]
push edx
mov ecx, dword [esi + 4]
push ecx
call fcn.00492b74
add esp, 0x20
test al, al
je 0x4c0dd7
mov eax, dword [ebp - 0x38]
add eax, 0x2c
push eax
call fcn.0049c15c
pop ecx
mov ebx, eax
cmp dword [ebp - 0x3c], 0
je 0x4c0b1d
mov eax, dword [ebp - 0x3c]
push eax
call fcn.0049c15c
mov edi, eax
mov eax, dword [ebp - 0x48]
add eax, edi
pop ecx
add ebx, eax
add ebx, 3
push ebx
call fcn.0049b898
mov edx, dword [ebp + 0x14]
pop ecx
mov ebx, eax
push esi
push edi
xor eax, eax
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, ebx
xchg edi, esi
mov edx, ecx
mov eax, edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
push 0x4e7f10
push ebx
call fcn.0049c120
add esp, 8
mov eax, dword [ebp - 0x3c]
push eax
push ebx
call fcn.0049c120
add esp, 8
push 0x4e7f12
push ebx
call fcn.0049c120
add esp, 8
mov edx, dword [ebp - 0x38]
add edx, 0x2c
push edx
push ebx
call fcn.0049c120
add esp, 8
mov ecx, dword [ebp - 0x48]
add ecx, ebx
add edi, ecx
inc edi
jmp 0x4c0b75
add ebx, dword [ebp - 0x48]
add ebx, 2
push ebx
call fcn.0049b898
mov ebx, eax
mov eax, dword [ebp + 0x14]
mov edi, eax
xor eax, eax
pop ecx
push esi
or ecx, 0xffffffff
mov esi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
xchg edi, esi
shr ecx, 2
mov eax, edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop esi
push 0x4e7f14
push ebx
call fcn.0049c120
add esp, 8
mov eax, dword [ebp - 0x38]
add eax, 0x2c
push eax
push ebx
call fcn.0049c120
add esp, 8
mov edi, dword [ebp - 0x48]
add edi, ebx
mov eax, dword [ebp - 0x38]
mov edx, dword [eax]
push edx
mov ecx, dword [esi + 4]
push ecx
call fcn.004930bc
add esp, 8
test al, al
je 0x4c0b9c
push ebx
mov eax, dword [esi]
push eax
call fcn.00413d94
add esp, 8
jmp 0x4c0dc0
mov dword [ebp - 0x84], 0
mov dword [ebp - 0x80], 0
mov edx, dword [ebp - 0x78]
mov dword [ebp - 0x8c], edx
mov edx, dword [ebp - 0x74]
mov dword [ebp - 0x88], edx
mov byte [edi], 0
push ebx
mov ecx, dword [esi]
push ecx
call fcn.00413cd0
add esp, 8
test al, al
jne 0x4c0bde
push ebx
mov eax, dword [esi]
push eax
call fcn.00413d94
add esp, 8
mov byte [edi], 0x5c
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push ebx
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x4c0dc0
lea edx, [ebp - 0x68]
lea ecx, [ebp - 0x64]
push edx
push ecx
push dword [ebp - 0x6c]
push dword [ebp - 0x70]
mov edx, dword [esi]
push edx
call fcn.0041303c
add esp, 0x14
push 0
mov ecx, dword [ebp - 0x64]
push ecx
mov eax, dword [ebp - 0x68]
push eax
mov edx, dword [ebp - 0x30]
push edx
call sub.KERNEL32.DLL_SetFilePointer
jmp 0x4c0da7
lea ecx, [ebp - 0x5c]
push 0
push ecx
lea eax, [ebp - 0x7a]
mov edi, dword [ebp - 0x4c]
push edi
push eax
mov edx, dword [ebp - 0x30]
push edx
call sub.KERNEL32.DLL_ReadFile
push 0
lea ecx, [ebp - 0x5c]
push ecx
push edi
lea eax, [ebp - 0x7c]
push eax
mov edx, dword [ebp - 0x30]
push edx
call sub.KERNEL32.DLL_ReadFile
cmp word [ebp - 0x7a], 0
jne 0x4c0c70
mov edi, 0x10000
jmp 0x4c0c74
movzx edi, word [ebp - 0x7a]
mov ax, word [ebp - 0x7a]
mov ecx, dword [ebp - 0x4c]
add ecx, ecx
cmp ax, word [ebp - 0x7c]
jne 0x4c0c87
mov edx, edi
jmp 0x4c0c8b
movzx edx, word [ebp - 0x7c]
add ecx, edx
mov eax, ecx
cdq
sub dword [ebp - 0x78], eax
sbb dword [ebp - 0x74], edx
mov eax, ecx
cdq
add dword [ebp - 0x84], eax
adc dword [ebp - 0x80], edx
mov eax, ecx
cdq
add dword [ebp - 0x94], eax
adc dword [ebp - 0x90], edx
mov cx, word [ebp - 0x7a]
cmp cx, word [ebp - 0x7c]
jne 0x4c0cd4
push 0
lea eax, [ebp - 0x5c]
push eax
push edi
lea edx, [ebp - 0x100a0]
push edx
mov ecx, dword [ebp - 0x30]
push ecx
call sub.KERNEL32.DLL_ReadFile
jmp 0x4c0d0a
lea eax, [ebp - 0x5c]
push 0
push eax
lea ecx, [ebp - 0x200b0]
movzx edx, word [ebp - 0x7c]
push edx
push ecx
mov eax, dword [ebp - 0x30]
push eax
call sub.KERNEL32.DLL_ReadFile
lea edx, [ebp - 0x200b0]
lea ecx, [ebp - 0x100a0]
push edx
push edi
push ecx
lea eax, [ebp - 4]
push eax
call fcn.0049af74
add esp, 0x10
push 0
lea edx, [ebp - 0x60]
push edx
push edi
lea ecx, [ebp - 0x100a0]
push ecx
mov eax, dword [ebp - 0x34]
push eax
call sub.KERNEL32.DLL_WriteFile
cmp word [ebp + 0x1a], 0
je 0x4c0da7
lea edx, [ebp - 0x9e]
lea ecx, [ebp - 0x9d]
push edx
push ecx
push dword [ebp - 0x98]
push dword [ebp - 0x9c]
push dword [ebp - 0x90]
push dword [ebp - 0x94]
push dword [ebp - 0x88]
push dword [ebp - 0x8c]
push dword [ebp - 0x80]
push dword [ebp - 0x84]
push ebx
mov edx, dword [ebp + 0x10]
push edx
mov ecx, dword [ebp + 0xc]
push ecx
mov eax, dword [ebp + 0x1c]
push eax
call dword [ebp + 0x18]
add esp, 0x38
xor edx, edx
mov dl, byte [ebp - 0x9e]
cmp edx, 1
sbb ecx, ecx
neg ecx
and byte [ebp - 0x9d], cl
cmp byte [ebp - 0x9d], 0
je 0x4c0d9e
push 0x1f4
call sub.KERNEL32.DLL_Sleep
cmp byte [ebp - 0x9d], 0
jne 0x4c0d28
cmp dword [ebp - 0x74], 0
jne 0x4c0db1
cmp dword [ebp - 0x78], 0
ja 0x4c0c37
mov eax, dword [ebp - 0x34]
push eax
call sub.KERNEL32.DLL_CloseHandle
push ebx
call fcn.0049b6d4
pop ecx
mov edx, dword [ebp - 0x58]
push edx
mov ecx, dword [esi + 4]
push ecx
call fcn.00492b34
add esp, 8
mov eax, dword [ebp - 0x40]
push eax
call fcn.0049b6d4
pop ecx
inc dword [ebp - 0x50]
cmp byte [ebp - 0x9e], 0
jne 0x4c0df9
mov edx, dword [ebp - 0x50]
cmp edx, dword [ebp - 0x54]
jl 0x4c0a02
mov ecx, dword [ebp - 0x30]
push ecx
call sub.KERNEL32.DLL_CloseHandle
push 3
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00414cd8
add esp, 8
mov eax, dword [ebp - 0x54]
lea edx, [ebp - 4]
push eax
dec dword [ebp - 0xc]
push 2
push edx
call fcn.0049b1d0
add esp, 8
pop eax
mov edx, dword [ebp - 0x28]
mov dword fs:[0], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret