Function at 0x401560
Capabilities:
Get common file path
Print debug messages
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
mov eax, dword [ebp + 0xc]
cmp dword [eax], 4
je 0x401585
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 1
je 0x401585
mov edx, dword [ebp + 0xc]
cmp dword [edx], 2
jne 0x4017a4
mov eax, dword [ebp + 0xc]
cmp dword [eax], 2
jne 0x401754
mov ecx, dword [ebp + 0xc]
cmp dword [ecx + 0x428], 2
jle 0x401754
mov edx, dword [ebp + 0xc]
movsx eax, byte [edx + 0x10c]
test eax, eax
jne 0x4015ee
mov dword [ebp - 8], 0
mov ecx, dword [ebp + 0xc]
add ecx, 8
push ecx
lea edx, [ebp - 0x118]
push edx
call fcn.00405840
add esp, 8
push 0x2e
lea eax, [ebp - 0x118]
push eax
call fcn.00405c80
add esp, 8
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x4015ec
mov ecx, dword [ebp - 0x14]
mov byte [ecx], 0
jmp 0x40160e
mov edx, dword [ebp + 0xc]
add edx, 0x10c
push edx
lea eax, [ebp - 0x118]
push eax
call fcn.00405840
add esp, 8
mov dword [ebp - 8], 1
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 0x428]
mov dword [ebp - 0x11c], edx
mov eax, dword [ebp - 0x11c]
sub eax, 3
mov dword [ebp - 0x11c], eax
cmp dword [ebp - 0x11c], 5
ja case.0x40163f.2
mov ecx, dword [ebp - 0x11c]
jmp dword [ecx*4 + 0x4019d7]
push str.TIFF
mov edx, dword [ebp + 0xc]
add edx, 0x210
push edx
call fcn.00405840
add esp, 8
cmp dword [ebp - 8], 0
jne 0x401677
push str..tif
lea eax, [ebp - 0x118]
push eax
call fcn.00405850
add esp, 8
jmp 0x401754
push str.JPEG
mov ecx, dword [ebp + 0xc]
add ecx, 0x210
push ecx
call fcn.00405840
add esp, 8
cmp dword [ebp - 8], 0
jne 0x4016ad
push str..jpg
lea edx, [ebp - 0x118]
push edx
call fcn.00405850
add esp, 8
jmp 0x401754
push 0x432b58
mov eax, dword [ebp + 0xc]
add eax, 0x210
push eax
call fcn.00405840
add esp, 8
cmp dword [ebp - 8], 0
jne 0x4016e2
push str..emf
lea ecx, [ebp - 0x118]
push ecx
call fcn.00405850
add esp, 8
jmp 0x401754
push 0x432b64
mov edx, dword [ebp + 0xc]
add edx, 0x210
push edx
call fcn.00405840
add esp, 8
cmp dword [ebp - 8], 0
jne 0x401715
push str..cgm
lea eax, [ebp - 0x118]
push eax
call fcn.00405850
add esp, 8
jmp 0x401754
push 0x432b70
mov ecx, dword [ebp + 0xc]
add ecx, 0x210
push ecx
call fcn.00405840
add esp, 8
cmp dword [ebp - 8], 0
jne 0x401748
push str..png
lea edx, [ebp - 0x118]
push edx
call fcn.00405850
add esp, 8
jmp 0x401754
mov eax, 5
jmp 0x4019d3
call fcn.00402893
test eax, eax
je 0x401767
mov eax, 1
jmp 0x4019d3
mov eax, dword [ebp + 0xc]
mov dword [eax + 0x418], 0
mov ecx, dword [0x438804]
push ecx
push 0x438320
push 0x4385e0
push 0x4380e0
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
push ecx
call fcn.00401f00
add esp, 0x18
xor eax, eax
jmp 0x4019d3
push 0
push 0xa
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
push eax
push str._nAPI_Action___ld__ld__ld
push 0x438860
call fcn.00405af0
add esp, 0x14
push 0x438860
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x438700
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push 0x438440
push 0x432bb4
call fcn.004019f0
add esp, 8
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x401808
push 0x432bc4
push 0x438440
call fcn.00405840
add esp, 8
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 0xa
je 0x401818
mov edx, dword [ebp + 0xc]
cmp dword [edx], 0xb
jne 0x40182a
push 0x432bc8
push 0x438440
call fcn.00405840
add esp, 8
push 0x432bcc
push 0x438440
call fcn.00405bf0
add esp, 8
test eax, eax
jne 0x40184c
mov dword [0x436a48], 0
jmp 0x40186c
push 0x432bd0
push 0x438440
call fcn.00405bf0
add esp, 8
test eax, eax
jne 0x40186c
mov dword [0x436a48], 1
push 0x4380e0
push 0x432bdc
call fcn.004019f0
add esp, 8
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4018a5
push 0
push str.Registry_ERROR
push str.Corrupted_Registry_entry_SDI_BIN
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, 1
jmp 0x4019d3
push 0x4380e0
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [ebp + 0xc]
cmp dword [eax], 0xa
je 0x4018c0
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 0xb
jne 0x4018d9
push 0x4380e0
push str._s_printwin.dll
push 0x4384c0
call fcn.00405af0
add esp, 0xc
jmp 0x4018f0
push 0x4380e0
push str._s_bpslaunch.dll
push 0x4384c0
call fcn.00405af0
add esp, 0xc
push str._nUI_String____________________________
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x4384c0
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x4384c0
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x40194f
push 0x4384c0
push str.Cannot_Find_File__s
push 0x438860
call fcn.00405af0
add esp, 0xc
push 0
push 0x432c78
push 0x438860
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, 1
jmp 0x4019d3
push str.ideas_dll_launch
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x401999
push 0x4384c0
push str.DLL__s_is_Corrupted
push 0x438860
call fcn.00405af0
add esp, 0xc
push 0
push str.Load_ERROR
push 0x438860
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, 1
jmp 0x4019d3
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [0x4389cc]
push ecx
mov edx, dword [ebp - 4]
push edx
call dword [ebp - 0xc]
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0x438700
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push str._nLeaving_Call_UI....
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 1
mov esp, ebp
pop ebp
ret