Function at 0x4137d1
Capabilities:
Check if file exists
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
mov eax, dword [0x4cc8c0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x204]
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 0x10]
push 0x200
push 0
push eax
mov dword [ebp - 0x208], ebx
mov dword [ebp - 0x210], esi
call fcn.00466ad0
push ebx
call fcn.00451684
add esp, 0x10
test eax, eax
jne 0x41395b
push esi
call fcn.00451684
pop ecx
test eax, eax
jne 0x41395b
test edi, edi
mov eax, 0x48b207
push 0x200
cmovne eax, edi
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x204]
push 0
push eax
call fcn.00466ad0
push ebx
call fcn.00470560
add esp, 0x10
cmp eax, 0x104
jb 0x41396c
push ebx
call fcn.004503f2
mov edi, eax
push esi
mov dword [ebp - 0x214], edi
call fcn.004504df
mov dword [ebp - 0x20c], eax
pop ecx
pop ecx
test edi, edi
je 0x413950
test eax, eax
je 0x41394d
push eax
push edi
call fcn.00472277
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x413932
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x413932
test bl, 2
je 0x4138e2
mov edi, dword [ebp - 0x214]
xor ebx, 2
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push dword [ebp - 0x20c]
push edi
call fcn.00472277
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x413932
test bl, 4
je 0x41390c
mov edi, dword [ebp - 0x214]
xor ebx, 4
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push dword [ebp - 0x20c]
push edi
call fcn.00472277
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x413932
test bl, 1
je 0x413932
mov edi, dword [ebp - 0x214]
xor ebx, 1
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push dword [ebp - 0x20c]
push edi
call fcn.00472277
pop ecx
pop ecx
mov edi, eax
push dword [ebp - 0x214]
call fcn.004701df
push dword [ebp - 0x20c]
call fcn.004701df
jmp 0x4139fa
push edi
jmp 0x413955
test eax, eax
je 0x41395b
push eax
call fcn.004701df
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004654a8
leave
ret
push esi
push ebx
call fcn.0047228e
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x413a04
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x41395b
test bl, 2
je 0x4139b2
mov edi, dword [ebp - 0x208]
xor ebx, 2
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
push edi
call fcn.0047228e
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x413a04
test bl, 4
je 0x4139d7
mov edi, dword [ebp - 0x208]
xor ebx, 4
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
push edi
call fcn.0047228e
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x413a04
test bl, 1
je 0x41395b
xor ebx, 1
push ebx
mov ebx, dword [ebp - 0x208]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
push ebx
call fcn.0047228e
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x41395b
xor ebx, ebx
push ebx
push 4
push ebx
push edi
call fcn.004725be
add esp, 0x10
test eax, eax
je 0x413a4c
mov eax, dword [0x4d7258]
inc eax
mov dword [0x4d7258], eax
cmp eax, 0xa
jge 0x413a4c
push str._GetLastError_
push esi
push dword [ebp - 0x208]
lea eax, [ebp - 0x204]
push str.:2:fopen_wrapper___s_____s___EAP:_setvbuf__IONBF__FAILED:__s
push 0x200
push eax
call fcn.0045285b
add esp, 0x18
mov esi, ebx
cmp dword [0x4d6258], ebx
je 0x413a68
cmp esi, 0xff
jge 0x413ad1
inc esi
cmp dword [esi*4 + 0x4d6258], ebx
jne 0x413a56
mov ebx, dword [ebp - 0x210]
mov dword [esi*4 + 0x4d6258], edi
call fcn.004609ba
push dword [ebp - 0x208]
mov dword [esi*4 + 0x4d6658], eax
call fcn.00470560
pop ecx
push 1
push dword [ebp - 0x218]
mov dword [ebp - 0x210], eax
call fcn.00470560
pop ecx
mov ecx, dword [ebp - 0x210]
add ecx, 0xa
add ecx, eax
push ecx
call fcn.004701d4
mov dword [esi*4 + 0x4d5d58], eax
pop ecx
pop ecx
test eax, eax
jne 0x413b7a
and dword [esi*4 + 0x4d6258], eax
mov eax, edi
jmp 0x41395d
mov edx, ebx
mov ecx, ebx
or ebx, 0xffffffff
mov eax, dword [ecx*4 + 0x4d6658]
mov esi, ecx
cmp eax, ebx
inc ecx
cmovae esi, edx
cmp eax, ebx
mov edx, esi
cmovae eax, ebx
mov ebx, eax
cmp ecx, 0x100
jl 0x413ad8
mov eax, dword [0x4d725c]
mov ecx, esi
mov ebx, dword [ebp - 0x210]
inc eax
shl ecx, 2
mov dword [0x4d725c], eax
mov dword [ebp - 0x20c], ecx
cmp eax, 0xa
jge 0x413b46
push dword [ecx + 0x4d5d58]
lea eax, [ebp - 0x204]
push ebx
push dword [ebp - 0x208]
push str.:8:fopen_wrapper___s_____s___EAP:_the_register_is_full__This_indicates_an_fopen_fclose_leak__The_oldest_entry___s__has_been_deleted.
push 0x200
push eax
call fcn.0045285b
mov ecx, esi
add esp, 0x18
shl ecx, 2
jmp 0x413b4c
mov dword [ebp - 0x20c], ecx
and dword [ecx + 0x4d6258], 0
mov eax, dword [ecx + 0x4d5d58]
test eax, eax
je 0x413a6e
push eax
call fcn.004701df
mov eax, dword [ebp - 0x20c]
pop ecx
and dword [eax + 0x4d5d58], 0
jmp 0x413a6e
push dword [ebp - 0x208]
push eax
call fcn.00470240
pop ecx
pop ecx
cmp esi, 0x100
jae 0x413ca4
push str.rwbt
push ebx
mov byte [esi + 0x4d6158], 0
call fcn.004529d5
pop ecx
pop ecx
test eax, eax
je 0x413bb3
or byte [esi + 0x4d6158], 1
push 0x49280c
push ebx
call fcn.004529d5
pop ecx
pop ecx
test eax, eax
je 0x413bcb
or byte [esi + 0x4d6158], 2
push 0x492810
push ebx
call fcn.004529d5
pop ecx
pop ecx
test eax, eax
je 0x413be3
or byte [esi + 0x4d6158], 4
push 0x492814
push ebx
call fcn.004529d5
pop ecx
pop ecx
test eax, eax
je 0x413bfb
or byte [esi + 0x4d6158], 8
push 0x48b258
push ebx
call fcn.004529d5
pop ecx
pop ecx
test eax, eax
je 0x413c13
or byte [esi + 0x4d6158], 0x10
push 0x492818
push ebx
call fcn.004529d5
pop ecx
pop ecx
test eax, eax
je 0x413c2b
or byte [esi + 0x4d6158], 0x20
mov ecx, dword [ebp - 0x210]
mov eax, dword [esi*4 + 0x4d5d58]
inc ecx
push dword [ebp - 0x218]
add eax, ecx
push eax
mov dword [esi*4 + 0x4d6a58], eax
call fcn.00470240
mov eax, dword [ebp + 0x14]
mov dword [esi*4 + 0x4d6e58], eax
lea eax, [ebp - 0x204]
push eax
call fcn.00451684
add esp, 0xc
test eax, eax
jne 0x413aca
cmp dword [0x4d7260], eax
jne 0x413aca
lea eax, [ebp - 0x204]
mov dword [0x4d7260], 1
push eax
push 0x48ac00
call fcn.0040d9e1
and dword [0x4d7260], 0
pop ecx
pop ecx
jmp 0x413aca
call fcn.0046565b
int3