Function at 0x4d9350
Capabilities:
Check if file exists
Get file attributes
Read file on windows
Set file attributes
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4fbd0b
push eax
mov dword fs:[0], esp
sub esp, 0xe58
push ebx
mov ebx, dword [esp + 0xe6c]
push ebp
push esi
xor esi, esi
push edi
cmp ebx, esi
mov ebp, ecx
je 0x4d97dd
lea eax, [ebp + 0x6274c]
push eax
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp + 0x20], 1
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x2e]
mov word [esp + 0x2c], si
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [esp + 0x2c]
mov dword [esp + 0xe70], esi
test eax, eax
je 0x4d955e
mov eax, dword [ebp + 0x14]
mov esi, 2
cmp eax, esi
jne 0x4d955e
cmp ebx, esi
jne 0x4d9406
lea ecx, [ebp + 0x3d0]
lea edx, [esp + 0x2c]
push ecx
push 0x50f4e4
push 0x103
push edx
call dword [sym.imp.MSVCRT.dll__snwprintf]
lea eax, [esp + 0x3c]
push 0
push eax
call fcn.004f1940
add esp, 0x18
jmp 0x4d955e
push ebx
mov ecx, ebp
call fcn.004d6380
cmp eax, 0xffffffff
je 0x4d955e
mov edx, dword [ebp + 0x608]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 7
add eax, edx
xor edx, edx
mov dword [esp + 0x10], edx
cmp dword [eax + 4], esi
jne 0x4d943b
mov dword [esp + 0x10], 1
mov ebx, dword [eax]
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x84e]
mov word [esp + 0x84c], dx
cmp ebx, esi
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
je 0x4d94e9
push ebx
mov ecx, ebp
call fcn.004d6380
cmp eax, 0xffffffff
je 0x4d955e
mov edi, dword [ebp + 0x608]
lea eax, [eax + eax*4]
mov ecx, 0x81
lea edx, [esp + 0x43c]
lea esi, [eax + eax*4]
xor eax, eax
shl esi, 7
add esi, edi
lea edi, [esp + 0x43e]
mov ebx, dword [esi + 8]
mov word [esp + 0x43c], 0
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x84c]
stosw word es:[edi], ax
mov edi, dword [sym.imp.MSVCRT.dll_swprintf]
push ecx
push 0x50f4e4
push edx
call edi
add esp, 0xc
lea eax, [esp + 0x43c]
add esi, 0x48
lea ecx, [esp + 0x84c]
push eax
push esi
push str._s_s
push ecx
call edi
add esp, 0x10
cmp ebx, 2
jne 0x4d945f
xor edx, edx
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x43e]
mov word [esp + 0x43c], dx
rep stosd dword es:[edi], eax
lea edx, [esp + 0x43c]
push 0x104
push edx
stosw word es:[edi], ax
call fcn.004dc910
lea eax, [esp + 0x444]
push 0
push eax
call fcn.004f1940
mov eax, dword [esp + 0x20]
add esp, 0x10
lea ecx, [esp + 0x84c]
lea edx, [esp + 0x43c]
test eax, eax
push ecx
push edx
je 0x4d9546
push 0x50f5ec
jmp 0x4d954b
push str._s_s.url
lea eax, [esp + 0x38]
push 0x103
push eax
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x14
lea ecx, [esp + 0x2c]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4d9577
mov edx, dword [esp + 0x1c]
push edx
jmp 0x4d97d7
mov esi, 1
lea eax, [esp + 0x2c]
push esi
push eax
call fcn.004f1940
xor ebx, ebx
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x23e]
mov word [esp + 0x23c], bx
add esp, 8
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x2c]
push str.favorder3.dat
push ecx
push 0x50f5ec
lea edx, [esp + 0x240]
push 0x103
push edx
stosw word es:[edi], ax
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x14
lea eax, [esp + 0x234]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
lea ecx, [esp + 0x234]
push 0x20
push ecx
mov dword [esp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea edx, [esp + 0x234]
mov dword [esp + 0x14], ebx
mov ebx, dword [sym.imp.MSVCRT.dll__wfopen]
push 0x51b1ec
push edx
call ebx
mov edi, eax
add esp, 8
test edi, edi
je 0x4d9638
push edi
push esi
lea eax, [esp + 0x1c]
push 4
push eax
call dword [sym.imp.MSVCRT.dll_fread]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x28]
add esp, 0x14
cmp eax, esi
je 0x4d9638
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0xe7c]
test eax, eax
je 0x4d9647
mov dword [esp + 0x14], esi
lea ecx, [esp + 0x234]
push 0x51b20c
push ecx
call ebx
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4d9669
mov edx, dword [esp + 0x1c]
push edx
jmp 0x4d97d7
push ebx
push esi
mov esi, dword [sym.imp.MSVCRT.dll_fwrite]
lea eax, [esp + 0x1c]
push 4
push eax
call esi
mov ecx, 0x104
xor eax, eax
lea edi, [esp + 0xa64]
push ebx
rep stosd dword es:[edi], eax
push 1
lea ecx, [esp + 0xa6c]
push 0x414
push ecx
mov dword [esp + 0xe84], 0xffffffff
call esi
mov ecx, dword [ebp + 0x620]
xor esi, esi
add esp, 0x20
xor eax, eax
cmp ecx, esi
mov dword [esp + 0x10], esi
jle 0x4d97b3
mov dword [esp + 0x18], esi
mov edx, dword [ebp + 0x608]
add esi, edx
mov edx, dword [esp + 0xe78]
cmp dword [esi + 8], edx
jne 0x4d978a
mov eax, dword [esi + 4]
mov dword [esp + 0x24], 1
cmp eax, 2
jne 0x4d96ff
lea eax, [esi + 0x48]
lea ecx, [esp + 0xa54]
push eax
push 0x50f4e4
push ecx
jmp 0x4d9710
lea edx, [esi + 0x48]
lea eax, [esp + 0xa54]
push edx
push str._s.url
push eax
call dword [sym.imp.MSVCRT.dll_swprintf]
mov esi, dword [esi + 0xc]
mov ecx, 0x103
xor eax, eax
lea edi, [esp + 0x44a]
mov word [esp + 0x448], 0
add esp, 0xc
rep stosd dword es:[edi], eax
lea ecx, [esp + 0xa54]
push esi
push ecx
lea edx, [esp + 0x444]
push str._s_d::
push edx
mov dword [esp + 0xe74], esi
stosw word es:[edi], ax
call dword [sym.imp.MSVCRT.dll_swprintf]
add esp, 0x10
lea eax, [esp + 0x43c]
push ebx
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
lea ecx, [esp + 0x440]
push eax
push 2
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov eax, dword [esp + 0x34]
add esp, 0x10
jmp 0x4d978e
test eax, eax
jne 0x4d97b3
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x18]
mov edx, dword [ebp + 0x620]
inc ecx
add esi, 0xc80
cmp ecx, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], esi
jl 0x4d96c4
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x2c]
add esp, 4
or al, 2
lea edx, [esp + 0x234]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0xe68]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xe64
ret 8