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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
mov eax, dword [0x4832e4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 0x1ff
lea eax, [ebp - 0x203]
mov edi, ecx
mov ebx, edx
push 0
push eax
mov dword [ebp - 0x210], edi
mov dword [ebp - 0x20c], ebx
mov dword [ebp - 0x218], esi
mov byte [ebp - 0x204], 0
call fcn.00401f80
add esp, 0xc
mov edx, edi
call fcn.00429ac3
test eax, eax
jne 0x45822e
mov edx, ebx
call fcn.00429ac3
test eax, eax
jne 0x45822e
test esi, esi
jne 0x458128
mov dword [ebp - 0x218], 0x46f6e7
push 0x200
lea eax, [ebp - 0x204]
push 0
push eax
call fcn.00401f80
push edi
call fcn.00401a80
add esp, 0x10
cmp eax, 0x104
jb 0x45823f
mov eax, edi
call fcn.00429c8e
push ebx
mov esi, eax
call fcn.0042830b
mov edi, eax
pop ecx
mov dword [ebp - 0x214], edi
test esi, esi
je 0x458223
test edi, edi
je 0x45821c
push edi
push esi
call fcn.00403cac
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
test eax, eax
jne 0x458206
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x458206
mov edi, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test bl, 2
je 0x4581c2
xor ebx, 2
push ebx
push esi
call edi
push dword [ebp - 0x214]
push esi
call fcn.00403cac
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
test eax, eax
jne 0x458206
test bl, 4
je 0x4581e6
xor ebx, 4
push ebx
push esi
call edi
push dword [ebp - 0x214]
push esi
call fcn.00403cac
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
test eax, eax
jne 0x458206
test bl, 1
je 0x458206
xor ebx, 1
push ebx
push esi
call edi
push dword [ebp - 0x214]
push esi
call fcn.00403cac
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
push esi
call fcn.00401a00
push dword [ebp - 0x214]
call fcn.00401a00
jmp 0x4582f2
push esi
call fcn.00401a00
pop ecx
test edi, edi
je 0x45822e
push edi
call fcn.00401a00
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401317
leave
ret
push ebx
push edi
call fcn.00403d7f
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
test eax, eax
jne 0x458301
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x45822e
mov edi, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test bl, 2
je 0x458298
xor ebx, 2
push ebx
push dword [ebp - 0x210]
call edi
push dword [ebp - 0x20c]
push dword [ebp - 0x210]
call fcn.00403d7f
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
test eax, eax
jne 0x458301
test bl, 4
je 0x4582c6
xor ebx, 4
push ebx
push dword [ebp - 0x210]
call edi
push dword [ebp - 0x20c]
push dword [ebp - 0x210]
call fcn.00403d7f
pop ecx
pop ecx
mov dword [ebp - 0x208], eax
test eax, eax
jne 0x458301
test bl, 1
je 0x45822e
xor ebx, 1
push ebx
push dword [ebp - 0x210]
call edi
push dword [ebp - 0x20c]
push dword [ebp - 0x210]
call fcn.00403d7f
mov dword [ebp - 0x208], eax
cmp dword [ebp - 0x208], 0
pop ecx
pop ecx
je 0x45822e
xor edi, edi
push edi
push 4
push edi
push dword [ebp - 0x208]
call fcn.00403d96
add esp, 0x10
test eax, eax
je 0x458352
inc dword [0x49b794]
cmp dword [0x49b794], 0xa
jge 0x458352
push str._GetLastError_
push dword [ebp - 0x20c]
lea eax, [ebp - 0x204]
push dword [ebp - 0x210]
push str.:2:fopen_wrapper___s_____s___EAP:_setvbuf__IONBF__FAILED:__s
push 0x200
push eax
call fcn.0042922b
add esp, 0x18
xor ebx, ebx
cmp dword [0x49be40], ebx
je 0x4583ea
cmp edi, 0xff
jge 0x458374
inc edi
cmp dword [edi*4 + 0x49be40], ebx
jne 0x458360
jmp 0x4583ea
xor edi, edi
or edx, 0xffffffff
xor eax, eax
mov ecx, dword [eax*4 + 0x49c240]
cmp ecx, edx
jae 0x45838a
mov edi, eax
mov edx, ecx
inc eax
cmp eax, 0x100
jl 0x45837b
inc dword [0x49b89c]
cmp dword [0x49b89c], 0xa
jge 0x4583cd
push dword [edi*4 + 0x49b940]
lea eax, [ebp - 0x204]
push dword [ebp - 0x20c]
push dword [ebp - 0x210]
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.0042922b
add esp, 0x18
lea esi, [edi*4 + 0x49b940]
mov eax, dword [esi]
mov dword [edi*4 + 0x49be40], ebx
cmp eax, ebx
je 0x4583ea
push eax
call fcn.00401a00
pop ecx
mov dword [esi], ebx
mov eax, dword [ebp - 0x208]
mov esi, edi
mov dword [esi*4 + 0x49be40], eax
call fcn.004182de
push dword [ebp - 0x210]
mov dword [esi*4 + 0x49c240], eax
call fcn.00401a80
pop ecx
push 1
push dword [ebp - 0x218]
mov ebx, eax
call fcn.00401a80
pop ecx
lea eax, [eax + ebx + 0xa]
push eax
call fcn.00401a3a
pop ecx
pop ecx
mov dword [esi*4 + 0x49b940], eax
test eax, eax
jne 0x45844a
and dword [esi*4 + 0x49be40], eax
mov eax, dword [ebp - 0x208]
jmp 0x458230
push dword [ebp - 0x210]
push eax
call fcn.00401ba0
push str.rwbt
push dword [ebp - 0x20c]
mov byte [edi + 0x49bd40], 0
call fcn.004294c0
add esp, 0x10
test eax, eax
je 0x45847b
mov byte [edi + 0x49bd40], 1
push 0x470c4c
push dword [ebp - 0x20c]
call fcn.004294c0
pop ecx
pop ecx
test eax, eax
je 0x458498
or byte [edi + 0x49bd40], 2
push 0x470c50
push dword [ebp - 0x20c]
call fcn.004294c0
pop ecx
pop ecx
test eax, eax
je 0x4584b5
or byte [edi + 0x49bd40], 4
push 0x470c54
push dword [ebp - 0x20c]
call fcn.004294c0
pop ecx
pop ecx
test eax, eax
je 0x4584d2
or byte [edi + 0x49bd40], 8
push 0x46f75c
push dword [ebp - 0x20c]
call fcn.004294c0
pop ecx
pop ecx
test eax, eax
je 0x4584ef
or byte [edi + 0x49bd40], 0x10
push 0x470c58
push dword [ebp - 0x20c]
call fcn.004294c0
pop ecx
pop ecx
test eax, eax
je 0x45850c
or byte [edi + 0x49bd40], 0x20
mov eax, dword [esi*4 + 0x49b940]
push dword [ebp - 0x218]
lea eax, [eax + ebx + 1]
push eax
mov dword [esi*4 + 0x49c640], eax
call fcn.00401ba0
mov eax, dword [ebp + 0xc]
pop ecx
pop ecx
lea edx, [ebp - 0x204]
mov dword [esi*4 + 0x49ca40], eax
call fcn.00429ac3
test eax, eax
jne 0x45843f
cmp dword [0x49b93c], eax
jne 0x45843f
and dword [0x49b93c], eax
jmp 0x45843f