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

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x28]
test edi, edi
je 0x408b8c
mov eax, edi
lea edx, [eax + 2]
jmp 0x408a00
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408a00
sub eax, edx
sar eax, 1
je 0x408b8c
push 7
push 0x4ef454
push edi
call fcn.004a669b
add esp, 0xc
test eax, eax
jne 0x408b8c
push 0x208
call fcn.004a41a8
add esp, 4
push 0x208
mov ebp, eax
push 0
push ebp
call fcn.004a7380
add esp, 0xc
push 0x513eb8
mov bl, 1
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x513eb0]
mov edx, dword [0x513eac]
mov eax, ecx
sub eax, edx
sar eax, 3
xor esi, esi
test eax, eax
jbe 0x408b2a
cmp esi, eax
jb 0x408a8b
call fcn.004a68c5
mov ecx, dword [0x513eb0]
mov edx, dword [0x513eac]
cmp dword [edx + esi*8], 0
je 0x408ac2
sub ecx, edx
sar ecx, 3
cmp esi, ecx
jb 0x408aa5
call fcn.004a68c5
mov edx, dword [0x513eac]
mov eax, dword [edx + esi*8]
push edi
push eax
call fcn.004a5ede
mov ecx, dword [0x513eb0]
add esp, 8
test eax, eax
je 0x408ad0
mov edx, dword [0x513eac]
mov eax, ecx
sub eax, edx
inc esi
sar eax, 3
cmp esi, eax
jb 0x408a8b
jmp 0x408b2a
sub ecx, dword [0x513eac]
sar ecx, 3
cmp esi, ecx
jb 0x408ae2
call fcn.004a68c5
mov edx, dword [0x513eac]
cmp dword [edx + esi*8 + 4], 0
je 0x408b2a
call fcn.004096b0
mov eax, dword [eax + 4]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408b00
sub eax, edx
sar eax, 1
je 0x408b2a
xor bl, bl
call fcn.004096b0
mov eax, dword [eax + 4]
push eax
push 0x104
push ebp
call fcn.004a575e
add esp, 0xc
push 0x513eb8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [esp + 0x17], 1
test bl, bl
jne 0x408b54
push ebp
call fcn.00408870
add esp, 4
test al, al
je 0x408b74
mov byte [esp + 0x17], bl
jmp 0x408c86
push 0
push 0x511210
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push ebp
push 0
push 0x4ef464
push 0x511210
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
mov ecx, dword [esp + 0x28]
mov edi, ebp
call fcn.004088e0
test al, al
jne 0x408b98
push ebp
call fcn.004a588e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 8
push 1
push 0x10000000
push 1
push ebp
call fcn.00431540
add esp, 0x10
test bl, bl
je 0x408c82
mov esi, dword [esp + 0x28]
mov eax, esi
lea edx, [eax + 2]
jmp 0x408bc0
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408bc0
sub eax, edx
sar eax, 1
xor ecx, ecx
inc eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004a41a8
mov edi, eax
mov eax, esi
add esp, 4
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408bf0
sub eax, edx
sar eax, 1
push esi
inc eax
push eax
push edi
call fcn.004a575e
mov eax, ebp
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408c10
sub eax, edx
sar eax, 1
xor ecx, ecx
inc eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004a41a8
mov esi, eax
mov eax, ebp
add esp, 4
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408c40
sub eax, edx
sar eax, 1
push ebp
inc eax
push eax
push esi
call fcn.004a575e
add esp, 0xc
push 0x513eb8
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea edi, [esp + 0x18]
call fcn.004096e0
push 0x513eb8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [esp + 0x28]
cmp byte [esp + 0x2c], 0
je 0x408c9c
cmp byte [esp + 0x17], 0
je 0x408c9c
push edi
mov eax, ebp
call fcn.00408cb0
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x14
ret 8