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

Disassembly:
push ebp
push edi
push esi
xor esi, esi
push ebx
sub esp, 0x3c
mov edx, dword [esp + 0x50]
lea ebx, [esi + 1]
mov dword [esp + 0x24], 0x7d0
mov ecx, dword [edx]
cmp ebx, ecx
jge 0x4a1dd2
nop
mov eax, dword [esp + 0x54]
mov edx, dword [eax]
lea eax, [ebx*4]
mov dword [esp + 0x20], eax
mov eax, dword [edx + ebx*4]
cmp byte [eax], 0x40
je 0x4a1de0
mov esi, ebx
lea ebx, [esi + 1]
cmp ebx, ecx
jl 0x4a1db0
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
sub dword [esp + 0x24], 1
je 0x4a2017
add eax, 1
mov dword [esp + 4], 0x509d09
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov ebp, eax
je 0x4a1fea
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4a1fe2
mov dword [esp], ebp
call sub.msvcrt.dll_ftell
cmp eax, 0xffffffff
mov edi, eax
je 0x4a1fe2
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebp
call sub.msvcrt.dll_fseek
cmp eax, 0xffffffff
je 0x4a1fe2
lea eax, [edi + 1]
mov dword [esp], eax
call fcn.004a0a50
mov dword [esp + 0xc], ebp
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov dword [esp + 0x2c], eax
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp edi, eax
mov edx, eax
je 0x4a1ea2
mov dword [esp], ebp
mov dword [esp + 0x1c], eax
call sub.msvcrt.dll_ferror
mov edx, dword [esp + 0x1c]
test eax, eax
jne 0x4a1fe2
mov eax, dword [esp + 0x2c]
mov byte [eax + edx], 0
mov edx, eax
movzx eax, byte [eax]
test al, al
je 0x4a1ee3
movzx eax, al
test byte [eax + eax + 0x50a020], 0x40
je 0x4a1ff7
mov eax, edx
jmp 0x4a1ed9
movzx edx, dl
test byte [edx + edx + 0x50a020], 0x40
je 0x4a1ff7
add eax, 1
movzx edx, byte [eax]
test dl, dl
jne 0x4a1ec8
mov dword [esp], 4
call fcn.004a0a50
mov edx, eax
mov dword [eax], 0
mov ecx, dword [esp + 0x54]
mov eax, dword [ecx]
mov dword [esp + 0x1c], edx
mov dword [esp], eax
call fcn.004a19c0
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x1c]
test eax, eax
mov dword [esp + 0x28], eax
mov dword [ecx], eax
je 0x4a2041
mov eax, dword [edx]
xor edi, edi
test eax, eax
je 0x4a200a
nop
lea esi, [esi]
add edi, 1
mov eax, dword [edx + edi*4]
lea ecx, [edi*4]
test eax, eax
jne 0x4a1f30
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x50]
mov eax, edi
add eax, dword [ecx]
mov dword [esp + 0x1c], edx
lea eax, [eax*4 + 4]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call fcn.004a0ad0
mov ecx, dword [esp + 0x54]
mov dword [ecx], eax
mov ecx, dword [esp + 0x50]
mov dword [esp + 0x28], eax
mov eax, dword [ecx]
mov ecx, dword [esp + 0x28]
sub eax, ebx
shl eax, 2
mov dword [esp + 8], eax
lea eax, [ecx + ebx*4 + 4]
add ebx, edi
mov dword [esp + 4], eax
lea eax, [ecx + ebx*4]
mov ebx, esi
mov dword [esp], eax
call sub.msvcrt.dll_memmove
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
add eax, dword [ecx]
mov ecx, dword [esp + 0x14]
mov dword [esp + 4], edx
mov dword [esp], eax
mov dword [esp + 8], ecx
call sub.msvcrt.dll_memcpy
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x1c]
mov eax, dword [ecx]
lea eax, [edi + eax - 1]
mov dword [ecx], eax
mov dword [esp], edx
call sub.msvcrt.dll_free
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], ebp
call sub.msvcrt.dll_fclose
mov edx, dword [esp + 0x50]
mov esi, ebx
mov ecx, dword [edx]
jmp 0x4a1dcb
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call fcn.004a1aa0
mov edx, eax
jmp 0x4a1ef7
mov dword [esp + 0x14], 0
jmp 0x4a1f45
mov eax, dword [edx]
mov dword [esp + 4], str._s:_error:_too_many___files_encountered_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 1
call fcn.004a2430
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0xf
mov dword [esp + 4], 1
mov dword [esp], str._nout_of_memory_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call fcn.004a2430
lea esi, [esi]
lea edi, [edi]
mov edx, dword [esp + 4]
xor eax, eax
test edx, edx
je 0x4a209a
mov ecx, dword [edx]
test ecx, ecx
je 0x4a209a
add eax, 1
mov ecx, dword [edx + eax*4]
test ecx, ecx
jne 0x4a2090
repz ret