Function at 0x416c00
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x424
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ebx, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0xc], 1
mov dword [ebp - 0x10], 0
cmp dword [edi], 3
jne 0x416c49
test byte [ebx + 0x128], 1
jne 0x416c49
mov edx, str.SCRATCH
mov ecx, 7
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
jmp 0x416f11
mov ecx, dword [ebx + 0xbc]
lea eax, [ecx + 4]
cmp eax, 3
ja case.default.0x416c60
mov edx, 0x400000
jmp dword [eax*4 + 0x417210]
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x416c7a
test dword [ebx + 0x128], edx
je case.0x416c60.3
push str.FOR_READ
call fcn.004191a4
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp - 4], edx
jne 0x416d1d
push 0xfffffffffffffff6
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [str.CONIN_]
jmp 0x416d13
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x416cb9
test dword [ebx + 0x128], edx
je case.0x416c60.2
push str.FOR_ACCEPT
jmp 0x416c7f
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x416cd3
test dword [ebx + 0x128], edx
je case.0x416c60.1
push str.FOR_TYPE
jmp 0x416cf2
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x416ced
test dword [ebx + 0x128], edx
je case.default.0x416c60
push str.FOR_PRINT
call fcn.004191a4
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp - 4], edx
jne 0x416d1d
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [str.CONOUT_]
mov dword [ebp - 4], edx
mov dword [ebp - 0xc], 0
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x416ea2
mov eax, dword [edi + 4]
test eax, eax
je 0x416d82
mov ecx, dword [edi + 8]
cmp ecx, 0x100
jle 0x416d45
mov ecx, 0x100
mov dword [ebp - 8], ecx
mov esi, eax
mov eax, ecx
lea edx, [ebp - 0x118]
lea edi, [ebp - 0x118]
mov dword [ebp - 4], edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov byte [edx + ecx], 0
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 8]
jmp 0x416ea5
push ecx
lea eax, [ebp - 0x118]
push str.FORT_d
push eax
call fcn.00418efb
lea ecx, [ebp - 0x118]
push ecx
call fcn.004191a4
mov edx, eax
xor edi, edi
add esp, 0x10
cmp edx, edi
mov dword [ebp - 4], edx
je 0x416dbf
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x416ea2
mov eax, dword [ebx + 0xbc]
add eax, 4
cmp eax, 0xa
ja case.0x416dd5.1
xor edx, edx
mov dl, byte [eax + 0x417230]
jmp dword [edx*4 + 0x417220]
push 0xfffffffffffffff4
jmp 0x416df4
push 0xfffffffffffffff6
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [str.CONIN_]
jmp 0x416e02
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [str.CONOUT_]
cmp edx, edi
mov dword [ebp - 4], edx
mov dword [ebp - 0xc], edi
je case.0x416dd5.1
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x416ea2
mov eax, dword [ebx + 0x130]
test ah, 2
jne 0x416e90
test byte [ebx + 0x128], 1
je 0x416e57
mov edx, dword [ebx + 0x50]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
mov dword [ebp - 4], edx
repne scasb al, byte es:[edi]
mov eax, dword [ebp + 0xc]
not ecx
mov edi, dword [eax]
dec ecx
test edi, edi
mov dword [ebp - 8], ecx
je 0x416ea5
mov dword [eax], 0
jmp 0x416ea5
mov ecx, dword [ebx + 0xbc]
lea edx, [ebp - 0x118]
push ecx
push str.fort._d
push edx
call fcn.00418efb
lea edi, [ebp - 0x118]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ebp - 0x118]
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
jmp 0x416ea5
lea edx, [ebp - 0x118]
mov byte [ebp - 0x118], 0
mov dword [ebp - 4], edx
xor ecx, ecx
mov dword [ebp - 8], ecx
cmp byte [edx], 0x20
jne 0x416ebb
test ecx, ecx
jle 0x416edb
inc edx
dec ecx
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
cmp byte [edx], 0x20
je 0x416eaa
test ecx, ecx
jle 0x416edb
mov al, byte [edx + ecx - 1]
cmp al, 0x20
je 0x416ecb
test al, al
jne 0x416ed3
dec ecx
test ecx, ecx
mov dword [ebp - 8], ecx
jg 0x416ebf
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
test ecx, ecx
jne 0x416f07
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x416f07
lea eax, [ebp - 8]
lea ecx, [ebp - 4]
push eax
push ecx
push ebx
call fcn.00417240
add esp, 0xc
test eax, eax
jne 0x417208
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x416f53
mov edi, dword [ebp + 0xc]
mov byte [ecx + edx], 0
mov edx, dword [ebp - 4]
push edx
push ebx
call fcn.00410300
add esp, 8
cmp eax, 0xffffffff
je 0x416fc8
mov ecx, dword [0x434a1c]
mov dword [ebp - 0xc], 0
test ecx, ecx
jne 0x416f41
cmp eax, 0xfffffffa
je 0x416f46
cmp eax, 1
jne 0x416fae
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [ebp - 4]
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [ebp + 0x10]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x434a1c]
test eax, eax
mov eax, dword [ebp - 0xc]
je 0x4171c9
test eax, eax
jne 0x4171e8
cmp dword [ebx + 0xa8], 0xffffffff
jne 0x4171e8
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jne 0x4171cd
mov dword [ebx + 0xa8], eax
jmp 0x4171cd
test eax, eax
jne 0x416fb6
push 0xfffffffffffffff6
jmp 0x416f48
cmp eax, 2
jne 0x416fbf
push 0xfffffffffffffff4
jmp 0x416f48
mov dword [ebp - 0x10], 1
jmp 0x416f50
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x416f50
mov eax, dword [ebx + 0x130]
test ah, 4
je 0x416ff7
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x416ff7
cmp dword [edi], 3
jne 0x416f50
test byte [ebx + 0x128], 1
jne 0x416f50
mov edx, dword [edi + 0xc]
test edx, edx
jne 0x41703a
mov edx, dword [ebp - 4]
lea eax, [ebp - 0x14]
lea ecx, [ebp - 0x21c]
push eax
push ecx
push 0x101
push edx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x41702f
cmp eax, 0x101
jae 0x41702f
lea ecx, [ebp - 0x21c]
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
xor esi, esi
xor eax, eax
xor edx, edx
jmp 0x4170c5
mov eax, dword [edi + 0x10]
lea ecx, [eax + 1]
cmp ecx, 0x100
jle 0x417054
pop edi
pop esi
mov eax, 0xc000002b
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, eax
mov esi, edx
mov edx, ecx
lea edi, [ebp - 0x21c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x21c]
mov byte [ebp + eax - 0x21c], 0
test ecx, ecx
lea esi, [ebp - 0x21c]
je 0x4170b1
cmp byte [ebp - 0x21c], 0x20
jne 0x41709b
test eax, eax
jle 0x4170b1
mov cl, byte [esi + 1]
inc esi
dec eax
cmp cl, 0x20
je 0x41708d
test eax, eax
jle 0x4170b1
mov cl, byte [esi + eax - 1]
cmp cl, 0x20
je 0x4170ac
test cl, cl
jne 0x4170b1
dec eax
test eax, eax
jg 0x41709f
cmp eax, 1
jge 0x4170ba
xor edx, edx
jmp 0x4170c5
mov cl, byte [eax + esi]
xor edx, edx
cmp cl, 0x5c
setne dl
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 3
jne 0x417159
test byte [ebx + 0x128], 1
jne 0x417159
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x4170e5
mov eax, esi
jmp 0x417124
mov eax, dword [ebx + 0x130]
test ah, 4
je 0x417106
mov byte [ebp - 0x320], 0x2e
mov byte [ebp - 0x31f], 0
lea eax, [ebp - 0x320]
jmp 0x417124
lea edx, [ebp - 0x320]
push edx
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
neg eax
sbb eax, eax
lea ecx, [ebp - 0x320]
and eax, ecx
lea edx, [ebp - 0x424]
push edx
push 0
push 0x42d940
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov eax, dword [ebx + 0x130]
lea edi, [ebp - 0x422]
test ah, 4
jne 0x416f55
lea edi, [ebp - 0x424]
jmp 0x416f55
mov ecx, dword [ebp - 8]
add ecx, eax
add ecx, edx
cmp ecx, 0x100
jle 0x417174
pop edi
pop esi
mov eax, 0xc000002b
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x10]
mov ecx, eax
mov ebx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
test edx, edx
rep movsb byte es:[edi], byte [esi]
je 0x417197
mov esi, dword [ebp + 0x10]
mov cl, byte [0x42d93c]
mov byte [eax + esi], cl
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 4]
lea edi, [eax + edx]
add edi, ebx
mov ebx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
mov ebx, dword [ebp + 8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 8]
add eax, ecx
add eax, edx
mov edx, dword [ebp + 0x10]
mov byte [eax + edx], 0
jmp 0x416f73
test eax, eax
jne 0x4171e8
cmp dword [ebx + 0xa8], 0xffffffff
jne 0x4171e8
mov ecx, dword [ebp + 0x14]
pop edi
pop esi
xor eax, eax
mov dword [ecx], 1
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x10]
test ecx, ecx
je 0x417201
mov edx, dword [ebp + 0x14]
pop edi
pop esi
xor eax, eax
mov dword [edx], 1
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret