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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x114
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, dword [sym.imp.MSVCRT.dll_strncpy]
push edi
cmp byte [esi + 0x25c], 0
lea edi, [esi + 0x25c]
mov dword [ebp - 4], edi
jne 0x404078
mov eax, dword [esi]
push str.tmpdir
push str.TMPDIR
push dword [eax]
call fcn.004043a4
add esp, 0xc
mov dword [ebp + 8], eax
test eax, eax
je 0x4040ae
push eax
call sub.MSVCRT.dll_strlen
cmp eax, 0x104
pop ecx
jbe 0x403fcc
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
jmp 0x4041b5
inc eax
push eax
push dword [ebp + 8]
push edi
call ebx
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0x10
push edi
call sub.MSVCRT.dll_strlen
mov edi, eax
pop ecx
test edi, edi
je 0x404000
cmp byte [edi + esi + 0x25b], 0x5c
je 0x404000
mov byte [edi + esi + 0x25c], 0x5c
inc edi
lea eax, [ebp - 0x114]
push 0x104
push eax
call fcn.0040428e
pop ecx
mov dword [ebp + 8], eax
pop ecx
mov ecx, 0xfd
sub ecx, eax
cmp edi, ecx
ja 0x4041b5
push 3
lea eax, [edi + esi + 0x25c]
push 0x40cc10
push eax
call ebx
add esp, 0xc
add edi, 3
cmp dword [ebp + 8], 0
je 0x404065
push dword [ebp + 8]
mov byte [edi + esi + 0x25c], 0x2d
inc edi
lea eax, [ebp - 0x114]
push eax
lea eax, [edi + esi + 0x25c]
push eax
call ebx
add esp, 0xc
add edi, dword [ebp + 8]
add edi, esi
mov byte [edi + 0x25c], 0x5c
and byte [edi + 0x25d], 0
mov edi, dword [ebp - 4]
xor eax, eax
cmp dword [ebp + 0xc], eax
jne 0x404110
cmp dword [esi + 0x254], eax
jne 0x404109
push edi
call dword [sym.imp.MSVCRT.dll__mkdir]
test eax, eax
pop ecx
je 0x4040da
mov esi, dword [sym.imp.MSVCRT.dll__errno]
call esi
cmp dword [eax], 0x11
je 0x404109
call esi
push dword [eax]
push edi
jmp 0x40419e
push edi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
cmp eax, 0x104
jbe 0x403fe0
push 0x104
push str.TEMP_path_need_more_than__d_characters
call fcn.004038b6
pop ecx
jmp 0x403fc6
push 0x1ed
push edi
call dword [sym.imp.MSVCRT.dll__chmod]
pop ecx
test eax, eax
pop ecx
je 0x4040ff
call dword [sym.imp.MSVCRT.dll__errno]
push dword [eax]
push edi
push str.chmod___s___0755__failed__errno_d_n
jmp 0x4041a3
mov dword [esi + 0x254], 1
mov eax, edi
jmp 0x40424c
cmp dword [esi + 0x258], eax
jne 0x404246
push edi
call sub.MSVCRT.dll_strlen
pop ecx
mov edi, eax
push 0x5c
call dword [sym.imp.MSVCRT.dll__getpid]
push eax
lea eax, [ebp - 0x10]
push str._d_c
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
push dword [ebp - 4]
mov dword [ebp + 8], eax
lea eax, [esi + 0x361]
push eax
call sub.MSVCRT.dll_strcpy
mov ecx, dword [ebp + 8]
mov eax, 0x104
sub eax, edi
add esp, 0x18
cmp ecx, eax
ja 0x4041b5
lea eax, [edi + esi]
inc ecx
push ecx
lea ecx, [ebp - 0x10]
mov byte [eax + 0x360], 0x2d
add eax, 0x361
push ecx
push eax
call ebx
lea ebx, [esi + 0x361]
push ebx
call dword [sym.imp.MSVCRT.dll__mkdir]
add esp, 0x10
test eax, eax
je 0x4041bc
mov edi, dword [sym.imp.MSVCRT.dll__errno]
call edi
cmp dword [eax], 0x11
je 0x4041bc
call edi
push dword [eax]
push ebx
push str.mkdir___s___failed__errno_d_n
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x40
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x10
xor eax, eax
jmp 0x40424c
push 0x40f690
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x40f74c]
test eax, eax
mov edi, eax
je 0x4041eb
push dword [edi + 4]
push ebx
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
je 0x4041e7
mov edi, dword [edi]
test edi, edi
jne 0x4041d2
test edi, edi
jne 0x404231
push str.cleanup_entry
push 8
call fcn.00404251
mov edi, eax
pop ecx
test edi, edi
pop ecx
je 0x404231
mov eax, dword [0x40f74c]
push str.cleanup_path
push ebx
mov dword [edi], eax
call sub.MSVCRT.dll_strlen
pop ecx
inc eax
push eax
call fcn.00404251
pop ecx
mov dword [edi + 4], eax
test eax, eax
pop ecx
je 0x40422b
push ebx
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
mov dword [0x40f74c], edi
push 0x40f690
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esi + 0x258], 1
lea eax, [esi + 0x361]
pop edi
pop esi
pop ebx
leave
ret