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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x214
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
and dword [ebp - 0x214], 0
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
test edi, edi
jne 0x104f43f
mov eax, 0x80004003
jmp 0x104f6a1
push 0x5c
push edi
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
mov dword [ebp - 0x210], eax
test eax, eax
jne 0x104f45a
mov dword [ebp - 0x210], edi
mov eax, dword [esi + 0xc]
test eax, eax
je 0x104f46c
push eax
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
and dword [esi + 0xc], 0
pop ecx
mov eax, dword [ebp - 0x210]
push ebx
push 2
lea edx, [eax + 2]
pop ebx
mov cx, word [eax]
add eax, ebx
ret
test cx, cx
jne 0x104f479
sub eax, edx
sar eax, 1
lea edi, [eax + 1]
xor ecx, ecx
mov eax, edi
mov edx, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
pop ecx
mov dword [esi + 0xc], eax
test eax, eax
jne 0x104f4b1
mov eax, 0x8007000e
jmp 0x104f6a0
push dword [ebp - 0x210]
push edi
push eax
call fcn.01035831
cmp dword [esi + 0x18], 0
jne 0x104f69a
lea eax, [ebp - 0x20c]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x104f69a
mov eax, dword [esi + 0x18]
test eax, eax
je 0x104f4f5
push eax
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
and dword [esi + 0x18], 0
pop ecx
lea eax, [ebp - 0x20c]
push eax
call fcn.01055e5e
push dword [esi + 0xc]
lea eax, [ebp - 0x20c]
push edi
push eax
call fcn.010358a6
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x104f51a
sub eax, edx
sar eax, 1
lea edi, [eax + 1]
xor ecx, ecx
mov eax, edi
mov edx, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
pop ecx
mov dword [esi + 0x18], eax
test eax, eax
je 0x104f69a
lea ecx, [ebp - 0x20c]
push ecx
push edi
push eax
call fcn.01035831
push dword [esi + 0x18]
call fcn.010561eb
test eax, eax
jne 0x104f69a
lea eax, [ebp - 0x20c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x104f69a
mov eax, dword [esi + 0x18]
test eax, eax
je 0x104f596
push eax
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
and dword [esi + 0x18], 0
pop ecx
lea eax, [ebp - 0x20c]
push eax
call fcn.01055e5e
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x104f5ab
sub eax, edx
sar eax, 1
mov ecx, eax
mov eax, dword [esi + 0xc]
lea edx, [eax + 2]
mov di, word [eax]
add eax, ebx
test di, di
jne 0x104f5c1
sub eax, edx
sar eax, 1
lea edi, [eax + ecx + 0x41]
xor ecx, ecx
mov eax, edi
mul ebx
seto cl
mov dword [ebp - 0x210], edi
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
pop ecx
mov dword [esi + 0x18], eax
test eax, eax
je 0x104f69a
mov ecx, dword [0x1074678]
inc dword [0x1074678]
push ecx
lea ecx, [ebp - 0x20c]
push ecx
mov ebx, 0x10080ac
push ebx
push edi
push eax
mov dword [esi + 0x48], 1
call fcn.0103592d
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x104f667
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x104f635
push 0x57
pop eax
cmp eax, 0xb7
jne 0x104f677
cmp dword [0x1074678], 0xffffffff
jae 0x104f677
mov eax, dword [0x1074678]
inc dword [0x1074678]
push eax
lea eax, [ebp - 0x20c]
push eax
push ebx
push dword [ebp - 0x210]
push dword [esi + 0x18]
call fcn.0103592d
add esp, 0x14
push 0
push dword [esi + 0x18]
call edi
test eax, eax
je 0x104f628
jmp 0x104f681
mov dword [ebp - 0x214], 0x80004005
push dword [esi + 0x18]
call fcn.01055e5e
push dword [esi + 0xc]
push dword [ebp - 0x210]
push dword [esi + 0x18]
call fcn.010358a6
mov eax, dword [ebp - 0x214]
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.01047480
leave
ret 4