Function at 0x54cc40
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 0x54cc89
test byte [ebx + 0x128], 1
jne 0x54cc89
mov edx, str.SCRATCH
mov ecx, 7
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
jmp 0x54cf51
mov ecx, dword [ebx + 0xbc]
lea eax, [ecx + 4]
cmp eax, 3
ja case.default.0x54cca0
mov edx, 0x400000
jmp dword [eax*4 + 0x54d250]
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54ccba
test dword [ebx + 0x128], edx
je case.0x54cca0.3
push str.FOR_READ
call fcn.005638da
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp - 4], edx
jne 0x54cd5d
push 0xfffffffffffffff6
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x588604]
jmp 0x54cd53
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54ccf9
test dword [ebx + 0x128], edx
je case.0x54cca0.2
push str.FOR_ACCEPT
jmp 0x54ccbf
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54cd13
test dword [ebx + 0x128], edx
je case.0x54cca0.1
push str.FOR_TYPE
jmp 0x54cd32
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54cd2d
test dword [ebx + 0x128], edx
je case.default.0x54cca0
push str.FOR_PRINT
call fcn.005638da
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp - 4], edx
jne 0x54cd5d
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x588608]
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 0x54cee2
mov eax, dword [edi + 4]
test eax, eax
je 0x54cdc2
mov ecx, dword [edi + 8]
cmp ecx, 0x100
jle 0x54cd85
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 0x54cee5
push ecx
lea eax, [ebp - 0x118]
push str.FORT_d
push eax
call fcn.00563888
lea ecx, [ebp - 0x118]
push ecx
call fcn.005638da
mov edx, eax
xor edi, edi
add esp, 0x10
cmp edx, edi
mov dword [ebp - 4], edx
je 0x54cdff
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x54cee2
mov eax, dword [ebx + 0xbc]
add eax, 4
cmp eax, 0xa
ja case.0x54ce15.1
xor edx, edx
mov dl, byte [eax + 0x54d270]
jmp dword [edx*4 + 0x54d260]
push 0xfffffffffffffff4
jmp 0x54ce34
push 0xfffffffffffffff6
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x588604]
jmp 0x54ce42
push 0xfffffffffffffff5
call esi
mov dword [ebx + 0xa8], eax
mov edx, dword [0x588608]
cmp edx, edi
mov dword [ebp - 4], edx
mov dword [ebp - 0xc], edi
je case.0x54ce15.1
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x54cee2
mov eax, dword [ebx + 0x130]
test ah, 2
jne 0x54ced0
test byte [ebx + 0x128], 1
je 0x54ce97
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 0x54cee5
mov dword [eax], 0
jmp 0x54cee5
mov ecx, dword [ebx + 0xbc]
lea edx, [ebp - 0x118]
push ecx
push str.fort._d
push edx
call fcn.00563888
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 0x54cee5
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 0x54cefb
test ecx, ecx
jle 0x54cf1b
inc edx
dec ecx
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
cmp byte [edx], 0x20
je 0x54ceea
test ecx, ecx
jle 0x54cf1b
mov al, byte [edx + ecx - 1]
cmp al, 0x20
je 0x54cf0b
test al, al
jne 0x54cf13
dec ecx
test ecx, ecx
mov dword [ebp - 8], ecx
jg 0x54ceff
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
test ecx, ecx
jne 0x54cf47
mov eax, dword [ebx + 0x130]
test ah, 2
je 0x54cf47
lea eax, [ebp - 8]
lea ecx, [ebp - 4]
push eax
push ecx
push ebx
call fcn.0054d7b0
add esp, 0xc
test eax, eax
jne 0x54d248
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x54cf93
mov edi, dword [ebp + 0xc]
mov byte [ecx + edx], 0
mov edx, dword [ebp - 4]
push edx
push ebx
call fcn.00537240
add esp, 8
cmp eax, 0xffffffff
je 0x54d008
mov ecx, dword [0x5a3d24]
mov dword [ebp - 0xc], 0
test ecx, ecx
jne 0x54cf81
cmp eax, 0xfffffffa
je 0x54cf86
cmp eax, 1
jne 0x54cfee
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 [0x5a3d24]
test eax, eax
mov eax, dword [ebp - 0xc]
je 0x54d209
test eax, eax
jne 0x54d228
cmp dword [ebx + 0xa8], 0xffffffff
jne 0x54d228
mov ecx, dword [ebp - 0x10]
test ecx, ecx
jne 0x54d20d
mov dword [ebx + 0xa8], eax
jmp 0x54d20d
test eax, eax
jne 0x54cff6
push 0xfffffffffffffff6
jmp 0x54cf88
cmp eax, 2
jne 0x54cfff
push 0xfffffffffffffff4
jmp 0x54cf88
mov dword [ebp - 0x10], 1
jmp 0x54cf90
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x54cf90
mov eax, dword [ebx + 0x130]
test ah, 4
je 0x54d037
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x54d037
cmp dword [edi], 3
jne 0x54cf90
test byte [ebx + 0x128], 1
jne 0x54cf90
mov edx, dword [edi + 0xc]
test edx, edx
jne 0x54d07a
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 0x54d06f
cmp eax, 0x101
jae 0x54d06f
lea ecx, [ebp - 0x21c]
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
xor esi, esi
xor eax, eax
xor edx, edx
jmp 0x54d105
mov eax, dword [edi + 0x10]
lea ecx, [eax + 1]
cmp ecx, 0x100
jle 0x54d094
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 0x54d0f1
cmp byte [ebp - 0x21c], 0x20
jne 0x54d0db
test eax, eax
jle 0x54d0f1
mov cl, byte [esi + 1]
inc esi
dec eax
cmp cl, 0x20
je 0x54d0cd
test eax, eax
jle 0x54d0f1
mov cl, byte [esi + eax - 1]
cmp cl, 0x20
je 0x54d0ec
test cl, cl
jne 0x54d0f1
dec eax
test eax, eax
jg 0x54d0df
cmp eax, 1
jge 0x54d0fa
xor edx, edx
jmp 0x54d105
mov cl, byte [eax + esi]
xor edx, edx
cmp cl, 0x5c
setne dl
mov ecx, dword [ebp + 0xc]
cmp dword [ecx], 3
jne 0x54d199
test byte [ebx + 0x128], 1
jne 0x54d199
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x54d125
mov eax, esi
jmp 0x54d164
mov eax, dword [ebx + 0x130]
test ah, 4
je 0x54d146
mov byte [ebp - 0x320], 0x2e
mov byte [ebp - 0x31f], 0
lea eax, [ebp - 0x320]
jmp 0x54d164
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 0x5886e8
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov eax, dword [ebx + 0x130]
lea edi, [ebp - 0x422]
test ah, 4
jne 0x54cf95
lea edi, [ebp - 0x424]
jmp 0x54cf95
mov ecx, dword [ebp - 8]
add ecx, eax
add ecx, edx
cmp ecx, 0x100
jle 0x54d1b4
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 0x54d1d7
mov esi, dword [ebp + 0x10]
mov cl, byte [0x5886e4]
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 0x54cfb3
test eax, eax
jne 0x54d228
cmp dword [ebx + 0xa8], 0xffffffff
jne 0x54d228
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 0x54d241
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