Function at 0x56c62a
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 0x56ca9b
mov eax, dword [eax + 0x100]
cmp eax, 0xfffffffc
je 0x56ca3c
cmp eax, 0xfffffffd
je 0x56c373
cmp eax, 0xfffffffe
jne 0x56c35d
mov edx, dword [ebp - 0xc]
test byte [edx + 0x171], 4
je 0x56c3fa
jmp 0x56cae9
cmp eax, 0xffffffff
jne 0x56c397
mov edx, dword [ebp - 0xc]
test byte [edx + 0x171], 4
je 0x56c3de
jmp 0x56cad7
mov edx, dword [ebp - 0xc]
movzx ecx, byte [edx + 0x171]
test cl, 4
je 0x56c416
test byte [edx + 0x168], 1
jne 0x56c416
jne 0x56c3fa
jne 0x56c3de
mov edx, dword [ebx + 4]
test edx, edx
je 0x56c598
mov eax, dword [ebx + 8]
cmp eax, 0x100
lea ecx, [ebp - 0x125]
mov dword [ebp - 8], ecx
jl 0x56c3ba
mov eax, 0x100
push eax
push edx
push ecx
mov dword [ebp - 4], eax
call fcn.0059f8e0
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 0x56c456
push str.FOR_PRINT
call fcn.0058dfb1
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x56c762
jmp 0x56c430
push str.FOR_TYPE
call fcn.0058dfb1
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x56c78b
jmp 0x56c430
push str.FOR_ACCEPT
call fcn.0058dfb1
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x56ca13
mov dword [ebp - 0x20], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x56c450
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x56c43b
dec eax
mov dword [ebp - 4], eax
movsx edx, byte [edi]
cmp edx, 0x20
jne 0x56c46c
test eax, eax
jle 0x56c486
inc edi
dec eax
mov dword [ebp - 8], edi
mov dword [ebp - 4], eax
cmp byte [edi], 0x20
je 0x56c45b
test eax, eax
jle 0x56c486
movsx edx, byte [eax + edi - 1]
cmp edx, 0x20
je 0x56c47e
test edx, edx
jne 0x56c4b5
dec eax
mov dword [ebp - 4], eax
test eax, eax
jg 0x56c470
jne 0x56c4b5
mov eax, dword [ebp - 0xc]
test byte [eax + 0x171], 4
je 0x56c4b5
lea edx, [ebp - 8]
lea ecx, [ebp - 4]
call fcn.0056cb00
test eax, eax
jne 0x56c4a8
mov edi, dword [ebp - 8]
jmp 0x56c4b5
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 0x56c4bf
xor ebx, ebx
jmp 0x56c535
mov eax, dword [ebp - 4]
push edi
mov byte [edi + eax], 0
push dword [ebp - 0xc]
call fcn.00551670
add esp, 8
cmp eax, 0xffffffff
je 0x56c7d0
cmp dword [0x5ec960], 0
jne 0x56c4e9
cmp eax, 0xfffffffa
je 0x56c51c
cmp eax, 1
je 0x56c51c
test eax, eax
jne 0x56c4fc
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x56c524
cmp eax, 2
jne 0x56c50b
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x56c524
mov dword [ebp - 0x20], 0
mov ebx, 1
mov edi, dword [ebp - 8]
jmp 0x56c535
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 0x56c538
mov eax, dword [ebp + 0x14]
cmp dword [0x5ec960], 0
je 0x56c566
cmp dword [ebp - 0x20], 0
jne 0x56c578
mov edx, dword [ebp - 0xc]
cmp dword [edx + 0xe4], 0xffffffff
je 0x56c7b4
jmp 0x56c578
cmp dword [ebp - 0x20], 0
jne 0x56c578
mov edx, dword [ebp - 0xc]
cmp dword [edx + 0xe4], 0xffffffff
je 0x56c57c
test ebx, ebx
je 0x56c584
mov dword [eax], 1
jmp 0x56c589
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.0058e246
lea eax, [ebp - 0x125]
push eax
call fcn.0058dfb1
add esp, 0x10
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x56c5ed
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x56c5db
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x56c5c6
dec eax
mov dword [ebp - 4], eax
movsx edx, byte [edi]
mov dword [ebp - 0x20], 1
jmp 0x56c456
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x100]
add eax, 4
cmp eax, 0xa
ja case.0x56c609.1
mov eax, dword [eax*4 + 0x5cd08c]
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 0x56c666
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 0x56c666
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 0x56c756
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x56c687
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x56c672
dec eax
mov dword [ebp - 4], eax
movsx edx, byte [edi]
mov dword [ebp - 0x20], 0
jmp 0x56c456
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0xc]
test byte [eax + 0x171], 4
jne 0x56c741
test byte [eax + 0x169], 0x20
je 0x56c6f6
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 0x56c6d8
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x56c6c3
dec eax
mov dword [ebp - 4], eax
cmp dword [ebx], 0
je 0x56c6ee
mov dword [ebx], 0
movsx edx, byte [edi]
jmp 0x56c456
movsx edx, byte [edi]
jmp 0x56c456
lea edx, [ebp - 0x125]
push dword [eax + 0x100]
push str.fort._d
push edx
call fcn.0058e246
add esp, 0xc
lea ecx, [ebp - 0x125]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x56c72d
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x56c718
dec eax
mov dword [ebp - 4], eax
lea edi, [ebp - 0x125]
mov dword [ebp - 8], edi
movsx edx, byte [edi]
jmp 0x56c456
xor eax, eax
lea edi, [ebp - 0x125]
mov dword [ebp - 8], edi
mov byte [edi], al
mov dword [ebp - 4], eax
jmp 0x56c488
mov dword [ebp - 0x20], 0
jmp 0x56c6a0
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 0x56c437
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 0x56c437
test ebx, ebx
jne 0x56c57c
mov ecx, dword [ebp - 0x20]
mov dword [edx + 0xe4], 0
mov dword [eax], ecx
jmp 0x56c589
mov eax, dword [ebp - 0xc]
mov edx, dword [ebx + 0xc]
test byte [eax + 0x171], 8
jne 0x56c7e9
test edx, edx
je 0x56c8e4
jmp 0x56c7f1
test edx, edx
je 0x56c9ed
mov edi, dword [ebx + 0x10]
cmp edi, 0xff
jle 0x56c80e
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.0059f8e0
add esp, 0xc
mov byte [ebp + edi - 0x226], 0
lea esi, [ebp - 0x226]
cmp byte [ebp - 0x226], 0x20
jne 0x56c841
test edi, edi
jle 0x56c85c
inc esi
dec edi
cmp byte [esi], 0x20
je 0x56c836
test edi, edi
jle 0x56c85c
movsx eax, byte [edi + esi - 1]
cmp eax, 0x20
je 0x56c857
test eax, eax
jne 0x56c917
dec edi
test edi, edi
jg 0x56c845
mov dword [ebp - 0x428], 0
cmp dword [ebx], 3
je 0x56c92b
mov eax, dword [ebp - 0x428]
add eax, dword [ebp - 4]
add eax, edi
cmp eax, 0x100
jle 0x56c893
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.0059f8e0
add esp, 0xc
cmp dword [ebp - 0x428], 0
je 0x56c8b0
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.0059f8e0
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 0x56c542
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 0x56c90e
cmp eax, 0x101
jae 0x56c90e
mov dword [ebp - 8], esi
mov dword [ebp - 4], eax
xor esi, esi
xor edi, edi
jmp 0x56c85c
xor eax, eax
cmp byte [edi + esi], 0x5c
setne al
mov dword [ebp - 0x428], eax
jmp 0x56c866
mov eax, dword [ebp - 0xc]
test byte [eax + 0x169], 0x20
jne 0x56c86f
cmp dword [ebx + 0xc], 0
je 0x56c97c
lea edi, [ebp - 0x327]
push edi
push 0
push 0x5cd22c
push esi
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov eax, dword [ebp - 0xc]
test byte [eax + 0x171], 8
je 0x56c968
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 0x56c96b
xor ebx, ebx
jmp 0x56c542
test byte [eax + 0x171], 8
je 0x56c99b
mov byte [ebp - 0x428], 0x2e
lea esi, [ebp - 0x428]
mov byte [ebp - 0x427], 0
jmp 0x56c941
push str.FORT_TMPDIR
call fcn.0058dfb1
add esp, 4
test eax, eax
je 0x56c9c9
mov edi, eax
lea esi, [ebp - 0x428]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x56c9b4
lea esi, [ebp - 0x428]
jmp 0x56c941
lea esi, [ebp - 0x428]
push esi
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x56c941
mov esi, 0
jmp 0x56c941
cmp dword [ebx], 3
je 0x56c9fc
mov edi, dword [ebp - 8]
xor ebx, ebx
jmp 0x56c535
test byte [eax + 0x169], 0x20
je 0x56c8e4
mov edi, dword [ebp - 8]
xor ebx, ebx
jmp 0x56c535
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 0x56c437
mov edx, dword [ebp - 0xc]
movzx ecx, byte [edx + 0x171]
test cl, 4
je 0x56ca58
test byte [edx + 0x168], 1
je 0x56c37d
push str.FOR_READ
call fcn.0058dfb1
add esp, 4
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
jne 0x56c430
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 0x56c437
test byte [eax + 0x169], 0x20
jne 0x56c32f
push str.SCRATCH
lea edi, [ebp - 0x125]
push edi
call fcn.0058e246
add esp, 8
mov dword [ebp - 8], edi
mov eax, 7
mov dword [ebp - 4], 7
mov dword [ebp - 0x20], 1
jmp 0x56c4c2
test byte [edx + 0x168], 1
jne 0x56c3de
jmp 0x56c397
test byte [edx + 0x168], 1
jne 0x56c3fa
jmp 0x56c395