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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
mov eax, dword [0x492840]
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.0043dc10
push ebx
call fcn.0042da83
add esp, 0x10
test eax, eax
jne 0x40e81c
push esi
call fcn.0042da83
pop ecx
test eax, eax
jne 0x40e81c
test edi, edi
mov eax, 0x461d27
push 0x200
cmovne eax, edi
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x204]
push 0
push eax
call fcn.0043dc10
push ebx
call fcn.004476a0
add esp, 0x10
cmp eax, 0x104
jb 0x40e82d
push ebx
call fcn.0042ca0e
mov edi, eax
push esi
mov dword [ebp - 0x214], edi
call fcn.0042ca9f
mov dword [ebp - 0x20c], eax
pop ecx
pop ecx
test edi, edi
je 0x40e811
test eax, eax
je 0x40e80e
push eax
push edi
call fcn.004493c7
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40e7f3
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40e7f3
test bl, 2
je 0x40e7a3
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.004493c7
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40e7f3
test bl, 4
je 0x40e7cd
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.004493c7
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40e7f3
test bl, 1
je 0x40e7f3
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.004493c7
pop ecx
pop ecx
mov edi, eax
push dword [ebp - 0x214]
call fcn.0044731f
push dword [ebp - 0x20c]
call fcn.0044731f
jmp 0x40e8bb
push edi
jmp 0x40e816
test eax, eax
je 0x40e81c
push eax
call fcn.0044731f
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043c5ec
leave
ret
push esi
push ebx
call fcn.004493de
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40e8c5
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40e81c
test bl, 2
je 0x40e873
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.004493de
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40e8c5
test bl, 4
je 0x40e898
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.004493de
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40e8c5
test bl, 1
je 0x40e81c
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.004493de
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x40e81c
xor ebx, ebx
push ebx
push 4
push ebx
push edi
call fcn.0044970e
add esp, 0x10
test eax, eax
je 0x40e90d
mov eax, dword [0x49d668]
inc eax
mov dword [0x49d668], eax
cmp eax, 0xa
jge 0x40e90d
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.0042eb84
add esp, 0x18
mov esi, ebx
cmp dword [0x49c668], ebx
je 0x40e929
cmp esi, 0xff
jge 0x40e992
inc esi
cmp dword [esi*4 + 0x49c668], ebx
jne 0x40e917
mov ebx, dword [ebp - 0x210]
mov dword [esi*4 + 0x49c668], edi
call fcn.00438ea7
push dword [ebp - 0x208]
mov dword [esi*4 + 0x49ca68], eax
call fcn.004476a0
pop ecx
push 1
push dword [ebp - 0x218]
mov dword [ebp - 0x210], eax
call fcn.004476a0
pop ecx
mov ecx, dword [ebp - 0x210]
add ecx, 0xa
add ecx, eax
push ecx
call fcn.00447314
mov dword [esi*4 + 0x49c168], eax
pop ecx
pop ecx
test eax, eax
jne 0x40ea3b
and dword [esi*4 + 0x49c668], eax
mov eax, edi
jmp 0x40e81e
mov edx, ebx
mov ecx, ebx
or ebx, 0xffffffff
mov eax, dword [ecx*4 + 0x49ca68]
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 0x40e999
mov eax, dword [0x49d66c]
mov ecx, esi
mov ebx, dword [ebp - 0x210]
inc eax
shl ecx, 2
mov dword [0x49d66c], eax
mov dword [ebp - 0x20c], ecx
cmp eax, 0xa
jge 0x40ea07
push dword [ecx + 0x49c168]
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.0042eb84
mov ecx, esi
add esp, 0x18
shl ecx, 2
jmp 0x40ea0d
mov dword [ebp - 0x20c], ecx
and dword [ecx + 0x49c668], 0
mov eax, dword [ecx + 0x49c168]
test eax, eax
je 0x40e92f
push eax
call fcn.0044731f
mov eax, dword [ebp - 0x20c]
pop ecx
and dword [eax + 0x49c168], 0
jmp 0x40e92f
push dword [ebp - 0x208]
push eax
call fcn.00447380
pop ecx
pop ecx
cmp esi, 0x100
jae 0x40eb65
push str.rwbt
push ebx
mov byte [esi + 0x49c568], 0
call fcn.0042ecfe
pop ecx
pop ecx
test eax, eax
je 0x40ea74
or byte [esi + 0x49c568], 1
push 0x46782c
push ebx
call fcn.0042ecfe
pop ecx
pop ecx
test eax, eax
je 0x40ea8c
or byte [esi + 0x49c568], 2
push 0x467830
push ebx
call fcn.0042ecfe
pop ecx
pop ecx
test eax, eax
je 0x40eaa4
or byte [esi + 0x49c568], 4
push 0x467834
push ebx
call fcn.0042ecfe
pop ecx
pop ecx
test eax, eax
je 0x40eabc
or byte [esi + 0x49c568], 8
push 0x461d30
push ebx
call fcn.0042ecfe
pop ecx
pop ecx
test eax, eax
je 0x40ead4
or byte [esi + 0x49c568], 0x10
push 0x467838
push ebx
call fcn.0042ecfe
pop ecx
pop ecx
test eax, eax
je 0x40eaec
or byte [esi + 0x49c568], 0x20
mov ecx, dword [ebp - 0x210]
mov eax, dword [esi*4 + 0x49c168]
inc ecx
push dword [ebp - 0x218]
add eax, ecx
push eax
mov dword [esi*4 + 0x49ce68], eax
call fcn.00447380
mov eax, dword [ebp + 0x14]
mov dword [esi*4 + 0x49d268], eax
lea eax, [ebp - 0x204]
push eax
call fcn.0042da83
add esp, 0xc
test eax, eax
jne 0x40e98b
cmp dword [0x49d670], eax
jne 0x40e98b
lea eax, [ebp - 0x204]
mov dword [0x49d670], 1
push eax
push 0x461720
call fcn.0040953d
and dword [0x49d670], 0
pop ecx
pop ecx
jmp 0x40e98b
call fcn.0043c79b
int3