Function at 0x409540
Capabilities:
Check if file exists
Get file attributes

Disassembly:
sub esp, 0x18
mov eax, dword [0x809d38]
push ebx
push esi
xor ebx, ebx
push edi
push ebx
push ebx
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], eax
call fcn.005dcfa0
mov edx, dword [esp + 0xc]
mov cl, byte [0x83ec0c]
push ebx
push ebx
mov byte [edx], cl
mov eax, dword [0x809d38]
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], eax
call fcn.005dcfa0
mov ecx, dword [esp + 0x10]
mov dl, byte [0x83ec0c]
lea eax, [esp + 0x10]
push eax
mov byte [ecx], dl
call fcn.0040a7c0
add esp, 4
lea ecx, [esp + 0x14]
mov esi, 1
push ebx
push ebx
call fcn.004025a0
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov eax, esi
lea ecx, [esp + 0xc]
push eax
push str.input_.2d.cfg
push ecx
inc esi
call fcn.005dd5a0
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
add esp, 0xc
lea ecx, [esp + 0x14]
push edx
push eax
push 0x7f548c
push ecx
call fcn.005dd5a0
mov edx, dword [esp + 0x24]
add esp, 0x10
push edx
call edi
cmp eax, 0xffffffff
jne 0x4095ab
lea ecx, [esp + 0x14]
call fcn.005dd410
lea ecx, [esp + 0x10]
call fcn.005dd410
mov eax, dword [0x809d3c]
push ebx
push ebx
lea ecx, [esp + 0x20]
mov dword [esp + 0x20], eax
call fcn.005dd7a0
mov ecx, dword [esp + 0x18]
mov dx, word [0x83f43c]
push ebx
push ebx
mov word [ecx], dx
lea ecx, [esp + 0x24]
call fcn.004025a0
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x18]
push eax
mov byte [esp + 0x24], bl
mov byte [esp + 0x25], bl
call fcn.00409430
mov edi, dword [esp + 0xc]
cmp edi, ebx
mov esi, edi
je 0x409681
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ebp
mov edi, ecx
lea ecx, [esp + 0x20]
lea ebp, [edi + 1]
push ebp
call fcn.005dd330
push edi
lea ecx, [esp + 0x24]
call fcn.004029d0
mov edi, dword [esp + 0x20]
mov ecx, ebp
mov edx, ecx
pop ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x81c710]
mov ecx, dword [0x81c718]
cmp ecx, eax
mov byte [esp + 0x21], 1
jl 0x4096c6
cmp byte [0x81c715], bl
jne 0x4096a1
cmp eax, ebx
jne 0x4096c0
mov ecx, dword [0x81c71c]
cmp ecx, ebx
jle 0x4096c0
add ecx, eax
mov eax, dword [0x81c708]
push ebx
push ecx
mov ecx, 0x81c708
call dword [eax + 8]
test al, al
jne 0x4096c6
mov byte [esp + 0x28], bl
jmp 0x4096ef
mov ecx, dword [0x81c718]
mov eax, ecx
inc ecx
mov dword [0x81c718], ecx
lea ecx, [esp + 0x18]
lea edx, [eax + eax*2]
mov eax, dword [0x81c70c]
push ecx
lea ecx, [eax + edx*4]
call fcn.00408b50
mov byte [esp + 0x28], 1
mov ecx, dword [esp + 0x28]
mov al, byte [esp + 0x21]
and ecx, 0xff
cmp al, bl
mov dword [0x7f546c], ecx
je 0x409744
mov edx, dword [esp + 0x1c]
push edx
call fcn.00409ae0
mov dword [0x7f546c], eax
mov eax, dword [esp + 0x20]
push eax
call fcn.00676460
mov eax, dword [0x7f546c]
add esp, 8
cmp eax, 0xffffffff
je 0x409785
lea edx, [eax + eax*2]
mov eax, dword [0x81c70c]
lea ecx, [esp + 0x18]
push ecx
lea ecx, [eax + edx*4]
call fcn.00408b50
jmp 0x409780
push ebx
push 0x262d
call fcn.00409840
add esp, 4
lea ecx, [esp + 0x2c]
push eax
call fcn.00402810
mov ecx, dword [esp + 0x18]
push ecx
lea ecx, [esp + 0x2c]
call fcn.004097b0
mov edx, dword [esp + 0x28]
push edx
call fcn.00409540
add esp, 4
lea ecx, [esp + 0x28]
call fcn.005dd990
mov eax, dword [0x7f546c]
lea ecx, [esp + 0x1c]
mov esi, eax
call fcn.005dd410
lea ecx, [esp + 0x18]
call fcn.005dd990
lea ecx, [esp + 0xc]
call fcn.005dd410
mov eax, esi
pop edi
pop esi
pop ebx
add esp, 0x18
ret