Function at 0x104f3ed
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 0x104f41e
mov eax, 0x80004003
jmp 0x104f680
push 0x5c
push edi
call dword [sym.imp.msvcrt.dll_wcsrchr]
pop ecx
pop ecx
mov dword [ebp - 0x210], eax
test eax, eax
jne 0x104f439
mov dword [ebp - 0x210], edi
mov eax, dword [esi + 0xc]
test eax, eax
je 0x104f44b
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
test cx, cx
jne 0x104f458
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 0x104f490
mov eax, 0x8007000e
jmp 0x104f67f
push dword [ebp - 0x210]
push edi
push eax
call fcn.01035811
cmp dword [esi + 0x18], 0
jne 0x104f679
lea eax, [ebp - 0x20c]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x104f679
mov eax, dword [esi + 0x18]
test eax, eax
je 0x104f4d4
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.01055e3d
push dword [esi + 0xc]
lea eax, [ebp - 0x20c]
push edi
push eax
call fcn.01035886
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x104f4f9
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 0x104f679
lea ecx, [ebp - 0x20c]
push ecx
push edi
push eax
call fcn.01035811
push dword [esi + 0x18]
call fcn.010561ca
test eax, eax
jne 0x104f679
lea eax, [ebp - 0x20c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x104f679
mov eax, dword [esi + 0x18]
test eax, eax
je 0x104f575
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.01055e3d
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x104f58a
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 0x104f5a0
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 0x104f679
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.0103590d
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x104f646
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x104f614
push 0x57
pop eax
cmp eax, 0xb7
jne 0x104f656
cmp dword [0x1074678], 0xffffffff
jae 0x104f656
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.0103590d
add esp, 0x14
push 0
push dword [esi + 0x18]
call edi
test eax, eax
je 0x104f607
jmp 0x104f660
mov dword [ebp - 0x214], 0x80004005
push dword [esi + 0x18]
call fcn.01055e3d
push dword [esi + 0xc]
push dword [ebp - 0x210]
push dword [esi + 0x18]
call fcn.01035886
mov eax, dword [ebp - 0x214]
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.01047464
leave
ret 4