Function at 0x401d96
Capabilities:
Create directory
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x170
push ebx
mov ebx, dword [ebp + 0x18]
push esi
push edi
push dword [ebp + 0x1c]
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00401b75
add esp, 0x10
test eax, eax
je 0x401e0d
cmp byte [ebx], 0
je 0x401e0d
cmp dword [ebp + 0x14], 0
je 0x401dd6
push ebx
call fcn.00401ffb
test eax, eax
pop ecx
je 0x401e0d
jmp 0x401ff3
lea eax, [ebp - 0x170]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jbe 0x401e0d
mov edi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push ebx
call edi
mov esi, eax
lea eax, [ebp - 0x170]
neg esi
sbb esi, esi
push eax
inc esi
call edi
test esi, esi
je 0x401ff3
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jbe 0x401e23
and byte [ebx + 2], 0
jmp 0x401e2f
push 0x404118
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
and dword [ebp - 4], 0
lea eax, [ebp - 0x68]
push 0x64
push eax
mov ebx, str.SOFTWAREMicrosoftWindowsCurrentVersion
push str.ProgramFilesPath
mov edi, 0x80000002
push ebx
push edi
call fcn.00401c08
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
add esp, 0x14
test eax, eax
je 0x401ea1
push 0xd
lea eax, [ebp - 0x68]
push str._SystemDrive_
push eax
call fcn.00401aaf
add esp, 0xc
test eax, eax
jne 0x401ea1
lea eax, [ebp - 0x5b]
push 0x25
push eax
call fcn.00401949
pop ecx
test eax, eax
pop ecx
jne 0x401ea1
lea eax, [ebp - 0x5b]
push eax
call esi
mov ecx, dword [ebp + 0x1c]
add ecx, 0xfffffffe
cmp eax, ecx
jge 0x401ea1
lea eax, [ebp - 0x5b]
push eax
mov eax, dword [ebp + 0x18]
add eax, 2
push eax
jmp 0x401ee3
lea eax, [ebp - 0x68]
push 0x64
push eax
push str.ProgramFilesDir
push ebx
push edi
call fcn.00401c08
add esp, 0x14
test eax, eax
je 0x401ef0
cmp byte [ebp - 0x68], 0
je 0x401ef0
lea eax, [ebp - 0x68]
push 0x25
push eax
call fcn.00401949
pop ecx
test eax, eax
pop ecx
jne 0x401ef0
lea eax, [ebp - 0x68]
push eax
call esi
cmp eax, dword [ebp + 0x1c]
jge 0x401ef0
lea eax, [ebp - 0x68]
push eax
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov dword [ebp - 4], 1
xor edi, edi
cmp dword [ebp + 0x10], edi
je 0x401efe
push dword [ebp + 0x10]
call esi
mov edi, eax
push dword [0x4040c0]
call esi
push dword [0x4040bc]
mov ebx, eax
call esi
add edi, ebx
mov ebx, dword [ebp - 4]
cmp ebx, 1
lea edi, [eax + edi + 0xa]
jne 0x401f3b
push dword [ebp + 0x18]
call esi
dec eax
test eax, eax
jle 0x401f35
mov ecx, dword [ebp + 0x18]
add ecx, eax
cmp byte [ecx], 0x5c
jne 0x401f35
and byte [ecx], 0
lea edi, [edi + eax + 1]
jmp 0x401f45
push dword [0x4040b8]
call esi
add edi, eax
cmp edi, dword [ebp + 0x1c]
jg 0x401fdc
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edi, dword [sym.imp.KERNEL32.dll_SetLastError]
cmp ebx, 3
jge 0x401f98
lea ebx, [ebx*4 + 0x4040b8]
push dword [ebx]
push dword [ebp + 0x18]
call esi
push 0
call edi
push 0
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x401f8d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401fdc
add ebx, 4
cmp ebx, str._bar
jl 0x401f66
cmp dword [ebp + 0x10], 0
je 0x401fa6
push dword [ebp + 0x10]
push dword [ebp + 0x18]
call esi
cmp dword [ebp + 0x14], 0
jne 0x401fe0
push 0x4040f0
push dword [ebp + 0x18]
call esi
push 0
call edi
cmp dword [ebp + 0x10], 0
je 0x401fe0
push 0
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x401fe0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x401fe0
xor eax, eax
jmp 0x401ff6
push 0
push dword [ebp + 0x18]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00401c8d
add esp, 0x10
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret