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

Disassembly:
push 0xffffffffffffffff
push 0x4fbcc7
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.004dffd0
mov esi, dword [esp + 0x668]
xor edi, edi
cmp esi, edi
mov dword [esp + 0x28], edi
jne 0x4d8c6d
xor eax, eax
jmp 0x4d9185
add ebx, 0x6274c
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 0x510768
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 0x51b1ec
push eax
call dword [sym.imp.MSVCRT.dll__wfopen]
mov esi, eax
add esp, 8
test esi, esi
jne 0x4d8d02
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4d9185
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 0x4d8d6e
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 0x4d9185
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 0x4d8dd1
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 0x4d9185
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 0x4d8e35
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.004ba355
mov ecx, dword [esp + 0x34]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
jmp 0x4d9185
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 [0x529688]
mov ecx, edi
shr ecx, 0x10
mov dword [esp + 0x10], eax
jne 0x4d8e70
mov eax, edi
lea ecx, [esp + 0x10]
and eax, 0xffff
push eax
call fcn.004da050
jmp 0x4d8ea6
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
test esi, esi
je 0x4d8ea6
push esi
lea ecx, [esp + 0x14]
call fcn.004d7960
test eax, eax
je 0x4d8ea6
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 0x4d8ec0
or eax, 0xffffffff
jmp 0x4d8ede
push 0x529994
push ecx
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4d8ed8
or eax, 0xffffffff
jmp 0x4d8ede
sub eax, dword [esp + 0x10]
sar eax, 1
test eax, eax
mov esi, eax
jl 0x4d9164
jmp 0x4d8ef2
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.004d91d0
mov ebx, dword [sym.imp.MSVCRT.dll_wcslen]
push 0x529994
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 0x4d8f37
mov dword [esp + 0x20], 0xffffffff
jmp 0x4d8f61
lea eax, [ecx + eax*2]
push 0x529994
push eax
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4d8f57
mov dword [esp + 0x20], 0xffffffff
jmp 0x4d8f61
sub eax, dword [esp + 0x10]
sar eax, 1
mov dword [esp + 0x20], eax
push 0
push 0x52998c
lea ecx, [esp + 0x24]
call fcn.00456830
mov esi, eax
lea edx, [esp + 0x18]
push esi
push 0
push edx
lea ecx, [esp + 0x28]
call fcn.004d91d0
push 0x52998c
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.004d91d0
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 0x4d8fd3
cmp dword [eax - 4], ecx
jge 0x4d9018
mov ebx, dword [eax - 8]
cmp ebx, ecx
jle 0x4d8fdc
mov ecx, ebx
push ecx
lea ecx, [esp + 0x1c]
call fcn.004d7960
test eax, eax
je 0x4d9018
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.004d91a0
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x24]
push eax
lea ecx, [esp + 0x248]
push 0x50f4e4
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 0x4d9047
cmp dword [eax - 4], ecx
jge 0x4d908c
mov ebx, dword [eax - 8]
cmp ebx, ecx
jle 0x4d9050
mov ecx, ebx
push ecx
lea ecx, [esp + 0x18]
call fcn.004d7960
test eax, eax
je 0x4d908c
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.004d91a0
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 0x4d90a9
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.004dfd60
mov eax, dword [esp + 0x14]
mov edx, dword [0x52968c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4d90f4
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4d90fa
mov edx, dword [esp + 0x14]
lea eax, [edx - 0xc]
push eax
call fcn.004ba355
add esp, 4
jmp 0x4d90fa
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [esp + 0x18]
mov edx, dword [0x52968c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4d9125
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4d9125
mov edx, dword [esp + 0x18]
lea eax, [edx - 0xc]
push eax
call fcn.004ba355
add esp, 4
mov eax, dword [esp + 0x1c]
mov edx, dword [0x52968c]
mov byte [esp + 0x660], 1
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4d9158
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4d9158
mov edx, dword [esp + 0x1c]
add edx, 0xfffffff4
push edx
call fcn.004ba355
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
jge 0x4d8eea
push edi
call fcn.004ba355
add esp, 4
lea ecx, [esp + 0x10]
call fcn.004d79f0
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