Function at 0x43155c
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 0x431d1e
mov ecx, dword [ebx + 0xf0]
cmp ecx, 0xfffffffc
je 0x431caa
cmp ecx, 0xfffffffd
je 0x4315cc
cmp ecx, 0xfffffffe
jne 0x4315b3
test byte [ebx + 0x161], 4
je 0x431674
test byte [ebx + 0x158], 1
jne 0x431674
jmp 0x4315ee
cmp ecx, 0xffffffff
jne 0x4315f0
test byte [ebx + 0x161], 4
je 0x43163a
test byte [ebx + 0x158], 1
jne 0x43163a
jmp 0x4315f0
movzx eax, byte [ebx + 0x161]
test al, 4
je 0x4316ae
test byte [ebx + 0x158], 1
jne 0x4316ae
jne 0x431674
jne 0x43163a
mov edx, dword [esi + 4]
test edx, edx
je 0x431822
lea ecx, [ebp - 0x121]
mov eax, dword [esi + 8]
mov dword [ebp - 8], ecx
cmp eax, 0x100
jle 0x431613
mov eax, 0x100
mov dword [ebp - 4], eax
push eax
push edx
push ecx
call fcn.004b1140
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 0x4316ec
push str.FOR_PRINT
call fcn.00460630
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x4319e0
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x431672
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x43165d
dec eax
jmp 0x4316e6
push str.FOR_TYPE
call fcn.00460630
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x431a06
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4316ac
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431697
dec eax
jmp 0x4316e6
push str.FOR_ACCEPT
call fcn.00460630
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x431c84
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4316e6
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4316d1
dec eax
movsx edx, byte [edi]
mov dword [ebp - 4], eax
cmp edx, 0x20
jne 0x431702
test eax, eax
jle 0x43171c
inc edi
mov dword [ebp - 8], edi
dec eax
cmp byte [edi], 0x20
mov dword [ebp - 4], eax
je 0x4316f1
test eax, eax
jle 0x43171c
movsx edx, byte [eax + edi - 1]
cmp edx, 0x20
je 0x431714
test edx, edx
jne 0x43174a
dec eax
mov dword [ebp - 4], eax
test eax, eax
jg 0x431706
jne 0x43174a
test byte [ebx + 0x161], 4
je 0x43174a
lea edx, [ebp - 8]
lea ecx, [ebp - 4]
mov eax, ebx
call fcn.00431d60
test eax, eax
jne 0x43173d
mov edi, dword [ebp - 8]
jmp 0x43174a
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 0x431754
xor ecx, ecx
jmp 0x4317c5
mov eax, dword [ebp - 4]
mov byte [edi + eax], 0
push edi
push ebx
call fcn.00417710
add esp, 8
cmp eax, 0xffffffff
je 0x431a43
cmp dword [0x53a7a0], 0
jne 0x43177c
cmp eax, 0xfffffffa
je 0x4317af
cmp eax, 1
je 0x4317af
test eax, eax
jne 0x43178f
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x4317b7
cmp eax, 2
jne 0x43179e
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x4317b7
mov edi, dword [ebp - 8]
mov dword [ebp - 0x1c], 0
mov ecx, 1
jmp 0x4317c5
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, dword [ebp - 8]
mov dword [ebx + 0xd4], 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 0x4317c8
cmp dword [0x53a7a0], 0
mov edx, dword [ebp + 0x14]
je 0x4317f3
cmp dword [ebp - 0x1c], 0
jne 0x431802
cmp dword [ebx + 0xd4], 0xffffffff
je 0x431a2c
jmp 0x431802
cmp dword [ebp - 0x1c], 0
jne 0x431802
cmp dword [ebx + 0xd4], 0xffffffff
je 0x431806
test ecx, ecx
je 0x43180e
mov dword [edx], 1
jmp 0x431813
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.004612a0
lea eax, [ebp - 0x121]
push eax
call fcn.00460630
add esp, 0x10
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x431877
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x431865
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431850
dec eax
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], eax
jmp 0x4316ec
mov eax, dword [ebx + 0xf0]
add eax, 4
cmp eax, 0xa
ja case.0x43188c.1
mov eax, dword [eax*4 + 0x507e2c]
jmp eax
mov dword [ebp - 0x1c], 1
jmp 0x43191f
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501878
mov dword [ebx + 0xd4], eax
mov edi, 0x501878
jmp 0x4318ec
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501878
mov dword [ebx + 0xd4], eax
mov edi, 0x501878
jmp 0x4318ec
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501870
mov dword [ebx + 0xd4], eax
mov edi, 0x501870
test edi, edi
je 0x4319d4
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x43190d
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4318f8
dec eax
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], eax
jmp 0x4316ec
test byte [ebx + 0x161], 4
jne 0x4319bd
test byte [ebx + 0x159], 0x20
je 0x431972
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 0x431954
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x43193f
dec eax
cmp dword [esi], 0
mov dword [ebp - 4], eax
je 0x43196a
mov dword [esi], 0
movsx edx, byte [edi]
jmp 0x4316ec
movsx edx, byte [edi]
jmp 0x4316ec
push dword [ebx + 0xf0]
push str.fort._d
lea eax, [ebp - 0x121]
push eax
call fcn.004612a0
add esp, 0xc
lea ecx, [ebp - 0x121]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4319a9
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431994
dec eax
mov dword [ebp - 4], eax
lea edi, [ebp - 0x121]
movsx edx, byte [edi]
mov dword [ebp - 8], edi
jmp 0x4316ec
lea edi, [ebp - 0x121]
mov dword [ebp - 8], edi
xor edx, edx
mov dword [ebp - 4], edx
mov byte [edi], dl
xor eax, eax
jmp 0x4316ec
mov dword [ebp - 0x1c], 0
jmp 0x43191f
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501878
mov dword [ebx + 0xd4], eax
mov edi, 0x501878
mov dword [ebp - 0x1c], 0
jmp 0x431659
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501878
mov dword [ebx + 0xd4], eax
mov edi, 0x501878
mov dword [ebp - 0x1c], 0
jmp 0x431693
test ecx, ecx
jne 0x431806
mov dword [ebx + 0xd4], 0
jmp 0x43180e
mov edx, dword [esi + 0xc]
test byte [ebx + 0x161], 8
jne 0x431a59
test edx, edx
je 0x431b56
jmp 0x431a61
test edx, edx
je 0x431c5e
mov edi, dword [esi + 0x10]
lea eax, [edi + 1]
cmp eax, 0x100
jle 0x431a80
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.004b1140
add esp, 0xc
mov byte [ebp + edi - 0x222], 0
lea edx, [ebp - 0x222]
cmp byte [ebp - 0x222], 0x20
jne 0x431ab3
test edi, edi
jle 0x431ace
inc edx
dec edi
cmp byte [edx], 0x20
je 0x431aa8
test edi, edi
jle 0x431ace
movsx eax, byte [edi + edx - 1]
cmp eax, 0x20
je 0x431ac9
test eax, eax
jne 0x431b89
dec edi
test edi, edi
jg 0x431ab7
mov dword [ebp - 0x424], 0
cmp dword [esi], 3
je 0x431ba5
mov eax, dword [ebp - 0x424]
add eax, dword [ebp - 4]
add eax, edi
cmp eax, 0x100
jle 0x431b05
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.004b1140
add esp, 0xc
cmp dword [ebp - 0x424], 0
je 0x431b22
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.004b1140
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 0x4317d2
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 0x431b80
cmp eax, 0x101
jae 0x431b80
mov dword [ebp - 8], edi
mov dword [ebp - 4], eax
xor edx, edx
xor edi, edi
jmp 0x431ace
test edi, edi
jle 0x431ace
xor eax, eax
cmp byte [edi + edx], 0x5c
setne al
mov dword [ebp - 0x424], eax
jmp 0x431ad8
test byte [ebx + 0x159], 0x20
jne 0x431ae1
cmp dword [esi + 0xc], 0
je 0x431bf0
lea edi, [ebp - 0x323]
push edi
push 0
push 0x507fd0
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test byte [ebx + 0x161], 8
je 0x431bdc
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 0x431bdf
xor ecx, ecx
jmp 0x4317d2
test byte [ebx + 0x161], 8
je 0x431c0f
mov byte [ebp - 0x424], 0x2e
lea edx, [ebp - 0x424]
mov byte [ebp - 0x423], 0
jmp 0x431bb8
push str.FORT_TMPDIR
call fcn.00460630
pop ecx
test eax, eax
je 0x431c38
lea esi, [ebp - 0x424]
mov edi, eax
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x431c26
lea edx, [ebp - 0x424]
jmp 0x431bb8
lea esi, [ebp - 0x424]
push esi
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
mov edx, esi
jne 0x431bb8
mov edx, 0
jmp 0x431bb8
cmp dword [esi], 3
je 0x431c6d
mov edi, dword [ebp - 8]
xor ecx, ecx
jmp 0x4317c5
test byte [ebx + 0x159], 0x20
je 0x431b56
mov edi, dword [ebp - 8]
xor ecx, ecx
jmp 0x4317c5
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501870
mov dword [ebx + 0xd4], eax
mov edi, 0x501870
mov dword [ebp - 0x1c], 0
jmp 0x4316cd
movzx eax, byte [ebx + 0x161]
test al, 4
je 0x431cc2
test byte [ebx + 0x158], 1
je 0x4315d3
push str.FOR_READ
call fcn.00460630
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x431cfb
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x431cf6
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431ce1
dec eax
jmp 0x4316e6
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x501870
mov dword [ebx + 0xd4], eax
mov edi, 0x501870
mov dword [ebp - 0x1c], 0
jmp 0x431cdd
test byte [ebx + 0x159], 0x20
jne 0x43157e
push str.SCRATCH
lea edi, [ebp - 0x121]
push edi
call fcn.004612a0
add esp, 8
mov dword [ebp - 4], 7
mov dword [ebp - 8], edi
mov eax, 7
mov dword [ebp - 0x1c], 1
jmp 0x431757