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

Disassembly:
push 0xffffffffffffffff
push 0x4e39e7
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x648
push ebx
mov ebx, ecx
mov ecx, dword [esp + 0x660]
push ebp
push esi
push edi
mov eax, dword [ecx + 8]
mov edx, dword [ecx + 4]
push eax
push edx
call fcn.004d16b0
mov esi, dword [esp + 0x668]
xor edi, edi
cmp esi, edi
mov dword [esp + 0x28], edi
jne 0x4ca71d
xor eax, eax
jmp 0x4cac35
add ebx, 0x62750
push ebx
mov dword [esp + 0x34], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp + 0x34], 1
mov dword [esp + 0x660], edi
mov word [esp + 0x3c], di
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x3e]
push str.favorder3.dat
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push esi
push 0x4f789c
lea eax, [esp + 0x48]
push 0x103
push eax
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x14
lea ecx, [esp + 0x3c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebp, eax
lea edx, [esp + 0x3c]
and ebp, 0xfffffffd
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea eax, [esp + 0x3c]
push 0x5011d4
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov esi, eax
add esp, 8
test esi, esi
jne 0x4ca7b2
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4cac35
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push 0
push esi
call edi
push esi
call dword [sym.imp.MSVCRT.dll_ftell]
push 0
push 0
push esi
mov ebx, eax
call edi
push esi
push 1
lea ecx, [esp + 0x50]
push 4
push ecx
mov dword [esp + 0x58], 0
call dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [esp + 0x58]
add esp, 0x2c
cmp eax, 1
je 0x4ca81e
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or ebp, 2
lea edx, [esp + 0x3c]
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4cac35
mov ecx, 0x104
xor eax, eax
lea edi, [esp + 0x244]
push esi
rep stosd dword es:[edi], eax
push 1
lea ecx, [esp + 0x24c]
push 0x414
push ecx
mov dword [esp + 0x664], 0xffffffff
call dword [sym.imp.MSVCRT.dll_fread]
lea edi, [ebx + 1]
push edi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edx, eax
add esp, 0x14
test edx, edx
mov dword [esp + 0x24], edx
jne 0x4ca881
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov edx, dword [esp + 0x34]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4cac35
mov ecx, edi
mov edi, edx
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push esi
and ecx, 3
push ebx
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x2c]
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
add ebx, 0xfffffbe8
cmp eax, ebx
push esi
je 0x4ca8e5
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or ebp, 2
lea eax, [esp + 0x3c]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push edi
call fcn.004acab9
mov ecx, dword [esp + 0x34]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4cac35
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or ebp, 2
lea edx, [esp + 0x3c]
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [0x50f2f8]
mov ecx, edi
shr ecx, 0x10
mov dword [esp + 0x10], eax
jne 0x4ca920
mov eax, edi
lea ecx, [esp + 0x10]
and eax, 0xffff
push eax
call fcn.004cc7f0
jmp 0x4ca956
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
test esi, esi
je 0x4ca956
push esi
lea ecx, [esp + 0x14]
call fcn.004c9430
test eax, eax
je 0x4ca956
lea ecx, [esi + esi]
mov esi, edi
mov edi, dword [esp + 0x10]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x10]
xor ebx, ebx
mov byte [esp + 0x660], 1
mov eax, dword [ecx - 8]
test eax, eax
jge 0x4ca970
or eax, 0xffffffff
jmp 0x4ca98e
push 0x50f5e8
push ecx
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4ca988
or eax, 0xffffffff
jmp 0x4ca98e
sub eax, dword [esp + 0x10]
sar eax, 1
test eax, eax
mov esi, eax
jl 0x4cac14
jmp 0x4ca9a2
mov esi, dword [esp + 0x20]
mov ebx, dword [esp + 0x38]
mov eax, esi
lea ecx, [esp + 0x1c]
sub eax, ebx
push eax
push ebx
push ecx
lea ecx, [esp + 0x1c]
call fcn.004cac80
mov ebx, dword [sym.imp.MSVCRT.dll_wcslen]
push 0x50f5e8
mov byte [esp + 0x664], 2
call ebx
mov ecx, dword [esp + 0x14]
add eax, esi
add esp, 4
mov dword [esp + 0x38], eax
cmp eax, dword [ecx - 8]
jle 0x4ca9e7
mov dword [esp + 0x20], 0xffffffff
jmp 0x4caa11
lea eax, [ecx + eax*2]
push 0x50f5e8
push eax
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4caa07
mov dword [esp + 0x20], 0xffffffff
jmp 0x4caa11
sub eax, dword [esp + 0x10]
sar eax, 1
mov dword [esp + 0x20], eax
push 0
push 0x50f5e0
lea ecx, [esp + 0x24]
call fcn.004cae00
mov esi, eax
lea edx, [esp + 0x18]
push esi
push 0
push edx
lea ecx, [esp + 0x28]
call fcn.004cac80
push 0x50f5e0
mov byte [esp + 0x664], 3
call ebx
add esp, 4
add esi, eax
mov eax, 0
lea ecx, [esp + 0x14]
sets al
dec eax
and eax, esi
push eax
push esi
push ecx
lea ecx, [esp + 0x28]
call fcn.004cac80
mov eax, dword [esp + 0x18]
mov ecx, 1
mov byte [esp + 0x660], 4
mov edx, dword [eax - 0xc]
lea ebp, [eax - 0xc]
cmp edx, ecx
jg 0x4caa83
cmp dword [eax - 4], ecx
jge 0x4caac8
mov ebx, dword [eax - 8]
cmp ebx, ecx
jle 0x4caa8c
mov ecx, ebx
push ecx
lea ecx, [esp + 0x1c]
call fcn.004c9430
test eax, eax
je 0x4caac8
mov edi, dword [esp + 0x18]
lea ecx, [ebx + ebx + 2]
mov edx, ecx
lea esi, [ebp + 0xc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x1c]
mov dword [eax - 8], ebx
call fcn.004cac50
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x24]
push eax
lea ecx, [esp + 0x248]
push 0x4f6580
push ecx
call dword [sym.imp.MSVCRT.dll_swprintf]
mov eax, dword [esp + 0x20]
mov ecx, 1
add esp, 0xc
mov edx, dword [eax - 0xc]
lea ebp, [eax - 0xc]
cmp edx, ecx
jg 0x4caaf7
cmp dword [eax - 4], ecx
jge 0x4cab3c
mov ebx, dword [eax - 8]
cmp ebx, ecx
jle 0x4cab00
mov ecx, ebx
push ecx
lea ecx, [esp + 0x18]
call fcn.004c9430
test eax, eax
je 0x4cab3c
mov edi, dword [esp + 0x14]
lea ecx, [ebx + ebx + 2]
mov edx, ecx
lea esi, [ebp + 0xc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x18]
mov dword [eax - 8], ebx
call fcn.004cac50
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x24]
push eax
call dword [sym.imp.MSVCRT.dll__wtoi]
mov ecx, dword [esp + 0x2c]
add esp, 4
cmp eax, ecx
mov dword [esp + 0x654], eax
jle 0x4cab59
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x66c]
lea edx, [esp + 0x244]
push edx
mov eax, dword [ecx + 8]
push eax
call fcn.004d1440
mov eax, dword [esp + 0x14]
mov edx, dword [0x50f2fc]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4caba4
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4cabaa
mov edx, dword [esp + 0x14]
lea eax, [edx - 0xc]
push eax
call fcn.004acab9
add esp, 4
jmp 0x4cabaa
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [esp + 0x18]
mov edx, dword [0x50f2fc]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4cabd5
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4cabd5
mov edx, dword [esp + 0x18]
lea eax, [edx - 0xc]
push eax
call fcn.004acab9
add esp, 4
mov eax, dword [esp + 0x1c]
mov edx, dword [0x50f2fc]
mov byte [esp + 0x660], 1
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4cac08
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4cac08
mov edx, dword [esp + 0x1c]
add edx, 0xfffffff4
push edx
call fcn.004acab9
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
jge 0x4ca99a
push edi
call fcn.004acab9
add esp, 4
lea ecx, [esp + 0x10]
call fcn.004c94c0
mov eax, dword [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x658]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x654
ret 8