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

Disassembly:
push ebp
mov eax, dword [esp + 0xc]
mov ebp, esp
and eax, 7
sub esp, 0x108
cmp eax, 2
push ebx
push esi
push edi
jne 0x40b9a3
xor ebx, ebx
mov edi, dword [ebp + 8]
mov eax, dword [0x41799c]
mov cl, byte [edi]
lea esi, [edi + 1]
mov byte [eax], cl
mov ecx, esi
mov eax, dword [0x41799c]
cmp byte [eax], bl
je 0x40b758
inc dword [0x41799c]
mov al, byte [ecx]
mov edx, dword [0x41799c]
inc ecx
mov byte [edx], al
mov edx, dword [0x41799c]
cmp byte [edx], 0
jne 0x40b73c
mov eax, dword [0x4179a0]
push eax
call fcn.0040bf24
add esp, 4
test eax, eax
je 0x40b799
mov cl, byte [edi]
mov eax, dword [0x417994]
mov byte [eax], cl
mov eax, dword [0x417994]
cmp byte [eax], 0
je 0x40b7a7
inc dword [0x417994]
mov cl, byte [esi]
mov eax, dword [0x417994]
inc esi
mov byte [eax], cl
mov eax, dword [0x417994]
cmp byte [eax], 0
jne 0x40b77d
jmp 0x40b7a7
push 0x417994
push edi
call fcn.0040b5d1
add esp, 8
mov eax, dword [0x41799c]
sub eax, dword [0x4179a0]
cmp eax, 0x102
jle 0x40b7be
mov ebx, 1
mov eax, dword [0x417998]
push eax
call fcn.0040e930
add esp, 4
inc eax
push eax
call fcn.0040eb30
add esp, 4
mov esi, eax
mov eax, dword [0x417998]
push eax
push esi
call fcn.0040e9b0
add esp, 8
push esi
call fcn.004056e5
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x40b91e
cmp dword [0x417abc], 0
jne 0x40b838
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
push esi
call fcn.0040eb10
add esp, 4
mov eax, 2
jmp 0x40beea
test ebx, ebx
je 0x40b878
push 0x415fe0
call fcn.0040fd90
add esp, 4
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
push esi
call fcn.0040eb10
add esp, 4
mov eax, 4
jmp 0x40beea
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x40b8c1
push 0x415fe0
call fcn.0040fd90
add esp, 4
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
push esi
call fcn.0040eb10
add esp, 4
mov eax, 3
jmp 0x40beea
mov dword [0x4179ac], 1
mov eax, dword [0x417998]
push eax
push 0xaa
call fcn.00408bc9
add esp, 8
test ebx, ebx
je 0x40b95e
push 0x415fe0
call fcn.0040fd90
add esp, 4
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
push esi
call fcn.0040eb10
add esp, 4
mov eax, 4
jmp 0x40beea
test al, 0x10
jne 0x40b8de
push 0x415fe0
call fcn.0040fd90
add esp, 4
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
push esi
call fcn.0040eb10
add esp, 4
mov eax, 3
jmp 0x40beea
mov eax, dword [0x41799c]
mov byte [eax], 0x2f
mov ecx, dword [0x417994]
inc dword [0x41799c]
mov byte [ecx], 0x2f
inc dword [0x417994]
push esi
mov ecx, dword [0x417994]
mov byte [ecx], 0
mov ecx, dword [0x41799c]
mov eax, dword [0x417994]
mov dl, byte [eax]
mov byte [ecx], dl
call fcn.0040eb10
add esp, 4
xor eax, eax
jmp 0x40beea
cmp eax, 4
jne 0x40b9f0
mov eax, dword [0x417998]
push eax
push dword [ebp + 8]
call fcn.0040e9b0
add esp, 8
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
xor eax, eax
mov dword [0x417994], eax
mov dword [0x41799c], eax
mov dword [0x417998], eax
mov dword [0x4179a0], eax
jmp 0x40beea
cmp eax, 3
jne 0x40bacd
mov edi, dword [ebp + 8]
mov eax, dword [0x41799c]
mov cl, byte [edi]
lea esi, [edi + 1]
mov ebx, esi
mov byte [eax], cl
mov eax, dword [0x41799c]
mov dword [ebp - 4], 0
cmp byte [eax], 0
je 0x40ba6b
inc dword [0x41799c]
mov eax, dword [0x41799c]
sub eax, dword [0x4179a0]
cmp eax, 0x105
jl 0x40ba55
push 0x415fe0
dec dword [0x41799c]
mov eax, dword [0x41799c]
mov byte [eax], 0
call fcn.0040fd90
mov dword [ebp - 4], 1
add esp, 4
mov al, byte [ebx]
mov ecx, dword [0x41799c]
inc ebx
mov byte [ecx], al
mov ecx, dword [0x41799c]
cmp byte [ecx], 0
jne 0x40ba1b
mov eax, dword [0x4159c8]
test byte [eax + 0x28], 0x20
jne 0x40ba98
mov eax, dword [0x4179a0]
push eax
call fcn.0040bf24
add esp, 4
test eax, eax
jne 0x40ba98
push 0x417994
push edi
call fcn.0040b5d1
add esp, 8
jmp 0x40bac5
mov cl, byte [edi]
mov eax, dword [0x417994]
mov byte [eax], cl
mov eax, dword [0x417994]
cmp byte [eax], 0
je 0x40bac5
inc dword [0x417994]
mov cl, byte [esi]
mov eax, dword [0x417994]
inc esi
mov byte [eax], cl
mov eax, dword [0x417994]
cmp byte [eax], 0
jne 0x40baab
mov eax, dword [ebp - 4]
jmp 0x40beea
cmp eax, 1
jne 0x40bcda
mov eax, dword [0x4179a4]
add eax, dword [0x415aac]
inc eax
push eax
call fcn.0040eb30
add esp, 4
mov dword [0x4179a0], eax
test eax, eax
jne 0x40bafe
mov eax, 0xa
jmp 0x40beea
mov eax, dword [0x4179a4]
add eax, dword [0x415aac]
inc eax
push eax
call fcn.0040eb30
add esp, 4
mov dword [0x417998], eax
test eax, eax
jne 0x40bb34
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, 0xa
jmp 0x40beea
mov eax, dword [0x4159c8]
test byte [eax + 0x28], 0x20
je 0x40bc45
cmp dword [0x4179a8], 0
je 0x40bb74
mov edi, dword [ebp + 8]
cmp byte [edi + 1], 0x3a
jne 0x40bb6b
movsx eax, byte [edi]
push eax
call fcn.0040f010
add esp, 4
mov ecx, dword [0x4179a0]
mov byte [ecx], al
jmp 0x40bbe1
cmp dword [0x4179a8], 0
jne 0x40bb9e
cmp dword [0x417990], 0
je 0x40bb9e
mov eax, dword [0x417990]
cmp byte [eax + 1], 0x3a
jne 0x40bb9e
movsx ecx, byte [eax]
push ecx
call fcn.0040f010
add esp, 4
mov ecx, dword [0x4179a0]
mov byte [ecx], al
jmp 0x40bbe1
lea eax, [ebp - 4]
lea ecx, [ebp - 0x108]
push eax
mov esi, 0x104
push ecx
push esi
push 0x415ab0
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
cmp eax, esi
jbe 0x40bbc8
mov eax, 1
jmp 0x40beea
movsx eax, byte [ebp - 0x108]
sub eax, 0x60
mov dword [0x41798c], eax
lea ecx, [eax + 0x60]
mov eax, dword [0x4179a0]
mov byte [eax], cl
mov eax, dword [0x4179a0]
movsx eax, byte [eax]
sub eax, 0x60
cmp dword [0x41fca0], 0
mov dword [0x41798c], eax
je 0x40bc1f
mov eax, dword [0x4179a0]
cmp byte [eax], 0x61
jl 0x40bc1f
cmp dword [0x41fca0], 1
jne 0x40bc80
mov eax, dword [0x41798c]
push eax
call fcn.0040bef1
add esp, 4
test eax, eax
jne 0x40bc80
mov eax, dword [0x4179a0]
push eax
call fcn.0040eb10
add esp, 4
mov eax, dword [0x417998]
push eax
call fcn.0040eb10
add esp, 4
mov eax, 0x4e
jmp 0x40beea
cmp dword [0x4179a8], 0
je 0x40bc61
push dword [ebp + 8]
mov eax, dword [0x4179a0]
push eax
call fcn.0040e9b0
add esp, 8
jmp 0x40bc88
cmp dword [0x415aac], 0
jle 0x40bc80
mov eax, dword [0x417990]
push eax
push dword [0x4179a0]
call fcn.0040e9b0
add esp, 8
jmp 0x40bc88
mov eax, dword [0x4179a0]
mov byte [eax], 0
mov eax, dword [0x4179a0]
mov ecx, dword [0x417998]
mov dword [0x41799c], eax
mov dword [0x417994], ecx
mov dl, byte [eax]
mov byte [ecx], dl
mov ecx, dword [0x417994]
cmp byte [ecx], 0
je 0x40bcd3
inc dword [0x417994]
inc dword [0x41799c]
mov eax, dword [0x41799c]
mov edx, dword [0x417994]
mov cl, byte [eax]
mov byte [edx], cl
mov edx, dword [0x417994]
cmp byte [edx], 0
jne 0x40bcad
xor eax, eax
jmp 0x40beea
xor ecx, ecx
test eax, eax
jne 0x40bec5
mov edi, dword [ebp + 8]
cmp edi, ecx
jne 0x40bcf8
xor eax, eax
mov dword [0x415aac], ecx
jmp 0x40beea
push edi
call fcn.0040e930
add esp, 4
mov dword [0x415aac], eax
test eax, eax
jle 0x40bec1
xor ebx, ebx
xor esi, esi
mov dword [ebp - 4], 2
cmp dword [0x415f24], 1
jle 0x40bd35
movsx eax, byte [edi]
push 0x103
push eax
call fcn.0040f100
add esp, 8
jmp 0x40bd49
movsx ecx, byte [edi]
mov edx, dword [str.________________________________H]
xor eax, eax
mov ax, word [edx + ecx*2]
and eax, 0x103
test eax, eax
je 0x40bd58
cmp byte [edi + 1], 0x3a
jne 0x40bd58
mov esi, 1
mov eax, dword [0x415aac]
cmp byte [eax + edi - 1], 0x2f
jne 0x40bd78
mov ebx, 1
dec dword [0x415aac]
mov eax, dword [0x415aac]
mov byte [eax + edi], 0
test esi, esi
je 0x40bd99
cmp dword [0x415aac], 2
jne 0x40bd99
test ebx, ebx
jne 0x40be47
mov dword [ebp - 4], 3
jmp 0x40be47
xor esi, esi
cmp dword [0x415aac], esi
jle 0x40be47
push edi
call fcn.0040e930
add esp, 4
inc eax
push eax
call fcn.0040eb30
add esp, 4
mov ebx, eax
push edi
push ebx
call fcn.0040e9b0
add esp, 8
push ebx
call fcn.004056e5
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x40be3e
cmp dword [0x417abc], esi
jne 0x40bdfc
push ebx
call fcn.0040eb10
add esp, 4
mov eax, 2
mov dword [0x415aac], esi
jmp 0x40beea
xor esi, esi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x40be30
push ebx
call fcn.0040eb10
add esp, 4
push 0x415fe0
call fcn.0040fd90
add esp, 4
mov eax, 3
mov dword [0x415aac], esi
jmp 0x40beea
push edi
push 0xaa
call fcn.00408bc9
add esp, 8
push ebx
call fcn.0040eb10
add esp, 4
mov eax, dword [0x415aac]
add eax, dword [ebp - 4]
push eax
call fcn.0040eb30
add esp, 4
mov dword [0x417990], eax
xor eax, eax
cmp dword [0x417990], eax
jne 0x40be73
mov dword [0x415aac], eax
mov eax, 0xa
jmp 0x40beea
push edi
mov eax, dword [0x417990]
push eax
call fcn.0040e9b0
add esp, 8
cmp dword [ebp - 4], 3
jne 0x40be9d
mov eax, dword [0x417990]
mov ecx, dword [0x415aac]
mov byte [eax + ecx], 0x2e
inc dword [0x415aac]
mov eax, dword [0x417990]
mov ecx, dword [0x415aac]
mov byte [eax + ecx], 0x2f
mov eax, dword [0x417990]
inc dword [0x415aac]
mov ecx, dword [0x415aac]
mov byte [eax + ecx], 0
xor eax, eax
jmp 0x40beea
cmp eax, 5
jne 0x40bee5
cmp dword [0x415aac], 0
jle 0x40bee1
mov eax, dword [0x417990]
push eax
call fcn.0040eb10
add esp, 4
xor eax, eax
jmp 0x40beea
mov eax, 0x63
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret