Function at 0x405680
Capabilities:
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x550b1b
mov eax, dword fs:[0]
push eax
sub esp, 0x258
mov eax, dword [0x59de30]
xor eax, esp
mov dword [esp + 0x250], eax
push ebx
push esi
push edi
mov eax, dword [0x59de30]
xor eax, esp
push eax
lea eax, [esp + 0x268]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x1c], 0
mov byte [esp + 0x16], 0
test edi, edi
je 0x4056df
cmp word [edi], 0
jne 0x4056ef
cmp dword [esi + 0x48], 8
lea edi, [esi + 0x34]
mov byte [esp + 0x16], 1
jb 0x4056ef
mov edi, dword [edi]
test edx, edx
je 0x405720
cmp word [edx], 0
je 0x405720
mov ecx, edx
lea ebx, [ecx + 2]
mov edi, edi
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405700
sub ecx, ebx
sar ecx, 1
push ecx
lea ebx, [esi + 0x4c]
push edx
mov ecx, ebx
call fcn.00403d70
jmp 0x40583c
lea eax, [esp + 0x54]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x405764
cmp word [esp + 0x54], 0
jne 0x405740
xor edx, edx
jmp 0x405756
lea edx, [esp + 0x54]
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x405747
sub edx, ecx
sar edx, 1
push edx
lea eax, [esp + 0x58]
lea ecx, [esi + 0x4c]
push eax
call fcn.00403d70
cmp dword [esi + 0x60], 8
lea ebx, [esi + 0x4c]
jb 0x405771
mov edx, dword [ebx]
jmp 0x405773
mov edx, ebx
xor eax, eax
mov dword [esp + 0x38], 7
mov dword [esp + 0x34], 0
mov word [esp + 0x24], ax
cmp word [edx], ax
jne 0x405793
xor ecx, ecx
jmp 0x4057b1
mov ecx, edx
lea eax, [ecx + 2]
mov dword [esp + 0x20], eax
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4057a0
sub ecx, dword [esp + 0x20]
sar ecx, 1
push ecx
push edx
lea ecx, [esp + 0x2c]
call fcn.00403d70
cmp dword [esp + 0x38], 8
lea eax, [esp + 0x24]
cmovae eax, dword [esp + 0x24]
push eax
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
setne al
test al, al
sete al
cmp dword [esp + 0x38], 8
mov byte [esp + 0x17], al
jb 0x4057f6
push dword [esp + 0x24]
call fcn.004daf24
mov al, byte [esp + 0x1b]
add esp, 4
test al, al
je 0x40583c
cmp dword [ebx + 0x14], 8
jb 0x405804
mov eax, dword [ebx]
jmp 0x405806
mov eax, ebx
push eax
lea ecx, [esp + 0x28]
call fcn.00405af0
cmp dword [esp + 0x38], 8
lea eax, [esp + 0x24]
cmovae eax, dword [esp + 0x24]
push 0
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
cmp dword [esp + 0x38], 8
jb 0x40583c
push dword [esp + 0x24]
call fcn.004daf24
add esp, 4
cmp byte [esp + 0x16], 0
jne 0x4058b1
xor eax, eax
mov dword [esp + 0x38], 7
mov dword [esp + 0x34], 0
mov word [esp + 0x24], ax
cmp word [edi], ax
jne 0x405863
xor ecx, ecx
jmp 0x40587f
mov ecx, edi
lea edx, [ecx + 2]
jmp 0x405870
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405870
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [esp + 0x2c]
call fcn.00403d70
cmp dword [esp + 0x38], 8
lea eax, [esp + 0x24]
cmovae eax, dword [esp + 0x24]
push eax
mov dword [esp + 0x20], 1
call dword [sym.imp.SHLWAPI.dll_PathIsFileSpecW]
mov byte [esp + 0x16], 1
cmp eax, 1
jne 0x4058b6
mov byte [esp + 0x16], 0
test byte [esp + 0x1c], 1
je 0x4058d0
cmp dword [esp + 0x38], 8
jb 0x4058d0
push dword [esp + 0x24]
call fcn.004daf24
add esp, 4
cmp byte [esp + 0x16], 0
je 0x4058e2
mov byte [esi + 0x6c], 0
xor al, al
jmp 0x4059dc
xor eax, eax
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], 0
mov word [esp + 0x3c], ax
cmp word [edi], ax
jne 0x405902
xor ecx, ecx
jmp 0x405916
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405907
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [esp + 0x44]
call fcn.00403d70
lea edx, [esp + 0x3c]
mov ecx, ebx
mov dword [esp + 0x270], 0
call fcn.0040dd50
mov dword [esp + 0x270], 0xffffffff
cmp dword [esp + 0x50], 8
mov byte [esp + 0x17], al
jb 0x40595d
push dword [esp + 0x3c]
call fcn.004daf24
mov al, byte [esp + 0x1b]
add esp, 4
xor ecx, ecx
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], 0
mov word [esp + 0x3c], cx
test al, al
jne 0x40597d
mov byte [esi + 0x6c], cl
jmp 0x4059dc
mov eax, dword [esi + 0x68]
lea edi, [esi + 0x68]
test eax, eax
je 0x405994
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0
lea edx, [esi + 0x34]
mov ecx, ebx
mov dword [esp + 0x18], 0
call fcn.0040e130
cmp byte [esi + 0x6d], 0
mov eax, dword [esi]
mov eax, dword [eax]
je 0x4059ba
push edi
mov ecx, esi
call eax
mov byte [esi + 0x6c], al
jmp 0x4059d9
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call eax
mov byte [esi + 0x6c], al
test al, al
je 0x4059d9
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4059d9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esi + 0x6c]
mov ecx, dword [esp + 0x268]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x250]
xor ecx, esp
call fcn.004da4c1
mov esp, ebp
pop ebp
ret 8