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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4f54fd
mov eax, dword fs:[0]
push eax
sub esp, 0x48
mov eax, dword [0x51300c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x48], edi
lea ebx, [edi + 0x20]
mov dword [ebx + 0x10], 0
mov eax, ebx
cmp dword [ebx + 0x14], 0x10
jb 0x4c7454
mov eax, dword [ebx]
mov byte [eax], 0
mov ecx, 0x508380
mov eax, dword [edi + 4]
test al, 0x40
je 0x4c746a
mov eax, 0x508384
jmp 0x4c7474
test al, 0x20
mov eax, 0x508388
cmove eax, ecx
push eax
push dword [ebp + 8]
mov dword [edi], 0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 8
mov dword [edi], eax
test eax, eax
jne 0x4c7499
mov ecx, edi
call fcn.004c7200
jmp 0x4c77c6
mov ecx, dword [edi + 4]
xor esi, esi
mov byte [ebp - 0x41], 1
mov dword [edi + 0x18], 1
test cl, 0x10
je 0x4c76d6
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push 2
push esi
push eax
call ebx
push dword [edi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
push esi
push esi
push dword [edi]
mov dword [edi + 0x10], eax
call ebx
mov eax, dword [edi + 0x10]
mov ebx, 0x400
add esp, 0x1c
mov dword [ebp - 0x4c], ebx
cmp eax, ebx
jge 0x4c74ee
mov ebx, eax
mov dword [ebp - 0x4c], ebx
test ebx, ebx
je 0x4c778a
push ebx
call fcn.004f2745
push dword [edi]
mov dword [ebp - 0x50], eax
push 1
push ebx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x14
cmp eax, 1
sete byte [ebp - 0x41]
jne 0x4c76c3
and dword [edi + 4], 0xfffffffa
xor ecx, ecx
mov dword [ebp - 0x54], ecx
cmp dword [0x513218], ecx
je 0x4c75ae
xor edx, edx
nop word [eax + eax]
mov ebx, dword [edx + 0x51321c]
xor esi, esi
test ebx, ebx
jle 0x4c7560
mov edi, dword [ebp - 0x4c]
nop
cmp esi, edi
jge 0x4c755a
mov eax, dword [ebp - 0x50]
mov ecx, dword [edx + 0x513218]
mov al, byte [eax + esi]
cmp al, byte [esi + ecx]
jne 0x4c755a
inc esi
cmp esi, ebx
jl 0x4c7540
mov edi, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x54]
cmp esi, ebx
je 0x4c7579
inc ecx
xor esi, esi
mov edx, ecx
mov dword [ebp - 0x54], ecx
shl edx, 4
cmp dword [edx + 0x513218], esi
jne 0x4c7530
jmp 0x4c75ab
shl ecx, 4
mov eax, dword [ecx + 0x513224]
or dword [edi + 4], eax
cmp esi, 2
jne 0x4c758d
mov dword [edi + 0x18], esi
mov edx, dword [ecx + 0x513220]
mov ecx, edx
lea ebx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4c7598
sub ecx, ebx
push ecx
push edx
lea ecx, [edi + 0x38]
call fcn.00402d80
mov ebx, dword [ebp - 0x4c]
cmp ebx, esi
jle 0x4c75c0
push 0
push esi
push dword [edi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
add esp, 0xc
test esi, esi
jne 0x4c76a6
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
push ebx
mov ebx, dword [ebp - 0x50]
lea ecx, [ebp - 0x28]
push ebx
mov dword [ebp - 4], esi
call fcn.00402d80
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
push ecx
cmovae eax, dword [ebp - 0x28]
mov ecx, esp
mov dword [ecx], eax
lea ecx, [ebp - 0x40]
call fcn.004ca290
add esp, 4
lea ecx, [edi + 0x38]
push eax
call fcn.00402c70
mov edx, dword [ebp - 0x2c]
cmp edx, 0x10
jb 0x4c7643
mov ecx, dword [ebp - 0x40]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4c7639
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4c7639
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004f1f95
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0xf
mov byte [ebp - 0x40], 0
cmp edx, 0x10
jb 0x4c7692
mov ecx, dword [ebp - 0x28]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4c7688
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4c7688
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004f1f95
add esp, 8
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
jmp 0x4c76a9
mov ebx, dword [ebp - 0x50]
cmp dword [edi + 0x48], 0
jne 0x4c76c3
cmp byte [ebx], 0x3c
jne 0x4c76c3
push 5
push str.UTF_8
lea ecx, [edi + 0x38]
call fcn.00402d80
push dword [ebp - 0x50]
call fcn.004f2732
mov al, byte [ebp - 0x41]
add esp, 4
jmp 0x4c7782
test cl, 0x20
je 0x4c778d
test cl, 0x40
je 0x4c76fd
push 2
push 0
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push dword [edi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
add esp, 0x10
mov dword [edi + 0x10], eax
xor ebx, ebx
cmp dword [0x513218], ebx
je 0x4c778a
mov ecx, dword [edi + 4]
xor eax, eax
test dword [eax + 0x513224], ecx
jne 0x4c7728
inc ebx
mov eax, ebx
shl eax, 4
cmp dword [eax + 0x513218], esi
jne 0x4c7710
jmp 0x4c778a
shl ebx, 4
mov esi, dword [ebx + 0x51321c]
cmp esi, 2
jne 0x4c7739
mov dword [edi + 0x18], esi
mov edx, dword [ebx + 0x513220]
mov ecx, edx
lea eax, [ecx + 1]
mov dword [ebp - 0x48], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4c7747
sub ecx, dword [ebp - 0x48]
push ecx
push edx
lea ecx, [edi + 0x38]
call fcn.00402d80
cmp dword [edi + 0x10], 0
je 0x4c7765
xor esi, esi
jmp 0x4c778a
push dword [edi]
push 1
push esi
push dword [ebx + 0x513218]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, 1
sete al
mov byte [ebp - 0x41], al
test al, al
je 0x4c748d
lea ebx, [edi + 0x20]
test byte [edi + 4], 0x40
je 0x4c7798
mov eax, dword [edi + 0x10]
jmp 0x4c779a
mov eax, esi
mov dword [edi + 0x14], eax
test esi, esi
je 0x4c77c3
push 0xffffffffffffffff
push 0xffffffffffffffff
push ecx
mov eax, esp
xor edx, edx
push ecx
mov esi, esp
mov ecx, ebx
mov dword [eax], 0
mov dword [esi], 0x50838c
call fcn.004c5860
add esp, 0x10
mov al, byte [ebp - 0x41]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004f1f57
mov esp, ebp
pop ebp
ret 4