Function at 0x495d6c
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x43c
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ecx
mov esi, edx
mov ebx, eax
mov eax, dword [esi]
cmp eax, 3
je 0x496572
mov eax, dword [ebx + 0xf0]
cmp eax, 0xfffffffc
je 0x4964fa
cmp eax, 0xfffffffd
je 0x495dd2
cmp eax, 0xfffffffe
jne 0x495dbb
movzx edx, byte [ebx + 0x161]
test dl, 4
je 0x495ea4
jmp 0x495df2
cmp eax, 0xffffffff
jne 0x495e0e
movzx edx, byte [ebx + 0x161]
test dl, 4
je 0x495e6a
jmp 0x495e02
movzx edx, byte [ebx + 0x161]
test dl, 4
je 0x495ede
movzx edx, byte [ebx + 0x158]
test dl, 1
jne 0x495ede
movzx edx, byte [ebx + 0x158]
test dl, 1
jne 0x495ea4
movzx edx, byte [ebx + 0x158]
test dl, 1
jne 0x495e6a
mov edx, dword [esi + 4]
test edx, edx
je 0x496060
lea edi, [ebp - 0x124]
mov eax, dword [esi + 8]
mov dword [ebp - 8], edi
mov dword [ebp - 0x42c], edi
cmp eax, 0x100
jle 0x495e37
mov eax, 0x100
mov dword [ebp - 4], eax
push eax
mov dword [ebp - 0x430], eax
push edx
push edi
call fcn.004e26a0
mov edi, dword [ebp - 0x42c]
mov eax, dword [ebp - 0x430]
add esp, 0xc
mov byte [edi + eax], 0
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 1
jmp 0x495f1c
push str.FOR_PRINT
call fcn.004d29b8
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x496223
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x495ea2
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x495e8d
dec eax
jmp 0x495f16
push str.FOR_TYPE
call fcn.004d29b8
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x496249
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x495edc
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x495ec7
dec eax
jmp 0x495f16
push str.FOR_ACCEPT
call fcn.004d29b8
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x4964d4
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x495f16
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x495f01
dec eax
movsx edx, byte [edi]
mov dword [ebp - 4], eax
cmp edx, 0x20
jne 0x495f35
test eax, eax
jle 0x495f4f
inc edi
movsx edx, byte [edi]
mov dword [ebp - 8], edi
dec eax
cmp edx, 0x20
mov dword [ebp - 4], eax
je 0x495f21
test eax, eax
jle 0x495f4f
movsx edx, byte [eax + edi - 1]
cmp edx, 0x20
je 0x495f47
test edx, edx
jne 0x495f7f
dec eax
mov dword [ebp - 4], eax
test eax, eax
jg 0x495f39
jne 0x495f7f
movzx eax, byte [ebx + 0x161]
test al, 4
je 0x495f7f
lea edx, [ebp - 8]
lea ecx, [ebp - 4]
mov eax, ebx
call fcn.004965c0
test eax, eax
jne 0x495f72
mov edi, dword [ebp - 8]
jmp 0x495f7f
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x1c]
test eax, eax
jne 0x495f8a
xor ecx, ecx
jmp 0x495ffc
mov eax, dword [ebp - 4]
mov byte [edi + eax], 0
push edi
push ebx
call fcn.00487c40
add esp, 8
cmp eax, 0xffffffff
je 0x496286
mov edx, dword [0x5212e8]
test edx, edx
jne 0x495fb3
cmp eax, 0xfffffffa
je 0x495fe6
cmp eax, 1
je 0x495fe6
test eax, eax
jne 0x495fc6
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x495fee
cmp eax, 2
jne 0x495fd5
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x495fee
mov edi, dword [ebp - 8]
mov dword [ebp - 0x1c], 0
mov ecx, 1
jmp 0x495ffc
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 0x495fff
mov eax, dword [ebp + 0x14]
mov edx, dword [0x5212e8]
test edx, edx
je 0x49602e
mov edx, dword [ebp - 0x1c]
test edx, edx
jne 0x496040
mov edx, dword [ebx + 0xd4]
cmp edx, 0xffffffff
je 0x49626f
jmp 0x496040
mov edx, dword [ebp - 0x1c]
test edx, edx
jne 0x496040
mov edx, dword [ebx + 0xd4]
cmp edx, 0xffffffff
je 0x496044
test ecx, ecx
je 0x49604c
mov dword [eax], 1
jmp 0x496051
mov edx, dword [ebp - 0x1c]
mov dword [eax], edx
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
xor eax, eax
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x124]
push eax
push str.FORT_d
push edx
call fcn.004d2c54
lea eax, [ebp - 0x124]
push eax
call fcn.004d29b8
add esp, 0x10
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x4960b5
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4960a3
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x49608e
dec eax
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], eax
jmp 0x495f1c
mov eax, dword [ebx + 0xf0]
add eax, 4
cmp eax, 0xa
ja case.0x4960ca.1
mov eax, dword [eax*4 + 0x4fb258]
jmp eax
mov dword [ebp - 0x1c], 1
jmp 0x49615d
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4f5f6c
mov dword [ebx + 0xd4], eax
mov edi, 0x4f5f6c
jmp 0x49612a
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4f5f6c
mov dword [ebx + 0xd4], eax
mov edi, 0x4f5f6c
jmp 0x49612a
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], str.CONIN_
mov dword [ebx + 0xd4], eax
mov edi, str.CONIN_
test edi, edi
je 0x496217
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x49614b
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x496136
dec eax
movsx edx, byte [edi]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], eax
jmp 0x495f1c
movzx eax, byte [ebx + 0x161]
test al, 4
jne 0x496200
movzx eax, byte [ebx + 0x159]
test al, 0x20
je 0x4961b5
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 0x496196
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x496181
dec eax
mov edx, dword [esi]
mov dword [ebp - 4], eax
test edx, edx
je 0x4961ad
mov dword [esi], 0
movsx edx, byte [edi]
jmp 0x495f1c
movsx edx, byte [edi]
jmp 0x495f1c
push dword [ebx + 0xf0]
push str.fort._d
lea eax, [ebp - 0x124]
push eax
call fcn.004d2c54
add esp, 0xc
lea ecx, [ebp - 0x124]
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x4961ec
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x4961d7
dec eax
mov dword [ebp - 4], eax
lea edi, [ebp - 0x124]
movsx edx, byte [edi]
mov dword [ebp - 8], edi
jmp 0x495f1c
lea edi, [ebp - 0x124]
mov dword [ebp - 8], edi
xor edx, edx
mov dword [ebp - 4], edx
mov byte [edi], dl
xor eax, eax
jmp 0x495f1c
mov dword [ebp - 0x1c], 0
jmp 0x49615d
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4f5f6c
mov dword [ebx + 0xd4], eax
mov edi, 0x4f5f6c
mov dword [ebp - 0x1c], 0
jmp 0x495e89
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], 0x4f5f6c
mov dword [ebx + 0xd4], eax
mov edi, 0x4f5f6c
mov dword [ebp - 0x1c], 0
jmp 0x495ec3
test ecx, ecx
jne 0x496044
mov dword [ebx + 0xd4], 0
jmp 0x49604c
movzx eax, byte [ebx + 0x161]
test al, 8
jne 0x49629e
mov edx, dword [esi + 0xc]
test edx, edx
je 0x4963b3
jmp 0x4962a9
mov edx, dword [esi + 0xc]
test edx, edx
je 0x4964aa
mov edi, dword [esi + 0x10]
lea eax, [edi + 1]
cmp eax, 0x100
jle 0x4962c8
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov eax, 0x2b
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x228]
push edi
push edx
push eax
call fcn.004e26a0
add esp, 0xc
mov byte [ebp + edi - 0x228], 0
lea edx, [ebp - 0x228]
movsx eax, byte [edx]
cmp eax, 0x20
jne 0x4962fd
test edi, edi
jle 0x496318
inc edx
movsx eax, byte [edx]
dec edi
cmp eax, 0x20
je 0x4962ef
test edi, edi
jle 0x496318
movsx eax, byte [edi + edx - 1]
cmp eax, 0x20
je 0x496313
test eax, eax
jne 0x4963ec
dec edi
test edi, edi
jg 0x496301
mov dword [ebp - 0x42c], 0
mov eax, dword [esi]
cmp eax, 3
je 0x49640b
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x42c]
mov dword [ebp - 0x430], ecx
lea esi, [eax + ecx]
add esi, edi
cmp esi, 0x100
jle 0x49635b
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
mov eax, 0x2b
mov esp, ebp
pop ebp
ret
push edi
push edx
push dword [ebp - 0xc]
call fcn.004e26a0
add esp, 0xc
mov eax, dword [ebp - 0x42c]
test eax, eax
je 0x496379
mov eax, dword [ebp - 0xc]
mov byte [edi + eax], 0x5c
push dword [ebp - 0x430]
push dword [ebp - 8]
mov eax, dword [ebp - 0x42c]
mov esi, dword [ebp - 0xc]
lea edx, [esi + eax]
add edx, edi
push edx
call fcn.004e26a0
add esp, 0xc
add edi, dword [ebp - 0x42c]
mov eax, dword [ebp - 0xc]
xor ecx, ecx
add eax, dword [ebp - 0x430]
mov byte [edi + eax], 0
jmp 0x496009
lea edx, [ebp - 0x228]
lea eax, [ebp - 0x20]
push eax
push edx
push 0x101
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x4963e3
cmp eax, 0x101
jae 0x4963e3
lea edx, [ebp - 0x228]
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor edx, edx
xor edi, edi
jmp 0x496318
test edi, edi
jle 0x496318
movsx ecx, byte [edx + edi]
xor eax, eax
cmp ecx, 0x5c
setne al
mov dword [ebp - 0x42c], eax
jmp 0x496322
movzx eax, byte [ebx + 0x159]
test al, 0x20
jne 0x49632d
mov eax, dword [esi + 0xc]
test eax, eax
je 0x496463
lea eax, [ebp - 0x32c]
push eax
push 0
push 0x4fb3bc
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
movzx eax, byte [ebx + 0x161]
test al, 8
je 0x496449
lea edi, [ebp - 0x32a]
jmp 0x49644f
lea edi, [ebp - 0x32c]
mov esi, dword [ebp - 0xc]
mov dl, byte [edi]
inc edi
mov byte [esi], dl
inc esi
test dl, dl
jne 0x496452
xor ecx, ecx
jmp 0x496009
movzx eax, byte [ebx + 0x161]
test al, 8
je 0x496484
mov byte [ebp - 0x430], 0x2e
lea edx, [ebp - 0x430]
mov byte [ebp - 0x42f], 0
jmp 0x496421
lea eax, [ebp - 0x430]
push eax
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea edx, [ebp - 0x430]
test eax, eax
jne 0x496421
mov edx, 0
jmp 0x496421
mov eax, dword [esi]
cmp eax, 3
je 0x4964bb
mov edi, dword [ebp - 8]
xor ecx, ecx
jmp 0x495ffc
movzx eax, byte [ebx + 0x159]
test al, 0x20
je 0x4963b3
mov edi, dword [ebp - 8]
xor ecx, ecx
jmp 0x495ffc
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], str.CONIN_
mov dword [ebx + 0xd4], eax
mov edi, str.CONIN_
mov dword [ebp - 0x1c], 0
jmp 0x495efd
movzx edx, byte [ebx + 0x161]
test dl, 4
je 0x496516
movzx ecx, byte [ebx + 0x158]
test cl, 1
je 0x495dd9
push str.FOR_READ
call fcn.004d29b8
pop ecx
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x49654f
mov dword [ebp - 0x1c], 1
mov ecx, edi
xor eax, eax
movzx edx, byte [ecx + eax]
test edx, edx
je 0x49654a
movzx edx, byte [ecx + eax + 1]
add eax, 2
test edx, edx
jne 0x496535
dec eax
jmp 0x495f16
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 8], str.CONIN_
mov dword [ebx + 0xd4], eax
mov edi, str.CONIN_
mov dword [ebp - 0x1c], 0
jmp 0x496531
movzx eax, byte [ebx + 0x159]
test al, 0x20
jne 0x495d90
push str.SCRATCH
lea eax, [ebp - 0x124]
push eax
call fcn.004d2c54
add esp, 8
mov dword [ebp - 4], 7
lea edi, [ebp - 0x124]
mov eax, 7
mov dword [ebp - 8], edi
mov dword [ebp - 0x1c], 1
jmp 0x495f8d