Function at 0x40c8d0
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x53fd83
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x480
push ebx
push ebp
push esi
push edi
xor esi, esi
push 0x589b18
lea ecx, [esp + 0x18]
mov dword [esp + 0x40], esi
call fcn.0043b7e0
mov eax, dword [0x598738]
mov dword [esp + 0x498], 1
cmp eax, esi
je 0x40c930
push str.CSDViewerApp::GetTargetProcessPath.______________r_n
push str.SDSystem
push 1
push 0x597ea4
call fcn.0046e5f0
add esp, 0x10
mov eax, dword [esp + 0x4a8]
xor ebp, ebp
cmp eax, esi
jne 0x40ce1a
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x82]
mov word [esp + 0x80], si
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 0xf
xor eax, eax
lea edi, [esp + 0x42]
mov word [esp + 0x40], si
rep stosd dword es:[edi], eax
mov ebx, dword [esp + 0x4a4]
push 0x1f
stosw word es:[edi], ax
lea eax, [esp + 0x46]
mov ebp, 1
push eax
push ebx
call fcn.0040d070
add esp, 0xc
test eax, eax
je 0x40ca3e
mov eax, dword [0x598738]
mov word [esp + 0x40], 0x2e
cmp eax, esi
je 0x40c9c0
lea ecx, [esp + 0x40]
push ecx
push str.CSDViewerApp::GetTargetProcessPath._Ext__s__r_n
push str.SDSystem
push ebp
push 0x597ea4
call fcn.0046e5f0
add esp, 0x14
mov eax, dword [0x59a0f4]
mov ebp, 2
cmp eax, esi
mov dword [esp + 0x20], 0x104
je 0x40ca3e
lea edx, [esp + 0x20]
lea ecx, [esp + 0x80]
push edx
push ecx
lea edx, [esp + 0x48]
push esi
push edx
push ebp
push 0x420
call eax
cmp dword [0x598738], esi
je 0x40ca1a
lea eax, [esp + 0x80]
push eax
push 0x572d98
push str.SDSystem
push 1
push 0x597ea4
call fcn.0046e5f0
add esp, 0x14
lea ecx, [esp + 0x80]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40ca3e
lea edx, [esp + 0x80]
lea ecx, [esp + 0x14]
push edx
call fcn.0043c200
mov eax, dword [esp + 0x14]
cmp dword [eax - 8], esi
jne 0x40ce1a
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x28a]
mov word [esp + 0x288], si
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x288]
push ecx
push 0x104
stosw word es:[edi], ax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea edx, [esp + 0x80]
lea eax, [esp + 0x288]
push edx
push eax
push ebx
call dword [sym.imp.SHELL32.dll_FindExecutableW]
cmp eax, 0x20
jbe 0x40cac6
lea ecx, [esp + 0x80]
mov ebp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40ce1a
lea edx, [esp + 0x80]
lea ecx, [esp + 0x14]
push edx
call fcn.0043c200
jmp 0x40ce1a
push 0x589b18
lea ecx, [esp + 0x24]
mov ebp, 5
call fcn.0043b7e0
push ebx
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], 2
call fcn.0043b7e0
mov bl, 3
push 0x2e
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], bl
call fcn.0043d130
cmp eax, 0xffffffff
je 0x40cb35
push eax
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x24]
call fcn.0043e270
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x49c], 4
call fcn.0043c110
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], bl
call fcn.0043bf80
lea ecx, [esp + 0x1c]
mov byte [esp + 0x498], 2
call fcn.0043bf80
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx - 8]
test eax, eax
je 0x40ce07
push 0x589b18
lea ecx, [esp + 0x20]
mov ebp, 6
call fcn.0043b7e0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x498], 5
call fcn.0044aa00
mov edx, dword [esp + 0x20]
push 0x20019
push edx
push SysReAllocStringLen
lea ecx, [esp + 0x38]
mov byte [esp + 0x4a4], 6
call fcn.0044ab70
test eax, eax
je 0x40cbd9
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x34]
call fcn.0044b1a0
push eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], 7
call fcn.0043c110
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], 6
call fcn.0043bf80
lea ecx, [esp + 0x2c]
call fcn.0044abc0
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx - 8]
test eax, eax
je 0x40cde5
push 0x589b18
lea ecx, [esp + 0x1c]
mov ebp, 7
call fcn.0043b7e0
lea ecx, [esp + 0x34]
mov byte [esp + 0x498], 8
call fcn.0044aa00
push str._shellopencommand
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], 9
call fcn.0043cbd0
mov edx, dword [esp + 0x1c]
push 0x20019
push edx
push SysReAllocStringLen
lea ecx, [esp + 0x40]
call fcn.0044ab70
test eax, eax
je 0x40cc7a
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x3c]
call fcn.0044b1a0
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x49c], 0xa
call fcn.0043c110
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], 9
call fcn.0043bf80
lea ecx, [esp + 0x34]
call fcn.0044abc0
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx - 8]
test eax, eax
je 0x40cdc3
lea ecx, [esp + 0x18]
call fcn.0043fcb0
lea ecx, [esp + 0x18]
call fcn.0043f990
mov edx, dword [esp + 0x18]
cmp word [edx], 0x22
jne 0x40cd03
push 1
push 0x572d94
lea ecx, [esp + 0x20]
mov ebp, 9
call fcn.0043d1a0
dec eax
lea ecx, [esp + 0x18]
push eax
lea eax, [esp + 0x14]
push 1
push eax
call fcn.0043e2a0
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x498], 0xb
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40ccf2
lea edx, [esp + 0x10]
lea ecx, [esp + 0x14]
push edx
call fcn.0043c110
mov byte [esp + 0x498], 9
lea ecx, [esp + 0x10]
jmp 0x40cdbe
mov ebp, 0xa
xor esi, esi
mov bl, 0xc
push 0x589b18
lea ecx, [esp + 0x14]
call fcn.0043b7e0
push esi
push 0x572d90
lea ecx, [esp + 0x20]
mov byte [esp + 0x4a0], bl
call fcn.0043d1a0
mov esi, eax
cmp esi, 0xffffffff
je 0x40cd6a
lea eax, [esp + 0x24]
push esi
push eax
lea ecx, [esp + 0x20]
call fcn.0043e6c0
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x49c], 0xd
call fcn.0043c110
lea ecx, [esp + 0x24]
mov byte [esp + 0x498], bl
call fcn.0043bf80
jmp 0x40cd78
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x14]
call fcn.0043c110
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40cda4
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], 9
call fcn.0043bf80
cmp esi, 0xffffffff
jne 0x40cd0c
jmp 0x40cdc3
lea eax, [esp + 0x10]
lea ecx, [esp + 0x14]
push eax
call fcn.0043c110
mov byte [esp + 0x498], 9
lea ecx, [esp + 0x10]
call fcn.0043bf80
lea ecx, [esp + 0x34]
mov byte [esp + 0x498], 8
call fcn.0044aaf0
lea ecx, [esp + 0x18]
mov byte [esp + 0x498], 6
call fcn.0043bf80
lea ecx, [esp + 0x2c]
mov byte [esp + 0x498], 5
call fcn.0044aaf0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x498], 2
call fcn.0043bf80
lea ecx, [esp + 0x20]
mov byte [esp + 0x498], 1
call fcn.0043bf80
xor esi, esi
mov ecx, dword [esp + 0x14]
cmp dword [ecx - 8], esi
jne 0x40cfa6
push esi
lea ecx, [esp + 0x84]
mov ebp, 0xb
call fcn.004026e0
mov edx, dword [esp + 0x4a4]
mov bl, 0xe
push edx
lea ecx, [esp + 0x84]
mov byte [esp + 0x49c], bl
call fcn.00402c50
test eax, eax
je 0x40ce9e
lea ecx, [esp + 0x80]
call fcn.00526ad4
cmp eax, 1
jne 0x40ce9e
lea eax, [esp + 0x24]
lea ecx, [esp + 0x80]
push eax
call fcn.00404ed0
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x49c], 0xf
call fcn.0043c110
lea ecx, [esp + 0x24]
mov byte [esp + 0x498], bl
call fcn.0043bf80
lea ecx, [esp + 0x1a4]
mov byte [esp + 0x498], 0x1a
call fcn.00525079
lea ecx, [esp + 0x168]
mov byte [esp + 0x498], 0x19
call fcn.00533c63
lea ecx, [esp + 0x12c]
mov byte [esp + 0x498], 0x18
call fcn.00533c63
mov eax, dword [esp + 0x11c]
mov byte [esp + 0x498], 0x17
cmp eax, esi
je 0x40cef6
push eax
call fcn.00526473
add esp, 4
mov eax, dword [esp + 0x10c]
mov byte [esp + 0x498], 0x16
cmp eax, esi
je 0x40cf12
push eax
call fcn.00526473
add esp, 4
mov eax, dword [esp + 0xfc]
mov byte [esp + 0x498], 0x15
cmp eax, esi
je 0x40cf2e
push eax
call fcn.00526473
add esp, 4
lea ecx, [esp + 0xec]
mov byte [esp + 0x498], 0x14
call fcn.0043bf80
lea ecx, [esp + 0xe8]
mov byte [esp + 0x498], 0x13
call fcn.0043bf80
lea ecx, [esp + 0xe4]
mov byte [esp + 0x498], 0x12
call fcn.0043bf80
lea ecx, [esp + 0xe0]
mov byte [esp + 0x498], 0x11
call fcn.0043bf80
lea ecx, [esp + 0xdc]
mov byte [esp + 0x498], 0x10
call fcn.0043bf80
lea ecx, [esp + 0x80]
mov byte [esp + 0x498], 1
call fcn.0052661a
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x2c]
call fcn.0043b580
mov esi, dword [esp + 0x28]
push 0x104
push 0x104
lea ecx, [esp + 0x1c]
mov byte [esp + 0x4a0], 0x1b
call fcn.0043cc50
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
push 0xffffffffffffffff
lea ecx, [esp + 0x18]
call fcn.0043cd20
mov eax, dword [0x598738]
test eax, eax
je 0x40d00e
mov edx, dword [esp + 0x14]
push ebp
push edx
push str.CSDViewerApp::GetTargetProcessPath.__s__Debug__d__r_n
push str.SDSystem
push 1
push 0x597ea4
call fcn.0046e5f0
add esp, 0x18
mov esi, dword [esp + 0x4a0]
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call fcn.0043b580
mov dword [esp + 0x3c], 1
lea ecx, [esp + 0x28]
mov byte [esp + 0x498], 1
call fcn.0043bf80
lea ecx, [esp + 0x14]
mov byte [esp + 0x498], 0
call fcn.0043bf80
mov ecx, dword [esp + 0x490]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x48c
ret 0xc