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

Disassembly:
sub esp, 0x24
mov eax, dword [0x41f0bc]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0xffffffff
mov byte [eax], 0
mov ebx, 0x7f7f
mov eax, dword [0x41f0d8]
mov ecx, dword [0x41f100]
inc eax
cmp eax, ecx
mov dword [0x41f0d8], eax
jae 0x40a145
mov ebp, dword [0x41f0d4]
push ebp
call fcn.00403b10
mov dword [0x41f0d4], eax
xor eax, eax
mov ax, word [ebp + 4]
push ebp
mov dword [esp + 0x20], eax
mov word [ebp + 4], 0
call fcn.00409230
mov ecx, dword [0x41f0c0]
mov dword [esp + 0x28], eax
add esp, 8
cmp byte [ecx], 0
je 0x409a64
test byte [esp + 0x18], 2
je 0x409b5b
mov edx, dword [0x41f0b8]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x409ac7
mov ecx, dword [0x41f0c0]
mov edx, dword [0x41f0b4]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x409add
mov ecx, dword [0x41f0b4]
push 0x5c
push ecx
call fcn.004130f0
add esp, 8
test eax, eax
je 0x409b00
mov byte [eax + 1], 0
mov edx, dword [0x41f248]
test byte [edx], 0x10
je 0x409b5b
mov eax, dword [0x41f0c0]
push 0
push eax
call fcn.00401140
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
je 0x409b52
push 0xfffffffffffffff8
push esi
call fcn.004012a0
lea ecx, [esp + 0x34]
push 8
push ecx
push esi
call fcn.004011c0
push esi
call fcn.004013c0
add esp, 0x18
cmp word [esp + 0x2c], bx
jne 0x409b52
test byte [esp + 0x2e], 2
jne 0x409a64
mov edx, dword [0x41f0b8]
mov byte [edx], 0x30
mov eax, dword [0x41f0d8]
xor edx, edx
lea eax, [eax + eax*4 + 5]
lea eax, [eax + eax*4]
shl eax, 2
div dword [0x41f100]
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 8]
test ah, 1
jne 0x40a116
test dword [0x41f2e0], eax
je 0x40a116
test ah, 2
jne 0x409d15
test al, 0x40
mov edi, 1
je 0x409bb2
mov eax, dword [0x41f0c0]
push eax
call fcn.00401100
add esp, 4
test eax, eax
jne 0x409c11
mov eax, dword [esp + 0x20]
test eax, eax
je 0x409c13
mov ecx, dword [0x41f0c0]
push 0
push ecx
mov dword [esp + 0x24], 0
call fcn.00401140
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
je 0x409c06
push esi
call fcn.004012c0
mov ecx, dword [ebp + 0x18]
add esp, 4
cmp eax, ecx
jne 0x409bfd
lea edx, [esp + 0x24]
lea eax, [esp + 0x1c]
push edx
push eax
push esi
call fcn.00405500
add esp, 0xc
push esi
call fcn.004013c0
add esp, 4
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 0x14]
cmp ecx, eax
jne 0x409c13
xor edi, edi
test edi, edi
mov dword [0x41f354], 0
je 0x409d29
mov eax, dword [0x41f24c]
test eax, eax
je 0x409a64
push 2
push 5
call fcn.00403a00
add esp, 8
test eax, eax
je 0x409c55
cmp byte [eax], 0
je 0x409c55
mov eax, dword [0x41f0c0]
push eax
call fcn.00401f80
add esp, 4
mov ecx, dword [0x41f0c0]
push ecx
call fcn.004023b0
mov ecx, dword [0x41f0c0]
mov edx, dword [0x41f0bc]
add esp, 4
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x409c70
mov edx, dword [0x41f0bc]
push str..__A
push edx
call fcn.004020a0
mov eax, dword [0x41f0bc]
push 0
push eax
call fcn.00401140
add esp, 0x10
cmp eax, 0xffffffff
je 0x409ce0
push eax
call fcn.004013c0
mov esi, dword [0x41f0bc]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, esi
push eax
mov dl, byte [ecx + esi - 1]
or ecx, 0xffffffff
inc dl
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [ecx + esi - 1], dl
mov eax, dword [0x41f0bc]
push eax
call fcn.00401140
add esp, 0xc
cmp eax, 0xffffffff
jne 0x409ca0
mov ecx, dword [0x41f0bc]
push ecx
call fcn.00401190
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
mov dword [esp + 0x10], ebx
jne 0x409d38
mov edx, dword [0x41f0bc]
mov dword [0x41f354], 0x11
push edx
call fcn.00407050
jmp 0x40a12c
mov edx, dword [0x41f0c0]
push edx
call fcn.004023b0
add esp, 4
jmp 0x40a116
mov ebx, dword [esp + 0x10]
mov word [ebp + 4], 0x1f5
jmp 0x40a058
test byte [esp + 0x18], 2
je 0x409e3a
mov ecx, dword [0x41f254]
test ecx, ecx
je 0x409f10
mov eax, dword [0x41f250]
test eax, eax
je 0x409f10
push eax
push ecx
push ebx
call fcn.00401200
add esp, 0xc
mov dword [0x41f354], eax
test eax, eax
jne 0x40a12f
mov eax, dword [ebp + 0x1c]
push eax
call fcn.00407260
add esp, 4
mov dword [0x41f354], eax
test eax, eax
jne 0x40a12f
mov ecx, dword [0x41a2e8]
lea edx, [ecx - 0x738580]
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xfffffffe
cmp ecx, 0x14
jl 0x409db2
cmp byte [ecx + edx], 0x9a
je 0x409dc5
mov edx, dword [0x41f324]
push 0
push 0x64
push 0xb
push edx
call dword [sym.imp.USER32.dll_SetTimer]
mov eax, dword [ebp + 0x20]
mov ecx, dword [0x41a2bc]
push 0
push 0
push eax
push ecx
push ebx
call fcn.00403500
mov esi, eax
mov eax, dword [0x41f2d0]
add esp, 0x14
test esi, esi
je 0x409e1c
cmp eax, 2
je 0x40a12f
push 0
push ebp
call fcn.00403e30
add esp, 8
push eax
push 0
push ebp
call fcn.00403e30
add esp, 8
push eax
push esi
call fcn.00407400
add esp, 0xc
mov dword [0x41f354], eax
jmp 0x40a12f
cmp eax, 2
je 0x40a12f
push ebx
call fcn.004013c0
add esp, 4
or ebx, 0xffffffff
mov dword [esp + 0x10], ebx
jmp 0x409f10
mov edx, dword [ebp + 0x1c]
push edx
call fcn.00407260
add esp, 4
mov dword [0x41f354], eax
test eax, eax
jne 0x40a12f
mov eax, dword [0x41a2bc]
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [ebp + 0x20]
lea edx, [esp + 0x20]
push edx
push ecx
push eax
push ebx
call fcn.00403500
mov esi, eax
mov eax, dword [0x41f2d0]
add esp, 0x14
test esi, esi
je 0x409eaf
cmp eax, 2
je 0x40a12f
push 0
push ebp
call fcn.00403e30
add esp, 8
push eax
push 0
push ebp
call fcn.00403e30
add esp, 8
push eax
push esi
call fcn.00407400
add esp, 0xc
mov dword [0x41f354], eax
jmp 0x40a12f
cmp eax, 2
je 0x40a12f
mov eax, dword [ebp + 8]
test al, 8
je 0x409ed9
test al, 6
lea eax, [ebp + 0x3c]
jne 0x409ec9
lea eax, [ebp + 0x28]
lea edx, [eax + 0x10]
lea ecx, [eax + 8]
push edx
push ecx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebx
call fcn.004013c0
mov edx, dword [esp + 0x20]
mov eax, dword [ebp + 0x18]
add esp, 4
or ebx, 0xffffffff
cmp edx, eax
mov dword [esp + 0x10], ebx
jne 0x409eff
mov eax, dword [esp + 0x24]
mov ecx, dword [ebp + 0x14]
cmp eax, ecx
je 0x409f10
call fcn.00409910
test eax, eax
je 0x40a145
mov ebx, dword [esp + 0x10]
cmp dword [ebp + 0x10], 3
jne 0x409f4e
mov ecx, dword [0x41f0c0]
push 0
push ecx
call fcn.00401140
add esp, 8
cmp eax, 0xffffffff
je 0x409f4e
push eax
call fcn.004013c0
mov edx, dword [0x41f0c0]
push edx
call fcn.00402b70
mov eax, dword [0x41f0c0]
push eax
call fcn.004013d0
add esp, 0xc
jmp 0x409f52
mov eax, dword [esp + 0x20]
cmp dword [ebp + 0x10], 2
je 0x40a024
mov ecx, dword [ebp + 8]
test ch, 0x10
jne 0x40a024
test eax, eax
je 0x409fa0
mov ecx, dword [0x41f0bc]
mov edx, dword [0x41f0c0]
push ecx
push edx
call fcn.0040b4d0
add esp, 8
test eax, eax
je 0x409f98
mov dword [0x41f34c], 1
mov word [ebp + 4], 0x1f4
jmp 0x409faf
mov word [ebp + 4], 0x1b
jmp 0x409faf
mov eax, dword [0x41f0bc]
push eax
push ebp
call fcn.00409500
add esp, 8
mov cx, word [ebp + 4]
cmp cx, 0x1b
jne 0x409fd4
mov ecx, dword [0x41f0c0]
mov dword [0x41f354], 0x16
push ecx
call fcn.00407050
jmp 0x40a12c
mov eax, dword [ebp + 0xc]
mov edi, 0x80
test ah, 0x10
je 0x409fe6
mov edi, 0x81
test ah, 8
je 0x409fee
or edi, 2
cmp edi, 0x80
je 0x40a058
mov esi, dword [0x41f0c0]
cmp cx, 0x1f4
jne 0x40a009
mov esi, dword [0x41f0bc]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40a058
and ah, 0xe7
or eax, edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
jmp 0x40a058
mov edi, dword [0x41f0bc]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
inc ecx
push ecx
call fcn.00413240
mov dword [ebp + 0x24], eax
mov ecx, dword [0x41f0bc]
add esp, 4
mov edx, eax
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x40a048
mov word [ebp + 4], 0x1f6
mov eax, dword [0x41f354]
test eax, eax
jne 0x40a12f
mov edx, dword [0x41f0bc]
mov al, byte [esp + 0x18]
test al, 2
mov byte [edx], 0
je 0x40a07c
mov word [ebp + 4], 0
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40a0ac
mov eax, dword [ebp + 8]
test ah, 4
je 0x40a0ac
mov ax, word [ebp + 4]
cmp ax, 0x17
je 0x40a0a7
cmp ax, 0x19
je 0x40a0a7
cmp ax, 0x1f5
je 0x40a0a7
cmp ax, 0x1f4
jne 0x40a0ac
call fcn.00409990
cmp dword [ebp + 0x10], 3
jne 0x40a0d0
mov ax, word [ebp + 4]
cmp ax, 0x17
je 0x40a0c2
cmp ax, 0x19
jne 0x40a0d0
mov eax, dword [0x41f0c0]
push eax
call fcn.00402860
add esp, 4
mov eax, dword [ebp + 8]
test ah, 0x10
je 0x40a108
mov eax, dword [0x41f284]
test eax, eax
je 0x40a0e9
cmp word [ebp + 4], 0x1f5
je 0x40a0ff
mov ax, word [ebp + 4]
cmp ax, 0x17
je 0x40a0ff
cmp ax, 0x19
je 0x40a0ff
cmp ax, 0x1f4
jne 0x40a108
push ebp
call fcn.00408620
add esp, 4
mov eax, dword [ebp + 8]
test ah, 8
je 0x40a116
mov dword [0x41f0e8], ebp
mov ecx, dword [esp + 0x28]
push ecx
call fcn.00401f00
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x18], 1
add esp, 4
cmp ebx, 0xffffffff
je 0x40a13d
push ebx
call fcn.004013c0
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x40a158
mov eax, dword [0x41f0bc]
cmp byte [eax], 0
je 0x40a158
push eax
call fcn.00413cf1
add esp, 4
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret