Function at 0x4018d0
Capabilities:
Get common file path
Set current directory
Terminate process

Disassembly:
sub esp, 0x60c
push ebx
push ebp
push esi
mov ebp, ecx
push edi
mov dword [esp + 0x18], ebp
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
mov esi, dword [esp + 0x620]
cmp esi, 0x20a
mov eax, dword [eax + 0x20]
mov dword [ebp + 0x14], esi
mov dword [ebp + 0x440], eax
jne 0x401b94
mov edi, dword [esp + 0x628]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x2f
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.MSVCRT.dll_strrchr]
add esp, 8
test eax, eax
je 0x401b6a
add ebp, 0x218
mov byte [eax + 1], 0
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
sub edx, eax
mov ebx, eax
sar edx, 9
cmp edx, 1
jae 0x401a57
mov edx, dword [ebp + 4]
test edx, edx
je 0x40197a
mov ecx, eax
sub ecx, edx
sar ecx, 9
cmp ecx, 1
ja 0x40197f
mov ecx, 1
test edx, edx
jne 0x401987
xor eax, eax
jmp 0x40198c
sub eax, edx
sar eax, 9
lea esi, [eax + ecx]
test esi, esi
mov eax, esi
jge 0x401997
xor eax, eax
shl eax, 9
push eax
call sub.MFC42.DLL_operatornew
mov dword [esp + 0x18], eax
mov edi, eax
mov eax, dword [ebp + 4]
add esp, 4
cmp eax, ebx
mov dword [esp + 0x10], eax
je 0x4019db
jmp 0x4019ba
mov eax, dword [esp + 0x10]
push eax
push edi
call fcn.00403060
mov eax, dword [esp + 0x18]
add esp, 8
add eax, 0x200
add edi, 0x200
cmp eax, ebx
mov dword [esp + 0x10], eax
jne 0x4019b6
lea eax, [esp + 0x1c]
mov ecx, ebp
push eax
push 1
push edi
call fcn.00403020
mov ecx, dword [ebp + 8]
add edi, 0x200
push edi
push ecx
push ebx
mov ecx, ebp
call fcn.00402fe0
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 4]
push edx
push eax
mov ecx, ebp
call fcn.004029c0
mov ecx, dword [ebp + 4]
push ecx
call sub.MFC42.DLL_operatordelete
mov edx, dword [esp + 0x18]
mov eax, dword [ebp + 4]
shl esi, 9
add esp, 4
add esi, edx
test eax, eax
mov dword [ebp + 0xc], esi
jne 0x401a3e
xor ecx, ecx
mov dword [ebp + 4], edx
inc ecx
shl ecx, 9
add ecx, edx
mov dword [ebp + 8], ecx
jmp 0x401b10
mov ecx, dword [ebp + 8]
mov dword [ebp + 4], edx
sub ecx, eax
sar ecx, 9
inc ecx
shl ecx, 9
add ecx, edx
mov dword [ebp + 8], ecx
jmp 0x401b10
mov edx, eax
sub edx, ebx
sar edx, 9
cmp edx, 1
jae 0x401ab2
lea ecx, [ebx + 0x200]
push ecx
push eax
push ebx
mov ecx, ebp
call fcn.00402fe0
mov eax, dword [ebp + 8]
lea edx, [esp + 0x1c]
mov ecx, eax
push edx
sub ecx, ebx
mov edx, 1
sar ecx, 9
sub edx, ecx
mov ecx, ebp
push edx
push eax
call fcn.00403020
mov eax, dword [ebp + 8]
cmp ebx, eax
je 0x401b09
mov edi, ebx
add ebx, 0x200
mov ecx, 0x80
lea esi, [esp + 0x1c]
cmp ebx, eax
rep movsd dword es:[edi], dword [esi]
jne 0x401a99
jmp 0x401b09
push eax
push eax
add eax, 0xfffffe00
mov ecx, ebp
push eax
call fcn.00402fe0
mov edx, dword [ebp + 8]
lea eax, [edx - 0x200]
cmp ebx, eax
je 0x401ae8
sub eax, 0x200
sub edx, 0x200
mov ecx, 0x80
mov esi, eax
mov edi, edx
cmp eax, ebx
rep movsd dword es:[edi], dword [esi]
jne 0x401ace
lea eax, [ebx + 0x200]
cmp ebx, eax
je 0x401b09
mov edi, ebx
add ebx, 0x200
mov ecx, 0x80
lea esi, [esp + 0x1c]
cmp ebx, eax
rep movsd dword es:[edi], dword [esi]
jne 0x401af2
add dword [ebp + 8], 0x200
lea edi, [esp + 0x1c]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [esp + 0x18]
repne scasb al, byte es:[edi]
mov ebp, dword [esp + 0x628]
mov dword [edx + 0x228], 0
not ecx
dec ecx
add edx, 0x18
mov edi, ecx
or ecx, 0xffffffff
add edi, ebp
mov ebp, dword [esp + 0x18]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov byte [ebp + 0x10], 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60c
ret 0xc
push 0
push 0
push 0x4170bc
call sub.MFC42.DLL_AfxMessageBox_1
push 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60c
ret 0xc
mov ebx, dword [esp + 0x624]
test ebx, ebx
je 0x401be7
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x401be7
lea ecx, [esp + 0x1c]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea edx, [esp + 0x1c]
push ebx
push edx
lea eax, [esp + 0x224]
push str._s_s_
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x10
lea ecx, [esp + 0x21c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov ecx, ebp
call fcn.00401750
cmp esi, 0x20b
je 0x401c08
cmp esi, 0x20d
je 0x401c08
lea edx, [ebp + 0x18]
mov edi, str.files.dat
jmp 0x401c10
lea edx, [ebp + 0x18]
mov edi, str.files_all.dat
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push 0x417084
call sub.MFC42.DLL_CString::CString_1
mov ecx, dword [ebp + 0x440]
call fcn.00406790
pop edi
mov byte [ebp + 0x10], 1
pop esi
pop ebp
pop ebx
add esp, 0x60c
ret 0xc