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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x214
mov eax, dword [0x107fa78]
xor eax, ebp
mov dword [ebp - 4], eax
and dword [ebp - 0x214], 0
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
mov esi, ecx
jne 0x104f9a6
mov eax, 0x80004003
jmp 0x104fc08
push 0x5c
push edi
call dword [sym.imp.msvcrt.dll_wcsrchr]
test eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x210], eax
jne 0x104f9c1
mov dword [ebp - 0x210], edi
mov eax, dword [esi + 0xc]
test eax, eax
je 0x104f9d3
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 0x104f9e0
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_
test eax, eax
pop ecx
mov dword [esi + 0xc], eax
jne 0x104fa18
mov eax, 0x8007000e
jmp 0x104fc07
push dword [ebp - 0x210]
push edi
push eax
call fcn.01034c79
cmp dword [esi + 0x18], 0
jne 0x104fc01
lea eax, [ebp - 0x20c]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x104fc01
mov eax, dword [esi + 0x18]
test eax, eax
je 0x104fa5c
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.01056bba
push dword [esi + 0xc]
lea eax, [ebp - 0x20c]
push edi
push eax
call fcn.01034cee
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x104fa81
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_
test eax, eax
pop ecx
mov dword [esi + 0x18], eax
je 0x104fc01
lea ecx, [ebp - 0x20c]
push ecx
push edi
push eax
call fcn.01034c79
push dword [esi + 0x18]
call fcn.01056f43
test eax, eax
jne 0x104fc01
lea eax, [ebp - 0x20c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x104fc01
mov eax, dword [esi + 0x18]
test eax, eax
je 0x104fafd
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.01056bba
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, ebx
test cx, cx
jne 0x104fb12
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 0x104fb28
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_
test eax, eax
pop ecx
mov dword [esi + 0x18], eax
je 0x104fc01
mov ecx, dword [0x1082080]
inc dword [0x1082080]
push ecx
lea ecx, [ebp - 0x20c]
push ecx
mov ebx, 0x100814c
push ebx
push edi
push eax
mov dword [esi + 0x48], 1
call fcn.01034d76
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x104fbce
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x104fb9c
push 0x57
pop eax
cmp eax, 0xb7
jne 0x104fbde
cmp dword [0x1082080], 0xffffffff
jae 0x104fbde
mov eax, dword [0x1082080]
inc dword [0x1082080]
push eax
lea eax, [ebp - 0x20c]
push eax
push ebx
push dword [ebp - 0x210]
push dword [esi + 0x18]
call fcn.01034d76
add esp, 0x14
push 0
push dword [esi + 0x18]
call edi
test eax, eax
je 0x104fb8f
jmp 0x104fbe8
mov dword [ebp - 0x214], 0x80004005
push dword [esi + 0x18]
call fcn.01056bba
push dword [esi + 0xc]
push dword [ebp - 0x210]
push dword [esi + 0x18]
call fcn.01034cee
mov eax, dword [ebp - 0x214]
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.01047417
leave
ret 4