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

Disassembly:
push 0xffffffffffffffff
push 0x4e3d77
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.004d19b0
mov esi, dword [esp + 0x668]
xor edi, edi
cmp esi, edi
mov dword [esp + 0x28], edi
jne 0x4caa4d
xor eax, eax
jmp 0x4caf65
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 0x4f76fc
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 0x5013c4
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov esi, eax
add esp, 8
test esi, esi
jne 0x4caae2
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4caf65
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 0x4cab4e
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 0x4caf65
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 0x4cabb1
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 0x4caf65
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 0x4cac15
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.004ace19
mov ecx, dword [esp + 0x34]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4caf65
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 [0x50f2c8]
mov ecx, edi
shr ecx, 0x10
mov dword [esp + 0x10], eax
jne 0x4cac50
mov eax, edi
lea ecx, [esp + 0x10]
and eax, 0xffff
push eax
call fcn.004ccae0
jmp 0x4cac86
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
test esi, esi
je 0x4cac86
push esi
lea ecx, [esp + 0x14]
call fcn.004c9760
test eax, eax
je 0x4cac86
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 0x4caca0
or eax, 0xffffffff
jmp 0x4cacbe
push 0x50f5b8
push ecx
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4cacb8
or eax, 0xffffffff
jmp 0x4cacbe
sub eax, dword [esp + 0x10]
sar eax, 1
test eax, eax
mov esi, eax
jl 0x4caf44
jmp 0x4cacd2
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.004cafb0
mov ebx, dword [sym.imp.MSVCRT.dll_wcslen]
push 0x50f5b8
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 0x4cad17
mov dword [esp + 0x20], 0xffffffff
jmp 0x4cad41
lea eax, [ecx + eax*2]
push 0x50f5b8
push eax
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4cad37
mov dword [esp + 0x20], 0xffffffff
jmp 0x4cad41
sub eax, dword [esp + 0x10]
sar eax, 1
mov dword [esp + 0x20], eax
push 0
push 0x50f5b0
lea ecx, [esp + 0x24]
call fcn.0044e3c0
mov esi, eax
lea edx, [esp + 0x18]
push esi
push 0
push edx
lea ecx, [esp + 0x28]
call fcn.004cafb0
push 0x50f5b0
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.004cafb0
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 0x4cadb3
cmp dword [eax - 4], ecx
jge 0x4cadf8
mov ebx, dword [eax - 8]
cmp ebx, ecx
jle 0x4cadbc
mov ecx, ebx
push ecx
lea ecx, [esp + 0x1c]
call fcn.004c9760
test eax, eax
je 0x4cadf8
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.004caf80
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x24]
push eax
lea ecx, [esp + 0x248]
push 0x4f6574
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 0x4cae27
cmp dword [eax - 4], ecx
jge 0x4cae6c
mov ebx, dword [eax - 8]
cmp ebx, ecx
jle 0x4cae30
mov ecx, ebx
push ecx
lea ecx, [esp + 0x18]
call fcn.004c9760
test eax, eax
je 0x4cae6c
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.004caf80
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 0x4cae89
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.004d1740
mov eax, dword [esp + 0x14]
mov edx, dword [0x50f2cc]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4caed4
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4caeda
mov edx, dword [esp + 0x14]
lea eax, [edx - 0xc]
push eax
call fcn.004ace19
add esp, 4
jmp 0x4caeda
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [esp + 0x18]
mov edx, dword [0x50f2cc]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4caf05
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4caf05
mov edx, dword [esp + 0x18]
lea eax, [edx - 0xc]
push eax
call fcn.004ace19
add esp, 4
mov eax, dword [esp + 0x1c]
mov edx, dword [0x50f2cc]
mov byte [esp + 0x660], 1
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4caf38
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4caf38
mov edx, dword [esp + 0x1c]
add edx, 0xfffffff4
push edx
call fcn.004ace19
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
jge 0x4cacca
push edi
call fcn.004ace19
add esp, 4
lea ecx, [esp + 0x10]
call fcn.004c97f0
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