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

Disassembly:
mov eax, 0x1004
call fcn.0041cd90
push ebx
mov ebx, dword [esp + 0x1010]
push ebp
push edi
xor edi, edi
xor eax, eax
cmp ebx, 0xffffffff
mov dword [esp + 0xc], edi
setne al
mov ebp, eax
cmp ebx, edi
mov dword [esp + 0x10], ebp
jne 0x417195
cmp ebp, edi
je 0x417195
mov eax, dword [esp + 0x101c]
cmp eax, edi
je 0x417189
mov ecx, dword [esp + 0x1014]
cmp byte [ecx], 0x73
je 0x417189
mov dword [eax], edi
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1004
ret
push esi
mov esi, dword [esp + 0x1018]
cmp byte [esi], 0x73
jne 0x4172b9
mov eax, dword [esp + 0x1020]
cmp eax, edi
je 0x4171c0
mov ebp, dword [eax]
cmp ebp, 0xffffffff
je 0x4171c0
cmp ebp, 0xffa
jb 0x4171c5
mov ebp, 0xffa
mov ebx, dword [esp + 0x14]
mov edx, dword [esi + 6]
mov eax, dword [edx + 0x1c]
test eax, eax
jne 0x417235
mov eax, dword [esp + 0x101c]
lea ecx, [esp + 0x18]
push eax
push ebp
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
mov ebx, eax
add esp, 0x10
cmp ebx, 0xffa
jne 0x417235
mov edx, dword [esp + 0x10]
push eax
add edx, eax
mov dword [esp + 0x14], edx
lea edx, [esp + 0x1c]
push edx
push esi
call fcn.00414fe0
mov edi, eax
mov eax, dword [esp + 0x102c]
add esp, 0xc
test eax, eax
je 0x41722f
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x41722f
sub eax, dword [esp + 0x10]
cmp eax, ebx
mov ebp, eax
jb 0x41722f
mov ebp, ebx
test edi, edi
je 0x4171c9
jmp 0x417278
test edi, edi
jne 0x417278
test ebx, ebx
je 0x417266
mov eax, dword [esi + 6]
mov ecx, dword [eax + 0x1c]
test ecx, ecx
jne 0x417266
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x18]
push ebx
add eax, ebx
push ecx
push esi
mov dword [esp + 0x1c], eax
call fcn.00414fe0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x417278
lea edx, [esp + 0x18]
push 0
push edx
push esi
call fcn.00414fe0
add esp, 0xc
mov edi, eax
mov eax, dword [esp + 0x1020]
test eax, eax
je 0x417388
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x417388
cmp dword [esp + 0x10], eax
je 0x417388
push 0xffffffffffffffff
push 0x446718
push eax
push 0xf4d
call fcn.0040b400
add esp, 0x10
mov dword [esi + 0xe], eax
jmp 0x417388
lea eax, [esp + 0x18]
push edi
push eax
push esi
call fcn.00414fe0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x41734d
mov ebp, dword [sym.imp.MSVCRT.dll_fwrite]
mov eax, dword [esi + 0xa]
test eax, eax
je 0x417349
mov ecx, dword [esp + 0x10]
add ecx, eax
mov eax, dword [esi + 0xe]
test eax, eax
mov dword [esp + 0x10], ecx
jne 0x417333
mov ecx, dword [esi + 6]
mov eax, dword [ecx + 0x1c]
test eax, eax
jne 0x417333
test ebx, ebx
je 0x417333
mov eax, dword [esp + 0x14]
test eax, eax
je 0x417333
mov edx, dword [esi + 0xa]
push ebx
push 1
lea eax, [esp + 0x20]
push edx
push eax
call ebp
add esp, 0x10
cmp eax, 1
je 0x417333
call dword [sym.imp.MSVCRT.dll__errno]
cmp dword [eax], 4
je 0x417302
push 0x715
call fcn.0040b400
add esp, 4
mov dword [esi + 0xe], eax
lea ecx, [esp + 0x18]
push 0
push ecx
push esi
call fcn.00414fe0
mov edi, eax
add esp, 0xc
test edi, edi
je 0x4172d4
mov ebp, dword [esp + 0x14]
test ebp, ebp
je 0x417377
push ebx
call dword [sym.imp.MSVCRT.dll_fflush]
add esp, 4
cmp eax, 0xffffffff
jne 0x417377
mov eax, dword [esi + 0xe]
test eax, eax
jne 0x417377
push 0x715
call fcn.0040b400
add esp, 4
mov dword [esi + 0xe], eax
mov eax, dword [esp + 0x1020]
test eax, eax
je 0x417388
mov edx, dword [esp + 0x10]
mov dword [eax], edx
cmp byte [esi], 0x72
jne 0x4173bb
mov eax, dword [0x41e7b0]
cmp dword [eax], 0
je 0x41739b
push 1
jmp 0x4173b0
mov ecx, dword [0x41e7ac]
mov eax, dword [ecx + 0xd33]
test eax, eax
je 0x4173bb
push 0x139b
call fcn.0040b400
add esp, 4
mov dword [esi + 0xe], eax
mov eax, edi
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x1004
ret