Function at 0x404020
Capabilities:
Check if file exists
Create directory
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x511ff0
mov eax, dword fs:[0]
push eax
sub esp, 0x74
mov eax, dword [0x5428f8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
push eax
lea eax, [ebp - 0x40]
push eax
call fcn.00403020
add esp, 8
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 4], 0
test ecx, ecx
je 0x40408d
cmp dword [ebp - 0x2c], 0x10
lea eax, [ebp - 0x40]
cmovae eax, dword [ebp - 0x40]
cmp byte [ecx + eax - 1], 0x2f
je 0x40408d
push 1
push 0x515648
lea ecx, [ebp - 0x40]
call fcn.00404be0
mov ecx, dword [ebp - 0x30]
mov edi, 0xf
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], edi
mov byte [ebp - 0x28], 0
cmp dword [ebp - 0x2c], 0x10
lea esi, [ebp - 0x40]
mov ebx, dword [ebp - 0x28]
cmovae esi, dword [ebp - 0x40]
mov byte [ebp - 4], 1
cmp dword [ebp - 0x2c], 0x10
lea eax, [ebp - 0x40]
cmovae eax, dword [ebp - 0x40]
add eax, ecx
cmp esi, eax
je 0x40447e
mov ecx, dword [ebp - 0x18]
mov dl, byte [esi]
mov byte [ebp - 0x71], dl
mov dword [ebp - 0x80], ecx
cmp ecx, edi
jae 0x4040f8
lea eax, [ecx + 1]
cmp edi, 0x10
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x28]
cmovae eax, ebx
mov byte [eax + ecx], dl
mov byte [eax + ecx + 1], 0
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x28]
jmp 0x404212
mov eax, accept
sub eax, ecx
cmp eax, 1
jb 0x404500
mov eax, edi
lea edi, [ecx + 1]
or edi, 0xf
mov dword [ebp - 0x7c], eax
cmp edi, 0x7fffffff
jbe 0x404122
mov edi, accept
jmp 0x404143
mov edx, eax
mov eax, accept
shr edx, 1
sub eax, edx
cmp dword [ebp - 0x7c], eax
jbe 0x404139
mov edi, accept
jmp 0x404143
mov eax, dword [ebp - 0x7c]
add eax, edx
cmp edi, eax
cmovb edi, eax
lea edx, [edi + 1]
cmp edx, 0x1000
jb 0x40417c
lea eax, [edx + 0x23]
mov ecx, 0xffffffff
cmp eax, edx
cmovbe eax, ecx
push eax
call fcn.0049bb0b
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x4044fb
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
mov ecx, dword [ebp - 0x80]
jmp 0x404190
test edx, edx
je 0x40418e
push edx
call fcn.0049bb0b
mov ecx, dword [ebp - 0x80]
add esp, 4
jmp 0x404190
xor eax, eax
cmp dword [ebp - 0x7c], 0x10
lea edx, [ecx + 1]
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], edi
push ecx
jb 0x4041ef
push ebx
push eax
call fcn.004bc760
mov eax, dword [ebp - 0x78]
add esp, 0xc
mov ecx, dword [ebp - 0x80]
mov dl, byte [ebp - 0x71]
mov byte [ecx + eax], dl
mov byte [ecx + eax + 1], 0
mov eax, ebx
mov ecx, dword [ebp - 0x7c]
inc ecx
cmp ecx, 0x1000
jb 0x4041e0
mov ebx, dword [ebx - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push ecx
push ebx
call fcn.0049bb3b
mov ebx, dword [ebp - 0x78]
add esp, 8
jmp 0x40420f
lea ecx, [ebp - 0x28]
push ecx
push eax
call fcn.004bc760
mov eax, dword [ebp - 0x78]
add esp, 0xc
mov ecx, dword [ebp - 0x80]
mov ebx, eax
mov dl, byte [ebp - 0x71]
mov byte [ecx + eax], dl
mov byte [ecx + eax + 1], 0
mov dword [ebp - 0x28], ebx
cmp byte [esi], 0x2f
je 0x40422f
cmp dword [ebp - 0x2c], 0x10
lea eax, [ebp - 0x40]
mov ecx, dword [ebp - 0x30]
cmovae eax, dword [ebp - 0x40]
add eax, ecx
cmp esi, eax
jne 0x404438
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x70]
push eax
call fcn.00403020
add esp, 8
cmp dword [ebp - 0x60], 0
mov byte [ebp - 4], 2
jne 0x404288
mov edx, dword [ebp - 0x5c]
mov byte [ebp - 4], 1
cmp edx, 0x10
jb 0x404281
mov ecx, dword [ebp - 0x70]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x404277
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push edx
push ecx
call fcn.0049bb3b
add esp, 8
xor bl, bl
jmp 0x404349
lea eax, [ebp - 0x70]
xor bl, bl
push eax
lea eax, [ebp - 0x58]
push 0xfde9
push eax
call fcn.00404510
add esp, 0xc
lea eax, [ebp - 0x58]
cmp dword [ebp - 0x44], 8
cmovae eax, dword [ebp - 0x58]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4042c3
test al, 0x10
movzx ebx, bl
mov eax, 1
cmovne ebx, eax
mov edx, dword [ebp - 0x44]
cmp edx, 8
jb 0x4042fd
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4042f3
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push edx
push ecx
call fcn.0049bb3b
add esp, 8
mov edx, dword [ebp - 0x5c]
xor eax, eax
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov byte [ebp - 4], 1
cmp edx, 0x10
jb 0x404349
mov ecx, dword [ebp - 0x70]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40433f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push edx
push ecx
call fcn.0049bb3b
add esp, 8
test bl, bl
jne 0x40442f
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x70]
push eax
call fcn.00403020
add esp, 8
cmp dword [ebp - 0x60], 0
mov byte [ebp - 4], 3
je 0x40443e
lea eax, [ebp - 0x70]
mov byte [ebp - 0x71], 1
push eax
lea eax, [ebp - 0x58]
push 0xfde9
push eax
call fcn.00404510
add esp, 0xc
lea eax, [ebp - 0x58]
cmp dword [ebp - 0x44], 8
cmovae eax, dword [ebp - 0x58]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edx, dword [ebp - 0x44]
mov ebx, eax
neg ebx
sbb bl, bl
and bl, byte [ebp - 0x71]
cmp edx, 8
jb 0x4043df
mov ecx, dword [ebp - 0x58]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4043d5
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push edx
push ecx
call fcn.0049bb3b
add esp, 8
mov edx, dword [ebp - 0x5c]
xor eax, eax
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 7
mov word [ebp - 0x58], ax
mov byte [ebp - 4], 1
cmp edx, 0x10
jb 0x40442b
mov ecx, dword [ebp - 0x70]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x404421
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push edx
push ecx
call fcn.0049bb3b
add esp, 8
test bl, bl
je 0x404472
mov ecx, dword [ebp - 0x30]
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x28]
inc esi
jmp 0x4040b2
mov edx, dword [ebp - 0x5c]
cmp edx, 0x10
jb 0x404472
mov ecx, dword [ebp - 0x70]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x404468
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4044fb
push edx
push ecx
call fcn.0049bb3b
add esp, 8
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x28]
mov byte [ebp - 0x71], 0
jmp 0x404482
mov byte [ebp - 0x71], 1
cmp edi, 0x10
jb 0x4044ac
inc edi
mov eax, ebx
cmp edi, 0x1000
jb 0x4044a2
mov ebx, dword [ebx - 4]
add edi, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x404505
push edi
push ebx
call fcn.0049bb3b
add esp, 8
mov edx, dword [ebp - 0x2c]
cmp edx, 0x10
jb 0x4044dc
mov ecx, dword [ebp - 0x40]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4044d2
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40450a
push edx
push ecx
call fcn.0049bb3b
add esp, 8
mov al, byte [ebp - 0x71]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0049bafa
mov esp, ebp
pop ebp
ret
call fcn.004d8b57
call fcn.00404980
call fcn.004d8b57
call fcn.004d8b57
int3