Function at 0x4315b9
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x434
mov dword [ebp - 0x1c], ebx
mov ebx, edx
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], eax
cmp dword [ebx], 3
je 0x431a0b
mov eax, dword [eax + 0x100]
cmp eax, 0xfffffffc
je 0x4319ac
cmp eax, 0xfffffffd
je 0x4312e3
cmp eax, 0xfffffffe
jne 0x4312cd
mov edx, dword [ebp - 0xc]
test byte [edx + 0x171], 4
je 0x43136a
jmp 0x431a59
cmp eax, 0xffffffff
jne 0x431307
mov edx, dword [ebp - 0xc]
test byte [edx + 0x171], 4
je 0x43134e
jmp 0x431a47
mov edx, dword [ebp - 0xc]
movzx ecx, byte [edx + 0x171]
test cl, 4
je 0x431386
test byte [edx + 0x168], 1
jne 0x431386
jne 0x43136a
jne 0x43134e
mov edx, dword [ebx + 4]
test edx, edx
je 0x431508
mov eax, dword [ebx + 8]
cmp eax, 0x100
lea ecx, [ebp - 0x125]
mov dword [ebp - 8], ecx
jl 0x43132a
mov eax, 0x100
push eax
push edx
push ecx
mov dword [ebp - 4], eax
call fcn.004b9600
add esp, 0xc
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov dword [ebp - 0x20], 1
mov byte [edi + eax], 0
movsx edx, byte [edi]
jmp 0x4313c6
push str.FOR_PRINT
call fcn.0046fa20
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x4316d2
jmp 0x4313a0
push str.FOR_TYPE
call fcn.0046fa20
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x4316fb
jmp 0x4313a0
push str.FOR_ACCEPT
call fcn.0046fa20
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x431983
mov dword [ebp - 0x20], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4313c0
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4313ab
dec eax
mov dword [ebp - 4], eax
movsx edx, byte [edi]
cmp edx, 0x20
jne 0x4313dc
test eax, eax
jle 0x4313f6
inc edi
dec eax
mov dword [ebp - 8], edi
mov dword [ebp - 4], eax
cmp byte [edi], 0x20
je 0x4313cb
test eax, eax
jle 0x4313f6
movsx edx, byte [eax + edi - 1]
cmp edx, 0x20
je 0x4313ee
test edx, edx
jne 0x431425
dec eax
mov dword [ebp - 4], eax
test eax, eax
jg 0x4313e0
jne 0x431425
mov eax, dword [ebp - 0xc]
test byte [eax + 0x171], 4
je 0x431425
lea edx, [ebp - 8]
lea ecx, [ebp - 4]
call fcn.00431a70
test eax, eax
jne 0x431418
mov edi, dword [ebp - 8]
jmp 0x431425
mov ebx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x20], 0
jne 0x43142f
xor ebx, ebx
jmp 0x4314a5
mov eax, dword [ebp - 4]
push edi
mov byte [edi + eax], 0
push dword [ebp - 0xc]
call fcn.0041b730
add esp, 8
cmp eax, 0xffffffff
je 0x431740
cmp dword [0x707860], 0
jne 0x431459
cmp eax, 0xfffffffa
je 0x43148c
cmp eax, 1
je 0x43148c
test eax, eax
jne 0x43146c
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x431494
cmp eax, 2
jne 0x43147b
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x431494
mov dword [ebp - 0x20], 0
mov ebx, 1
mov edi, dword [ebp - 8]
jmp 0x4314a5
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
xor ebx, ebx
mov edi, dword [ebp - 8]
mov dword [ebp - 0x20], ebx
mov dword [edx + 0xe4], eax
mov esi, dword [ebp - 0x10]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x4314a8
mov eax, dword [ebp + 0x14]
cmp dword [0x707860], 0
je 0x4314d6
cmp dword [ebp - 0x20], 0
jne 0x4314e8
mov edx, dword [ebp - 0xc]
cmp dword [edx + 0xe4], 0xffffffff
je 0x431724
jmp 0x4314e8
cmp dword [ebp - 0x20], 0
jne 0x4314e8
mov edx, dword [ebp - 0xc]
cmp dword [edx + 0xe4], 0xffffffff
je 0x4314ec
test ebx, ebx
je 0x4314f4
mov dword [eax], 1
jmp 0x4314f9
mov edx, dword [ebp - 0x20]
mov dword [eax], edx
xor eax, eax
mov ebx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret
push eax
push str.FORT_d
lea edx, [ebp - 0x125]
push edx
call fcn.004707b0
lea eax, [ebp - 0x125]
push eax
call fcn.0046fa20
add esp, 0x10
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x43155d
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x43154b
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431536
dec eax
mov dword [ebp - 4], eax
movsx edx, byte [edi]
mov dword [ebp - 0x20], 1
jmp 0x4313c6
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x100]
add eax, 4
cmp eax, 0xa
ja case.0x431579.1
mov eax, dword [eax*4 + 0x4dac58]
jmp eax
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONOUT_
mov dword [ebp - 8], str.CONOUT_
mov dword [edx + 0xe4], eax
jmp 0x4315d6
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONOUT_
mov dword [ebp - 8], str.CONOUT_
mov dword [edx + 0xe4], eax
jmp 0x4315d6
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONIN_
mov dword [ebp - 8], str.CONIN_
mov dword [edx + 0xe4], eax
test edi, edi
je 0x4316c6
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4315f7
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4315e2
dec eax
mov dword [ebp - 4], eax
movsx edx, byte [edi]
mov dword [ebp - 0x20], 0
jmp 0x4313c6
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0xc]
test byte [eax + 0x171], 4
jne 0x4316b1
test byte [eax + 0x169], 0x20
je 0x431666
mov edi, dword [eax + 0x60]
mov ecx, edi
mov dword [ebp - 8], edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x431648
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431633
dec eax
mov dword [ebp - 4], eax
cmp dword [ebx], 0
je 0x43165e
mov dword [ebx], 0
movsx edx, byte [edi]
jmp 0x4313c6
movsx edx, byte [edi]
jmp 0x4313c6
lea edx, [ebp - 0x125]
push dword [eax + 0x100]
push str.fort._d
push edx
call fcn.004707b0
add esp, 0xc
lea ecx, [ebp - 0x125]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x43169d
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x431688
dec eax
mov dword [ebp - 4], eax
lea edi, [ebp - 0x125]
mov dword [ebp - 8], edi
movsx edx, byte [edi]
jmp 0x4313c6
xor eax, eax
lea edi, [ebp - 0x125]
mov dword [ebp - 8], edi
mov byte [edi], al
mov dword [ebp - 4], eax
jmp 0x4313f8
mov dword [ebp - 0x20], 0
jmp 0x431610
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONOUT_
mov dword [ebp - 8], str.CONOUT_
mov dword [ebp - 0x20], 0
mov dword [edx + 0xe4], eax
jmp 0x4313a7
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONOUT_
mov dword [ebp - 8], str.CONOUT_
mov dword [ebp - 0x20], 0
mov dword [edx + 0xe4], eax
jmp 0x4313a7
test ebx, ebx
jne 0x4314ec
mov ecx, dword [ebp - 0x20]
mov dword [edx + 0xe4], 0
mov dword [eax], ecx
jmp 0x4314f9
mov eax, dword [ebp - 0xc]
mov edx, dword [ebx + 0xc]
test byte [eax + 0x171], 8
jne 0x431759
test edx, edx
je 0x431854
jmp 0x431761
test edx, edx
je 0x43195d
mov edi, dword [ebx + 0x10]
cmp edi, 0xff
jle 0x43177e
mov eax, 0x2b
mov ebx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret
push edi
push edx
lea eax, [ebp - 0x226]
push eax
call fcn.004b9600
add esp, 0xc
mov byte [ebp + edi - 0x226], 0
lea esi, [ebp - 0x226]
cmp byte [ebp - 0x226], 0x20
jne 0x4317b1
test edi, edi
jle 0x4317cc
inc esi
dec edi
cmp byte [esi], 0x20
je 0x4317a6
test edi, edi
jle 0x4317cc
movsx eax, byte [edi + esi - 1]
cmp eax, 0x20
je 0x4317c7
test eax, eax
jne 0x431887
dec edi
test edi, edi
jg 0x4317b5
mov dword [ebp - 0x428], 0
cmp dword [ebx], 3
je 0x43189b
mov eax, dword [ebp - 0x428]
add eax, dword [ebp - 4]
add eax, edi
cmp eax, 0x100
jle 0x431803
mov eax, 0x2b
mov ebx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret
push edi
push esi
push dword [ebp - 0x10]
call fcn.004b9600
add esp, 0xc
cmp dword [ebp - 0x428], 0
je 0x431820
mov eax, dword [ebp - 0x10]
mov byte [eax + edi], 0x5c
mov eax, dword [ebp - 0x428]
mov esi, dword [ebp - 0x10]
push dword [ebp - 4]
push dword [ebp - 8]
lea edx, [esi + eax]
add edx, edi
push edx
call fcn.004b9600
add esp, 0xc
mov eax, dword [ebp - 4]
xor ebx, ebx
add eax, dword [ebp - 0x10]
add edi, dword [ebp - 0x428]
mov byte [edi + eax], 0
jmp 0x4314b2
lea eax, [ebp - 0x24]
push eax
lea esi, [ebp - 0x226]
push esi
push 0x101
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x43187e
cmp eax, 0x101
jae 0x43187e
mov dword [ebp - 8], esi
mov dword [ebp - 4], eax
xor esi, esi
xor edi, edi
jmp 0x4317cc
xor eax, eax
cmp byte [edi + esi], 0x5c
setne al
mov dword [ebp - 0x428], eax
jmp 0x4317d6
mov eax, dword [ebp - 0xc]
test byte [eax + 0x169], 0x20
jne 0x4317df
cmp dword [ebx + 0xc], 0
je 0x4318ec
lea edi, [ebp - 0x327]
push edi
push 0
push 0x4dae00
push esi
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov eax, dword [ebp - 0xc]
test byte [eax + 0x171], 8
je 0x4318d8
lea edi, [ebp - 0x325]
mov esi, dword [ebp - 0x10]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x4318db
xor ebx, ebx
jmp 0x4314b2
test byte [eax + 0x171], 8
je 0x43190b
mov byte [ebp - 0x428], 0x2e
lea esi, [ebp - 0x428]
mov byte [ebp - 0x427], 0
jmp 0x4318b1
push str.FORT_TMPDIR
call fcn.0046fa20
add esp, 4
test eax, eax
je 0x431939
mov edi, eax
lea esi, [ebp - 0x428]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x431924
lea esi, [ebp - 0x428]
jmp 0x4318b1
lea esi, [ebp - 0x428]
push esi
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x4318b1
mov esi, 0
jmp 0x4318b1
cmp dword [ebx], 3
je 0x43196c
mov edi, dword [ebp - 8]
xor ebx, ebx
jmp 0x4314a5
test byte [eax + 0x169], 0x20
je 0x431854
mov edi, dword [ebp - 8]
xor ebx, ebx
jmp 0x4314a5
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONIN_
mov dword [ebp - 8], str.CONIN_
mov dword [ebp - 0x20], 0
mov dword [edx + 0xe4], eax
jmp 0x4313a7
mov edx, dword [ebp - 0xc]
movzx ecx, byte [edx + 0x171]
test cl, 4
je 0x4319c8
test byte [edx + 0x168], 1
je 0x4312ed
push str.FOR_READ
call fcn.0046fa20
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
jne 0x4313a0
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edx, dword [ebp - 0xc]
mov edi, str.CONIN_
mov dword [ebp - 8], str.CONIN_
mov dword [ebp - 0x20], 0
mov dword [edx + 0xe4], eax
jmp 0x4313a7
test byte [eax + 0x169], 0x20
jne 0x43129f
push str.SCRATCH
lea edi, [ebp - 0x125]
push edi
call fcn.004707b0
add esp, 8
mov dword [ebp - 8], edi
mov eax, 7
mov dword [ebp - 4], 7
mov dword [ebp - 0x20], 1
jmp 0x431432
test byte [edx + 0x168], 1
jne 0x43134e
jmp 0x431307
test byte [edx + 0x168], 1
jne 0x43136a
jmp 0x431305