Function at 0x54dc90
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 0x54dcd9
test byte [ebx + 0x128], 1
jne 0x54dcd9
mov edx, str.SCRATCH
mov ecx, 7
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
jmp 0x54dfa1
mov ecx, dword [ebx + 0xbc]
lea eax, [ecx + 4]
cmp eax, 3
ja case.default.0x54dcf0
mov edx, 0x400000
jmp dword [eax*4 + 0x54e2a0]
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54dd0a
test dword [ebx + 0x128], edx
je case.0x54dcf0.3
push str.FOR_READ
call fcn.0056492a
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp - 4], edx
jne 0x54ddad
push 0xfffffffffffffff6
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x5895fc]
jmp 0x54dda3
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54dd49
test dword [ebx + 0x128], edx
je case.0x54dcf0.2
push str.FOR_ACCEPT
jmp 0x54dd0f
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54dd63
test dword [ebx + 0x128], edx
je case.0x54dcf0.1
push str.FOR_TYPE
jmp 0x54dd82
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54dd7d
test dword [ebx + 0x128], edx
je case.default.0x54dcf0
push str.FOR_PRINT
call fcn.0056492a
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp - 4], edx
jne 0x54ddad
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x589600]
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 0x54df32
mov eax, dword [edi + 4]
test eax, eax
je 0x54de12
mov ecx, dword [edi + 8]
cmp ecx, 0x100
jle 0x54ddd5
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 0x54df35
push ecx
lea eax, [ebp - 0x118]
push str.FORT_d
push eax
call fcn.005648d8
lea ecx, [ebp - 0x118]
push ecx
call fcn.0056492a
mov edx, eax
xor edi, edi
add esp, 0x10
cmp edx, edi
mov dword [ebp - 4], edx
je 0x54de4f
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x54df32
mov eax, dword [ebx + 0xbc]
add eax, 4
cmp eax, 0xa
ja case.0x54de65.1
xor edx, edx
mov dl, byte [eax + 0x54e2c0]
jmp dword [edx*4 + 0x54e2b0]
push 0xfffffffffffffff4
jmp 0x54de84
push 0xfffffffffffffff6
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x5895fc]
jmp 0x54de92
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x589600]
cmp edx, edi
mov dword [ebp - 4], edx
mov dword [ebp - 0xc], edi
je case.0x54de65.1
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x54df32
mov eax, dword [ebx + 0x130]
test ah, 2
jne 0x54df20
test byte [ebx + 0x128], 1
je 0x54dee7
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 0x54df35
mov dword [eax], 0
jmp 0x54df35
mov ecx, dword [ebx + 0xbc]
lea edx, [ebp - 0x118]
push ecx
push str.fort._d
push edx
call fcn.005648d8
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 0x54df35
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 0x54df4b
test ecx, ecx
jle 0x54df6b
inc edx
dec ecx
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
cmp byte [edx], 0x20
je 0x54df3a
test ecx, ecx
jle 0x54df6b
mov al, byte [edx + ecx - 1]
cmp al, 0x20
je 0x54df5b
test al, al
jne 0x54df63
dec ecx
test ecx, ecx
mov dword [ebp - 8], ecx
jg 0x54df4f
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
test ecx, ecx
jne 0x54df97
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54df97
lea eax, [ebp - 8]
lea ecx, [ebp - 4]
push eax
push ecx
push ebx
call fcn.0054e800
add esp, 0xc
test eax, eax
jne 0x54e298
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x54dfe3
mov edi, dword [ebp + 0xc]
mov byte [ecx + edx], 0
mov edx, dword [ebp - 4]
push edx
push ebx
call fcn.005382b0
add esp, 8
cmp eax, 0xffffffff
je 0x54e058
mov ecx, dword [0x59d964]
mov dword [ebp - 0xc], 0
test ecx, ecx
jne 0x54dfd1
cmp eax, 0xfffffffa
je 0x54dfd6
cmp eax, 1
jne 0x54e03e
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 [0x59d964]
test eax, eax
mov eax, dword [ebp - 0xc]
je 0x54e259
test eax, eax
jne 0x54e278
cmp dword [ebx + 0xa8], 0xffffffff
jne 0x54e278
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jne 0x54e25d
mov dword [ebx + 0xa8], eax
jmp 0x54e25d
test eax, eax
jne 0x54e046
push 0xfffffffffffffff6
jmp 0x54dfd8
cmp eax, 2
jne 0x54e04f
push 0xfffffffffffffff4
jmp 0x54dfd8
mov dword [ebp - 0x10], 1
jmp 0x54dfe0
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x54dfe0
mov eax, dword [ebx + 0x130]
test ah, 4
je 0x54e087
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x54e087
cmp dword [edi], 3
jne 0x54dfe0
test byte [ebx + 0x128], 1
jne 0x54dfe0
mov edx, dword [edi + 0xc]
test edx, edx
jne 0x54e0ca
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 0x54e0bf
cmp eax, 0x101
jae 0x54e0bf
lea ecx, [ebp - 0x21c]
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
xor esi, esi
xor eax, eax
xor edx, edx
jmp 0x54e155
mov eax, dword [edi + 0x10]
lea ecx, [eax + 1]
cmp ecx, 0x100
jle 0x54e0e4
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 0x54e141
cmp byte [ebp - 0x21c], 0x20
jne 0x54e12b
test eax, eax
jle 0x54e141
mov cl, byte [esi + 1]
inc esi
dec eax
cmp cl, 0x20
je 0x54e11d
test eax, eax
jle 0x54e141
mov cl, byte [esi + eax - 1]
cmp cl, 0x20
je 0x54e13c
test cl, cl
jne 0x54e141
dec eax
test eax, eax
jg 0x54e12f
cmp eax, 1
jge 0x54e14a
xor edx, edx
jmp 0x54e155
mov cl, byte [eax + esi]
xor edx, edx
cmp cl, 0x5c
setne dl
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 3
jne 0x54e1e9
test byte [ebx + 0x128], 1
jne 0x54e1e9
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x54e175
mov eax, esi
jmp 0x54e1b4
mov eax, dword [ebx + 0x130]
test ah, 4
je 0x54e196
mov byte [ebp - 0x320], 0x2e
mov byte [ebp - 0x31f], 0
lea eax, [ebp - 0x320]
jmp 0x54e1b4
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 0x5896e0
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov eax, dword [ebx + 0x130]
lea edi, [ebp - 0x422]
test ah, 4
jne 0x54dfe5
lea edi, [ebp - 0x424]
jmp 0x54dfe5
mov ecx, dword [ebp - 8]
add ecx, eax
add ecx, edx
cmp ecx, 0x100
jle 0x54e204
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 0x54e227
mov esi, dword [ebp + 0x10]
mov cl, byte [0x5896dc]
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 0x54e003
test eax, eax
jne 0x54e278
cmp dword [ebx + 0xa8], 0xffffffff
jne 0x54e278
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 0x54e291
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