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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43f7d8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 8]
push esi
push edi
call fcn.0040da90
add esp, 8
call fcn.0040d770
mov eax, dword [edi]
xor ebx, ebx
cmp dword [eax - 8], ebx
je 0x40da6b
push esi
lea ecx, [ebp + 0xc]
call fcn.00436750
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 4], ebx
mov eax, dword [ecx - 8]
cmp eax, 1
jl 0x40d899
mov al, byte [eax + ecx - 1]
cmp al, 0x5c
je 0x40d899
push 0x5c
lea ecx, [ebp + 0xc]
call fcn.00436e30
push 0x47a1cc
lea ecx, [ebp + 8]
push edi
push ecx
call fcn.00436c50
push eax
lea ecx, [ebp + 0xc]
mov byte [ebp - 4], 1
call fcn.00436e50
lea ecx, [ebp + 8]
mov byte [ebp - 4], bl
call fcn.004368f0
mov edi, 0x442c78
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x24], 0x11
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], 0xa
lea edx, [ebp - 0x2c]
lea eax, [ebp + 0xc]
push edx
push eax
mov byte [ebp - 4], 2
call fcn.0040e1e0
add esp, 8
test eax, eax
jne 0x40d92b
mov dword [ebp - 0x2c], edi
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 3
call fcn.0040e780
lea ecx, [ebp + 0xc]
mov dword [ebp - 4], 0xffffffff
call fcn.004368f0
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x10], ebx
je 0x40d975
lea ecx, [ebp + 0xc]
push str..custom
lea edx, [ebp + 8]
push ecx
push edx
call fcn.00436c50
mov eax, dword [ebp + 8]
mov byte [ebp - 4], 4
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40d969
test al, 0x10
jne 0x40d969
lea ecx, [ebp - 0x2c]
lea edx, [ebp + 8]
push ecx
push edx
call fcn.0040e1e0
add esp, 8
lea ecx, [ebp + 8]
mov byte [ebp - 4], 2
call fcn.004368f0
mov eax, dword [0x4804ec]
mov dword [ebp - 0x10], eax
mov esi, dword [ebp - 0x20]
mov byte [ebp - 4], 5
neg esi
sbb esi, esi
cmp esi, ebx
je 0x40d9f9
mov edi, dword [ebp - 0x24]
cmp esi, 0xffffffff
mov ecx, esi
jne 0x40d9ad
xor edx, edx
cmp edi, ebx
jbe 0x40d9ad
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax]
cmp ecx, ebx
jne 0x40d9ad
inc edx
add eax, 4
cmp edx, edi
jb 0x40d99f
mov esi, dword [ecx]
cmp esi, ebx
jne 0x40d9cf
mov eax, dword [ecx + 4]
inc eax
cmp eax, edi
jae 0x40d9cf
mov edx, dword [ebp - 0x28]
lea edx, [edx + eax*4]
mov esi, dword [edx]
cmp esi, ebx
jne 0x40d9cf
inc eax
add edx, 4
cmp eax, edi
jb 0x40d9c1
mov edi, dword [ecx + 8]
add ecx, 0xc
push ecx
lea ecx, [ebp - 0x10]
call fcn.00436a80
mov ecx, dword [0x484864]
lea eax, [ebp - 0x10]
push eax
lea ecx, [ecx + edi*4]
call fcn.00436a80
cmp esi, ebx
jne 0x40d98c
mov edi, 0x442c78
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 2
call fcn.004368f0
mov dword [ebp - 0x2c], edi
mov eax, dword [ebp - 0x28]
mov byte [ebp - 4], 6
cmp eax, ebx
je 0x40da3f
mov ecx, dword [ebp - 0x24]
xor edi, edi
cmp ecx, ebx
jbe 0x40da3f
mov esi, dword [eax + edi*4]
cmp esi, ebx
je 0x40da37
lea edx, [esi + 0xc]
push 1
push edx
call fcn.004307a0
mov esi, dword [esi]
cmp esi, ebx
jne 0x40da23
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
inc edi
cmp edi, ecx
jb 0x40da1c
push eax
call fcn.00437120
mov ecx, dword [ebp - 0x18]
add esp, 4
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
call fcn.00430bf0
lea ecx, [ebp + 0xc]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], 0xffffffff
call fcn.004368f0
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov eax, 1
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret