Function at 0x405684
Capabilities:
Create directory

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0xd8
mov qword [rsp + 0x50], 0xfffffffffffffffe
mov rbx, rcx
call fcn.00406328
cmp eax, 0xffffffff
je 0x4056b5
test al, 0x10
je 0x4056b5
mov al, 1
jmp 0x405a05
mov rcx, rbx
call fcn.004085a8
test al, al
je 0x4056c8
xor al, al
jmp 0x405a05
mov rcx, rbx
call fcn.004086fc
mov r12d, eax
mov rdx, rbx
lea rcx, [rsp + 0x20]
call fcn.00402338
nop
lea rcx, [rsp + 0x20]
call fcn.00402830
mov esi, 1
test eax, eax
js 0x405717
mov edx, dword [rsp + 0x28]
lea ecx, [rdx - 1]
cmp eax, ecx
jne 0x405717
cmp edx, esi
jne 0x405708
jmp 0x4059ad
mov dword [rsp + 0x28], ecx
mov rax, qword [rsp + 0x20]
mov word [rax + rcx*2], 0
lea rdx, [rsp + 0x20]
lea rcx, [rsp + 0x30]
call fcn.004023d8
nop
mov edi, dword [rsp + 0x28]
mov r13d, 0xb7
mov rbx, qword [rsp + 0x20]
mov rcx, rbx
call fcn.00408994
mov ebp, eax
cmp eax, esi
je 0x405766
xor edx, edx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40591c
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, r13d
je 0x405839
test ebp, ebp
je 0x405839
lea rcx, [rsp + 0x40]
call fcn.0040229c
nop
cmp ebp, esi
setne r8b
lea rdx, [rsp + 0x40]
mov rcx, rbx
call fcn.00409010
test al, al
je 0x40582f
xor edx, edx
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x405912
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, r13d
je 0x4057c3
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_free
jmp 0x4058a0
lea rcx, [rsp + 0x58]
call fcn.00406304
lea rcx, [rsp + 0x80]
call fcn.0040229c
nop
mov rdx, qword [rsp + 0x40]
lea rcx, [rsp + 0x58]
call fcn.004065b0
test al, al
jne 0x40580b
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_free
jmp 0x4058a0
mov ebx, dword [rsp + 0x78]
shr ebx, 4
and bl, sil
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_free
jmp 0x40589c
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_free
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, r13d
jne 0x4058a0
lea rcx, [rsp + 0x90]
call fcn.00406304
lea rcx, [rsp + 0xb8]
call fcn.0040229c
nop
mov rdx, rbx
lea rcx, [rsp + 0x90]
call fcn.004065b0
test al, al
jne 0x405882
mov rcx, qword [rsp + 0xb8]
call sub.msvcrt.dll_free
jmp 0x4058a0
mov ebx, dword [rsp + 0xb0]
shr ebx, 4
and bl, sil
mov rcx, qword [rsp + 0xb8]
call sub.msvcrt.dll_free
test bl, bl
jne 0x40591c
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, r13d
je 0x40599f
lea rcx, [rsp + 0x20]
call fcn.00402830
mov edi, eax
test eax, eax
js 0x4059ee
test eax, eax
je 0x4059ee
mov rbx, qword [rsp + 0x20]
cmp edi, esi
jne 0x4058e8
cmp word [rbx], 0x5c
je 0x4059bc
cmp word [rbx], 0x2f
je 0x4059bc
lea eax, [rdi + 1]
cmp r12d, eax
jae 0x4059d5
cmp edi, dword [rsp + 0x28]
jae 0x405736
mov dword [rsp + 0x28], edi
mov word [rbx + rdi*2], 0
mov rbx, qword [rsp + 0x20]
jmp 0x405736
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_free
cmp edi, dword [rsp + 0x38]
jge 0x405985
lea ecx, [rdi + 1]
mov rax, qword [rsp + 0x30]
lea rcx, [rax + rcx*2]
call fcn.00408278
test eax, eax
jns 0x40593d
mov edi, dword [rsp + 0x38]
jmp 0x405941
lea edi, [rdi + rax + 1]
mov r8d, edi
mov rdx, qword [rsp + 0x30]
lea rcx, [rsp + 0x20]
call fcn.00402524
mov rcx, qword [rsp + 0x20]
call fcn.004051f4
test al, al
je 0x405969
cmp edi, dword [rsp + 0x38]
jl 0x405922
jmp 0x405985
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
xor al, al
jmp 0x405a05
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
mov al, sil
jmp 0x405a05
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
nop
xor sil, sil
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
mov al, sil
jmp 0x405a05
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
xor al, al
jmp 0x405a05
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
xor al, al
jmp 0x405a05
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
nop
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
xor al, al
add rsp, 0xd8
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret