Function at 0x42995c
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x430
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], ecx
mov esi, edx
cmp dword [esi], 3
mov ebx, eax
je 0x42a11c
mov ecx, dword [ebx + 0xf8]
cmp ecx, 0xfffffffc
je 0x42a0a8
cmp ecx, 0xfffffffd
je 0x4299cc
cmp ecx, 0xfffffffe
jne 0x4299b3
test byte [ebx + 0x169], 4
je 0x429a74
test byte [ebx + 0x160], 1
jne 0x429a74
jmp 0x4299ee
cmp ecx, 0xffffffff
jne 0x4299f0
test byte [ebx + 0x169], 4
je 0x429a3a
test byte [ebx + 0x160], 1
jne 0x429a3a
jmp 0x4299f0
movzx eax, byte [ebx + 0x169]
test al, 4
je 0x429aae
test byte [ebx + 0x160], 1
jne 0x429aae
jne 0x429a74
jne 0x429a3a
mov edx, dword [esi + 4]
test edx, edx
je 0x429c22
lea ecx, [ebp - 0x121]
mov eax, dword [esi + 8]
mov dword [ebp - 8], ecx
cmp eax, 0x100
jle 0x429a13
mov eax, 0x100
mov dword [ebp - 4], eax
push eax
push edx
push ecx
call fcn.004a62b0
add esp, 0xc
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov byte [edi + eax], 0
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 1
jmp 0x429aec
push str.FOR_PRINT
call fcn.00453930
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x429dde
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429a72
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429a5d
dec eax
jmp 0x429ae6
push str.FOR_TYPE
call fcn.00453930
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x429e04
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429aac
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429a97
dec eax
jmp 0x429ae6
push str.FOR_ACCEPT
call fcn.00453930
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x42a082
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429ae6
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429ad1
dec eax
movsx edx, byte [edi]
mov dword [ebp - 4], eax
cmp edx, 0x20
jne 0x429b02
test eax, eax
jle 0x429b1c
inc edi
mov dword [ebp - 8], edi
dec eax
cmp byte [edi], 0x20
mov dword [ebp - 4], eax
je 0x429af1
test eax, eax
jle 0x429b1c
movsx edx, byte [eax + edi - 1]
cmp edx, 0x20
je 0x429b14
test edx, edx
jne 0x429b4a
dec eax
mov dword [ebp - 4], eax
test eax, eax
jg 0x429b06
jne 0x429b4a
test byte [ebx + 0x169], 4
je 0x429b4a
lea edx, [ebp - 8]
lea ecx, [ebp - 4]
mov eax, ebx
call fcn.0042a160
test eax, eax
jne 0x429b3d
mov edi, dword [ebp - 8]
jmp 0x429b4a
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x1c], 0
jne 0x429b54
xor ecx, ecx
jmp 0x429bc5
mov eax, dword [ebp - 4]
mov byte [edi + eax], 0
push edi
push ebx
call fcn.00415620
add esp, 8
cmp eax, 0xffffffff
je 0x429e41
cmp dword [0x4edea0], 0
jne 0x429b7c
cmp eax, 0xfffffffa
je 0x429baf
cmp eax, 1
je 0x429baf
test eax, eax
jne 0x429b8f
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x429bb7
cmp eax, 2
jne 0x429b9e
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x429bb7
mov edi, dword [ebp - 8]
mov dword [ebp - 0x1c], 0
mov ecx, 1
jmp 0x429bc5
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, dword [ebp - 8]
mov dword [ebx + 0xdc], eax
xor ecx, ecx
mov dword [ebp - 0x1c], ecx
mov esi, dword [ebp - 0xc]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x429bc8
cmp dword [0x4edea0], 0
mov edx, dword [ebp + 0x14]
je 0x429bf3
cmp dword [ebp - 0x1c], 0
jne 0x429c02
cmp dword [ebx + 0xdc], 0xffffffff
je 0x429e2a
jmp 0x429c02
cmp dword [ebp - 0x1c], 0
jne 0x429c02
cmp dword [ebx + 0xdc], 0xffffffff
je 0x429c06
test ecx, ecx
je 0x429c0e
mov dword [edx], 1
jmp 0x429c13
mov eax, dword [ebp - 0x1c]
mov dword [edx], eax
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
xor eax, eax
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x121]
push ecx
push str.FORT_d
push eax
call fcn.004532e0
lea eax, [ebp - 0x121]
push eax
call fcn.00453930
add esp, 0x10
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x429c77
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429c65
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429c50
dec eax
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], eax
jmp 0x429aec
mov eax, dword [ebx + 0xf8]
add eax, 4
cmp eax, 0xa
ja case.0x429c8c.1
mov eax, dword [eax*4 + 0x4ca410]
jmp eax
mov dword [ebp - 0x1c], 1
jmp 0x429d1f
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7958
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7958
jmp 0x429cec
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7958
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7958
jmp 0x429cec
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7950
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7950
test edi, edi
je 0x429dd2
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429d0d
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429cf8
dec eax
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], eax
jmp 0x429aec
test byte [ebx + 0x169], 4
jne 0x429dbd
test byte [ebx + 0x161], 0x20
je 0x429d72
mov edi, dword [ebx + 0x60]
mov dword [ebp - 8], edi
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429d54
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429d3f
dec eax
cmp dword [esi], 0
mov dword [ebp - 4], eax
je 0x429d6a
mov dword [esi], 0
movsx edx, byte [edi]
jmp 0x429aec
movsx edx, byte [edi]
jmp 0x429aec
push dword [ebx + 0xf8]
push str.fort._d
lea eax, [ebp - 0x121]
push eax
call fcn.004532e0
add esp, 0xc
lea ecx, [ebp - 0x121]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x429da9
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x429d94
dec eax
mov dword [ebp - 4], eax
lea edi, [ebp - 0x121]
movsx edx, byte [edi]
mov dword [ebp - 8], edi
jmp 0x429aec
lea edi, [ebp - 0x121]
mov dword [ebp - 8], edi
xor eax, eax
mov dword [ebp - 4], eax
mov byte [edi], al
jmp 0x429b1e
mov dword [ebp - 0x1c], 0
jmp 0x429d1f
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7958
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7958
mov dword [ebp - 0x1c], 0
jmp 0x429a59
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7958
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7958
mov dword [ebp - 0x1c], 0
jmp 0x429a93
test ecx, ecx
jne 0x429c06
mov dword [ebx + 0xdc], 0
jmp 0x429c0e
mov edx, dword [esi + 0xc]
test byte [ebx + 0x169], 8
jne 0x429e57
test edx, edx
je 0x429f54
jmp 0x429e5f
test edx, edx
je 0x42a05c
mov edi, dword [esi + 0x10]
lea eax, [edi + 1]
cmp eax, 0x100
jle 0x429e7e
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
mov eax, 0x2b
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x222]
push edi
push edx
push eax
call fcn.004a62b0
add esp, 0xc
mov byte [ebp + edi - 0x222], 0
lea edx, [ebp - 0x222]
cmp byte [ebp - 0x222], 0x20
jne 0x429eb1
test edi, edi
jle 0x429ecc
inc edx
dec edi
cmp byte [edx], 0x20
je 0x429ea6
test edi, edi
jle 0x429ecc
movsx eax, byte [edi + edx - 1]
cmp eax, 0x20
je 0x429ec7
test eax, eax
jne 0x429f87
dec edi
test edi, edi
jg 0x429eb5
mov dword [ebp - 0x424], 0
cmp dword [esi], 3
je 0x429fa3
mov eax, dword [ebp - 0x424]
add eax, dword [ebp - 4]
add eax, edi
cmp eax, 0x100
jle 0x429f03
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
mov eax, 0x2b
mov esp, ebp
pop ebp
ret
push edi
push edx
push dword [ebp - 0xc]
call fcn.004a62b0
add esp, 0xc
cmp dword [ebp - 0x424], 0
je 0x429f20
mov eax, dword [ebp - 0xc]
mov byte [edi + eax], 0x5c
push dword [ebp - 4]
push dword [ebp - 8]
mov eax, dword [ebp - 0x424]
mov esi, dword [ebp - 0xc]
lea edx, [esi + eax]
add edx, edi
push edx
call fcn.004a62b0
add esp, 0xc
add edi, dword [ebp - 0x424]
mov eax, dword [ebp - 4]
xor ecx, ecx
add eax, dword [ebp - 0xc]
mov byte [edi + eax], 0
jmp 0x429bd2
lea edi, [ebp - 0x222]
lea eax, [ebp - 0x20]
push eax
push edi
push 0x101
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x429f7e
cmp eax, 0x101
jae 0x429f7e
mov dword [ebp - 8], edi
mov dword [ebp - 4], eax
xor edx, edx
xor edi, edi
jmp 0x429ecc
test edi, edi
jle 0x429ecc
xor eax, eax
cmp byte [edi + edx], 0x5c
setne al
mov dword [ebp - 0x424], eax
jmp 0x429ed6
test byte [ebx + 0x161], 0x20
jne 0x429edf
cmp dword [esi + 0xc], 0
je 0x429fee
lea edi, [ebp - 0x323]
push edi
push 0
push 0x4ca5b0
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test byte [ebx + 0x169], 8
je 0x429fda
lea edi, [ebp - 0x321]
mov esi, dword [ebp - 0xc]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x429fdd
xor ecx, ecx
jmp 0x429bd2
test byte [ebx + 0x169], 8
je 0x42a00d
mov byte [ebp - 0x424], 0x2e
lea edx, [ebp - 0x424]
mov byte [ebp - 0x423], 0
jmp 0x429fb6
push str.FORT_TMPDIR
call fcn.00453930
pop ecx
test eax, eax
je 0x42a036
lea esi, [ebp - 0x424]
mov edi, eax
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x42a024
lea edx, [ebp - 0x424]
jmp 0x429fb6
lea esi, [ebp - 0x424]
push esi
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
mov edx, esi
jne 0x429fb6
mov edx, 0
jmp 0x429fb6
cmp dword [esi], 3
je 0x42a06b
mov edi, dword [ebp - 8]
xor ecx, ecx
jmp 0x429bc5
test byte [ebx + 0x161], 0x20
je 0x429f54
mov edi, dword [ebp - 8]
xor ecx, ecx
jmp 0x429bc5
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7950
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7950
mov dword [ebp - 0x1c], 0
jmp 0x429acd
movzx eax, byte [ebx + 0x169]
test al, 4
je 0x42a0c0
test byte [ebx + 0x160], 1
je 0x4299d3
push str.FOR_READ
call fcn.00453930
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x42a0f9
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x42a0f4
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x42a0df
dec eax
jmp 0x429ae6
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4c7950
mov dword [ebx + 0xdc], eax
mov edi, 0x4c7950
mov dword [ebp - 0x1c], 0
jmp 0x42a0db
test byte [ebx + 0x161], 0x20
jne 0x42997e
push str.SCRATCH
lea edi, [ebp - 0x121]
push edi
call fcn.004532e0
add esp, 8
mov dword [ebp - 4], 7
mov dword [ebp - 8], edi
mov eax, 7
mov dword [ebp - 0x1c], 1
jmp 0x429b57