Function at 0x401aef
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.004018e1
add esp, 0x10
test eax, eax
je 0x401b90
cmp byte [ebx], 0
je 0x401b90
cmp dword [ebp + 0x14], 0
je 0x401b59
and byte [ebp - 0xf3], 0
push 0x21
pop ecx
xor eax, eax
lea edi, [ebp - 0xf2]
mov byte [ebp - 0xf4], 0x88
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0xf4]
push 0x4000
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_OpenFile]
cmp eax, 0xffffffff
je 0x401b90
jmp 0x401d73
lea eax, [ebp - 0x170]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jbe 0x401b90
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 0x401d73
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jbe 0x401ba6
and byte [ebx + 2], 0
jmp 0x401bb2
push 0x4030d8
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.00401974
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
add esp, 0x14
test eax, eax
je 0x401c24
push 0xd
lea eax, [ebp - 0x68]
push str._SystemDrive_
push eax
call fcn.0040181d
add esp, 0xc
test eax, eax
jne 0x401c24
lea eax, [ebp - 0x5b]
push 0x25
push eax
call fcn.004016d6
pop ecx
test eax, eax
pop ecx
jne 0x401c24
lea eax, [ebp - 0x5b]
push eax
call esi
mov ecx, dword [ebp + 0x1c]
add ecx, 0xfffffffe
cmp eax, ecx
jge 0x401c24
lea eax, [ebp - 0x5b]
push eax
mov eax, dword [ebp + 0x18]
add eax, 2
push eax
jmp 0x401c66
lea eax, [ebp - 0x68]
push 0x64
push eax
push str.ProgramFilesDir
push ebx
push edi
call fcn.00401974
add esp, 0x14
test eax, eax
je 0x401c73
cmp byte [ebp - 0x68], 0
je 0x401c73
lea eax, [ebp - 0x68]
push 0x25
push eax
call fcn.004016d6
pop ecx
test eax, eax
pop ecx
jne 0x401c73
lea eax, [ebp - 0x68]
push eax
call esi
cmp eax, dword [ebp + 0x1c]
jge 0x401c73
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 0x401c81
push dword [ebp + 0x10]
call esi
mov edi, eax
push dword [0x403080]
call esi
push dword [0x40307c]
mov ebx, eax
call esi
add edi, ebx
mov ebx, dword [ebp - 4]
cmp ebx, 1
lea edi, [eax + edi + 0xa]
jne 0x401cbe
push dword [ebp + 0x18]
call esi
dec eax
test eax, eax
jle 0x401cb8
mov ecx, dword [ebp + 0x18]
add ecx, eax
cmp byte [ecx], 0x5c
jne 0x401cb8
and byte [ecx], 0
lea edi, [edi + eax + 1]
jmp 0x401cc8
push dword [0x403078]
call esi
add edi, eax
cmp edi, dword [ebp + 0x1c]
jg 0x401d5e
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edi, dword [sym.imp.KERNEL32.dll_SetLastError]
cmp ebx, 3
jge 0x401d1b
lea ebx, [ebx*4 + 0x403078]
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 0x401d10
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401d5e
add ebx, 4
cmp ebx, str._bar
jl 0x401ce9
cmp dword [ebp + 0x10], 0
je 0x401d29
push dword [ebp + 0x10]
push dword [ebp + 0x18]
call esi
cmp dword [ebp + 0x14], 0
jne 0x401d62
push 0x4030b0
push dword [ebp + 0x18]
call esi
xor esi, esi
push esi
call edi
cmp dword [ebp + 0x10], esi
je 0x401d62
push esi
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x401d62
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x401d62
xor eax, eax
jmp 0x401d76
push dword [ebp + 0x18]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004019f9
add esp, 0xc
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret