Function at 0x4cae40
Capabilities:
Get file attributes
Read file on windows
Set file attributes
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4e3a2b
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 0x4cb2b1
lea eax, [ebp + 0x62750]
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 0x4cb04e
mov eax, dword [ebp + 0x14]
mov esi, 2
cmp eax, esi
jne 0x4cb04e
cmp ebx, esi
jne 0x4caef6
lea ecx, [ebp + 0x3d0]
lea edx, [esp + 0x2c]
push ecx
push 0x4f6580
push 0x103
push edx
call dword [sym.imp.MSVCRT.dll__snwprintf]
lea eax, [esp + 0x3c]
push 0
push eax
call fcn.004db1d0
add esp, 0x18
jmp 0x4cb04e
push ebx
mov ecx, ebp
call fcn.004c7e50
cmp eax, 0xffffffff
je 0x4cb04e
mov edx, dword [ebp + 0x60c]
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 0x4caf2b
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 0x4cafd9
push ebx
mov ecx, ebp
call fcn.004c7e50
cmp eax, 0xffffffff
je 0x4cb04e
mov edi, dword [ebp + 0x60c]
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 0x4f6580
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 0x4caf4f
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.004ce010
lea eax, [esp + 0x444]
push 0
push eax
call fcn.004db1d0
mov eax, dword [esp + 0x20]
add esp, 0x10
lea ecx, [esp + 0x84c]
lea edx, [esp + 0x43c]
test eax, eax
push ecx
push edx
je 0x4cb036
push 0x4f6614
jmp 0x4cb03b
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 1
push ecx
call fcn.004db1d0
xor esi, esi
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x23e]
mov word [esp + 0x23c], si
add esp, 8
rep stosd dword es:[edi], eax
lea edx, [esp + 0x2c]
push str.favorder3.dat
stosw word es:[edi], ax
push edx
push 0x4f6614
lea eax, [esp + 0x240]
push 0x103
push eax
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x14
lea ecx, [esp + 0x234]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
lea edx, [esp + 0x234]
push 0x20
push edx
mov dword [esp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov ebx, dword [sym.imp.MSVCRT.dll__wfopen]
lea eax, [esp + 0x234]
push 0x5011d4
push eax
mov dword [esp + 0x1c], esi
call ebx
mov edi, eax
add esp, 8
cmp edi, esi
je 0x4cb109
push edi
push 1
lea ecx, [esp + 0x1c]
push 4
push ecx
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, 1
je 0x4cb109
mov dword [esp + 0x14], esi
cmp dword [esp + 0xe7c], esi
je 0x4cb11a
mov dword [esp + 0x14], 1
lea edx, [esp + 0x234]
push 0x5011f4
push edx
call ebx
mov ebx, eax
add esp, 8
cmp ebx, esi
jne 0x4cb13c
mov eax, dword [esp + 0x1c]
push eax
jmp 0x4cb2ab
mov esi, dword [sym.imp.MSVCRT.dll_fwrite]
push ebx
push 1
lea ecx, [esp + 0x1c]
push 4
push ecx
call esi
push ebx
mov ecx, 0x104
xor eax, eax
lea edi, [esp + 0xa68]
push 1
lea edx, [esp + 0xa6c]
push 0x414
push edx
rep stosd dword es:[edi], eax
mov dword [esp + 0xe84], 0xffffffff
call esi
mov ecx, dword [ebp + 0x624]
xor esi, esi
add esp, 0x20
xor eax, eax
cmp ecx, esi
mov dword [esp + 0x10], esi
jle 0x4cb287
mov dword [esp + 0x18], esi
mov edi, dword [ebp + 0x60c]
mov ecx, dword [esp + 0xe78]
add esi, edi
cmp dword [esi + 8], ecx
jne 0x4cb25e
mov eax, dword [esi + 4]
mov dword [esp + 0x24], 1
cmp eax, 2
jne 0x4cb1d3
lea edx, [esi + 0x48]
lea eax, [esp + 0xa54]
push edx
push 0x4f6580
push eax
jmp 0x4cb1e4
lea ecx, [esi + 0x48]
lea edx, [esp + 0xa54]
push ecx
push str._s.url
push edx
call dword [sym.imp.MSVCRT.dll_swprintf]
mov ecx, 0x103
xor eax, eax
lea edi, [esp + 0x44a]
mov esi, dword [esi + 0xc]
mov word [esp + 0x448], 0
add esp, 0xc
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [esp + 0xa54]
push esi
push eax
lea ecx, [esp + 0x444]
push str._s_d::
push ecx
mov dword [esp + 0xe74], esi
call dword [sym.imp.MSVCRT.dll_swprintf]
add esp, 0x10
lea edx, [esp + 0x43c]
push ebx
push edx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
push eax
lea eax, [esp + 0x444]
push 2
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
mov eax, dword [esp + 0x34]
add esp, 0x10
jmp 0x4cb262
test eax, eax
jne 0x4cb287
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x18]
mov edx, dword [ebp + 0x624]
inc ecx
add esi, 0xc80
cmp ecx, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], esi
jl 0x4cb198
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x2c]
add esp, 4
or al, 2
lea ecx, [esp + 0x234]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov edx, dword [esp + 0x1c]
push edx
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