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

Disassembly:
push 0xffffffffffffffff
push 0x53a313
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 0x583998
lea ecx, [esp + 0x18]
mov dword [esp + 0x40], esi
call fcn.0043b640
mov eax, dword [0x5925b8]
mov dword [esp + 0x498], 1
cmp eax, esi
je 0x40c7c0
push str.CSDViewerApp::GetTargetProcessPath.______________r_n
push str.SDSystem
push 1
push 0x591d24
call fcn.00469d00
add esp, 0x10
mov eax, dword [esp + 0x4a8]
xor ebp, ebp
cmp eax, esi
jne 0x40ccaa
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.0040cf00
add esp, 0xc
test eax, eax
je 0x40c8ce
mov eax, dword [0x5925b8]
mov word [esp + 0x40], 0x2e
cmp eax, esi
je 0x40c850
lea ecx, [esp + 0x40]
push ecx
push str.CSDViewerApp::GetTargetProcessPath._Ext__s__r_n
push str.SDSystem
push ebp
push 0x591d24
call fcn.00469d00
add esp, 0x14
mov eax, dword [0x593f6c]
mov ebp, 2
cmp eax, esi
mov dword [esp + 0x20], 0x104
je 0x40c8ce
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 [0x5925b8], esi
je 0x40c8aa
lea eax, [esp + 0x80]
push eax
push 0x56cd98
push str.SDSystem
push 1
push 0x591d24
call fcn.00469d00
add esp, 0x14
lea ecx, [esp + 0x80]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40c8ce
lea edx, [esp + 0x80]
lea ecx, [esp + 0x14]
push edx
call fcn.0043c060
mov eax, dword [esp + 0x14]
cmp dword [eax - 8], esi
jne 0x40ccaa
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 0x40c956
lea ecx, [esp + 0x80]
mov ebp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40ccaa
lea edx, [esp + 0x80]
lea ecx, [esp + 0x14]
push edx
call fcn.0043c060
jmp 0x40ccaa
push 0x583998
lea ecx, [esp + 0x24]
mov ebp, 5
call fcn.0043b640
push ebx
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], 2
call fcn.0043b640
mov bl, 3
push 0x2e
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], bl
call fcn.0043cf90
cmp eax, 0xffffffff
je 0x40c9c5
push eax
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x24]
call fcn.0043e0d0
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x49c], 4
call fcn.0043bf70
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], bl
call fcn.0043bde0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x498], 2
call fcn.0043bde0
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx - 8]
test eax, eax
je 0x40cc97
push 0x583998
lea ecx, [esp + 0x20]
mov ebp, 6
call fcn.0043b640
lea ecx, [esp + 0x2c]
mov byte [esp + 0x498], 5
call fcn.004490b0
mov edx, dword [esp + 0x20]
push 0x20019
push edx
push SysReAllocStringLen
lea ecx, [esp + 0x38]
mov byte [esp + 0x4a4], 6
call fcn.00449220
test eax, eax
je 0x40ca69
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x34]
call fcn.00449850
push eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], 7
call fcn.0043bf70
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], 6
call fcn.0043bde0
lea ecx, [esp + 0x2c]
call fcn.00449270
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx - 8]
test eax, eax
je 0x40cc75
push 0x583998
lea ecx, [esp + 0x1c]
mov ebp, 7
call fcn.0043b640
lea ecx, [esp + 0x34]
mov byte [esp + 0x498], 8
call fcn.004490b0
push str._shellopencommand
lea ecx, [esp + 0x20]
mov byte [esp + 0x49c], 9
call fcn.0043ca30
mov edx, dword [esp + 0x1c]
push 0x20019
push edx
push SysReAllocStringLen
lea ecx, [esp + 0x40]
call fcn.00449220
test eax, eax
je 0x40cb0a
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x3c]
call fcn.00449850
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x49c], 0xa
call fcn.0043bf70
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], 9
call fcn.0043bde0
lea ecx, [esp + 0x34]
call fcn.00449270
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx - 8]
test eax, eax
je 0x40cc53
lea ecx, [esp + 0x18]
call fcn.0043fb10
lea ecx, [esp + 0x18]
call fcn.0043f7f0
mov edx, dword [esp + 0x18]
cmp word [edx], 0x22
jne 0x40cb93
push 1
push 0x56cd94
lea ecx, [esp + 0x20]
mov ebp, 9
call fcn.0043d000
dec eax
lea ecx, [esp + 0x18]
push eax
lea eax, [esp + 0x14]
push 1
push eax
call fcn.0043e100
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x498], 0xb
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40cb82
lea edx, [esp + 0x10]
lea ecx, [esp + 0x14]
push edx
call fcn.0043bf70
mov byte [esp + 0x498], 9
lea ecx, [esp + 0x10]
jmp 0x40cc4e
mov ebp, 0xa
xor esi, esi
mov bl, 0xc
push 0x583998
lea ecx, [esp + 0x14]
call fcn.0043b640
push esi
push 0x56cd90
lea ecx, [esp + 0x20]
mov byte [esp + 0x4a0], bl
call fcn.0043d000
mov esi, eax
cmp esi, 0xffffffff
je 0x40cbfa
lea eax, [esp + 0x24]
push esi
push eax
lea ecx, [esp + 0x20]
call fcn.0043e520
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x49c], 0xd
call fcn.0043bf70
lea ecx, [esp + 0x24]
mov byte [esp + 0x498], bl
call fcn.0043bde0
jmp 0x40cc08
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x14]
call fcn.0043bf70
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40cc34
lea ecx, [esp + 0x10]
mov byte [esp + 0x498], 9
call fcn.0043bde0
cmp esi, 0xffffffff
jne 0x40cb9c
jmp 0x40cc53
lea eax, [esp + 0x10]
lea ecx, [esp + 0x14]
push eax
call fcn.0043bf70
mov byte [esp + 0x498], 9
lea ecx, [esp + 0x10]
call fcn.0043bde0
lea ecx, [esp + 0x34]
mov byte [esp + 0x498], 8
call fcn.004491a0
lea ecx, [esp + 0x18]
mov byte [esp + 0x498], 6
call fcn.0043bde0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x498], 5
call fcn.004491a0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x498], 2
call fcn.0043bde0
lea ecx, [esp + 0x20]
mov byte [esp + 0x498], 1
call fcn.0043bde0
xor esi, esi
mov ecx, dword [esp + 0x14]
cmp dword [ecx - 8], esi
jne 0x40ce36
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 0x40cd2e
lea ecx, [esp + 0x80]
call fcn.00521094
cmp eax, 1
jne 0x40cd2e
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.0043bf70
lea ecx, [esp + 0x24]
mov byte [esp + 0x498], bl
call fcn.0043bde0
lea ecx, [esp + 0x1a4]
mov byte [esp + 0x498], 0x1a
call fcn.0051f639
lea ecx, [esp + 0x168]
mov byte [esp + 0x498], 0x19
call fcn.0052e223
lea ecx, [esp + 0x12c]
mov byte [esp + 0x498], 0x18
call fcn.0052e223
mov eax, dword [esp + 0x11c]
mov byte [esp + 0x498], 0x17
cmp eax, esi
je 0x40cd86
push eax
call fcn.00520a33
add esp, 4
mov eax, dword [esp + 0x10c]
mov byte [esp + 0x498], 0x16
cmp eax, esi
je 0x40cda2
push eax
call fcn.00520a33
add esp, 4
mov eax, dword [esp + 0xfc]
mov byte [esp + 0x498], 0x15
cmp eax, esi
je 0x40cdbe
push eax
call fcn.00520a33
add esp, 4
lea ecx, [esp + 0xec]
mov byte [esp + 0x498], 0x14
call fcn.0043bde0
lea ecx, [esp + 0xe8]
mov byte [esp + 0x498], 0x13
call fcn.0043bde0
lea ecx, [esp + 0xe4]
mov byte [esp + 0x498], 0x12
call fcn.0043bde0
lea ecx, [esp + 0xe0]
mov byte [esp + 0x498], 0x11
call fcn.0043bde0
lea ecx, [esp + 0xdc]
mov byte [esp + 0x498], 0x10
call fcn.0043bde0
lea ecx, [esp + 0x80]
mov byte [esp + 0x498], 1
call fcn.00520bda
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x2c]
call fcn.0043b3e0
mov esi, dword [esp + 0x28]
push 0x104
push 0x104
lea ecx, [esp + 0x1c]
mov byte [esp + 0x4a0], 0x1b
call fcn.0043cab0
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
push 0xffffffffffffffff
lea ecx, [esp + 0x18]
call fcn.0043cb80
mov eax, dword [0x5925b8]
test eax, eax
je 0x40ce9e
mov edx, dword [esp + 0x14]
push ebp
push edx
push str.CSDViewerApp::GetTargetProcessPath.__s__Debug__d__r_n
push str.SDSystem
push 1
push 0x591d24
call fcn.00469d00
add esp, 0x18
mov esi, dword [esp + 0x4a0]
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call fcn.0043b3e0
mov dword [esp + 0x3c], 1
lea ecx, [esp + 0x28]
mov byte [esp + 0x498], 1
call fcn.0043bde0
lea ecx, [esp + 0x14]
mov byte [esp + 0x498], 0
call fcn.0043bde0
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