Function at 0x40593f
Capabilities:
Get common file path

Disassembly:
mov ecx, dword [esp + 8]
sub esp, 0x1c
test ecx, ecx
jns 0x40595b
lea eax, [ecx*4 + 4]
mov ecx, dword [0x7a2400]
sub ecx, eax
mov ecx, dword [ecx]
mov edx, dword [esp + 0x20]
push ebx
push ebp
mov ebp, dword [0x7a2c58]
mov ebx, 0x7a1bc0
add ebp, ecx
push edi
mov edi, ebx
cmp edx, ebx
jb 0x405987
mov eax, edx
sub eax, ebx
cmp eax, 0x800
jae 0x405987
and dword [esp + 0x2c], 0
mov edi, edx
mov cl, byte [ebp]
test cl, cl
je 0x405b8f
push esi
mov eax, edi
sub eax, ebx
cmp eax, 0x400
jge 0x405b8e
inc ebp
cmp cl, 4
jae 0x405b75
movsx edx, byte [ebp + 1]
movsx ebx, byte [ebp]
mov esi, edx
and esi, 0x7f
mov dword [esp + 0x34], edx
mov eax, ebx
shl esi, 7
and eax, 0x7f
mov dword [esp + 0x20], ebx
or esi, eax
mov dword [esp + 0x28], edx
mov eax, ebx
add ebp, 2
or eax, 0x8000
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], eax
mov eax, edx
or eax, 0x8000
mov dword [esp + 0x24], eax
cmp cl, 2
jne 0x405b1e
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov esi, dword [esp + 0x34]
test eax, eax
jns 0x405a1e
mov ecx, 0x5a04
cmp ax, cx
je 0x405a1e
cmp esi, 0x23
je 0x405a1e
cmp esi, 0x2e
je 0x405a1e
and dword [esp + 0x10], 0
jmp 0x405a26
mov dword [esp + 0x10], 1
cmp dword [0x7a2ce4], 0
push 2
pop ebp
push 4
pop eax
cmovne ebp, eax
test bl, bl
jns 0x405a6f
mov eax, ebx
and ebx, 0x3f
add ebx, dword [0x7a2c58]
and eax, 0x40
push eax
push edi
push ebx
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00406237
cmp byte [edi], 0
jne 0x405aff
push esi
push edi
call fcn.0040593f
jmp 0x405afa
cmp ebx, 0x25
jne 0x405a82
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x405afa
cmp ebx, 0x24
jne 0x405a95
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
xor ebp, ebp
test ebp, ebp
je 0x405afa
mov ebx, dword [esp + 0x10]
mov eax, dword [0x7a2410]
dec ebp
test eax, eax
je 0x405ac0
test ebx, ebx
je 0x405ac0
push edi
push 0
push 0
push dword [esp + ebp*4 + 0x28]
push dword [0x7a2418]
call eax
test eax, eax
je 0x405afa
lea eax, [esp + 0x14]
push eax
push dword [esp + ebp*4 + 0x20]
push dword [0x7a2418]
call sub.SHELL32.dll_SHGetSpecialFolderLocation
test eax, eax
jne 0x405af3
push edi
push dword [esp + 0x18]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [esp + 0x14]
mov esi, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test esi, esi
jne 0x405afa
mov byte [edi], 0
test ebp, ebp
jne 0x405a9d
cmp byte [edi], 0
je 0x405b12
cmp dword [esp + 0x34], 0x1a
jne 0x405b12
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push edi
call fcn.00406546
mov ebp, dword [esp + 0x18]
jmp 0x405b65
cmp cl, 3
jne 0x405b57
cmp esi, 0x1d
jne 0x405b36
push dword [0x7a2418]
push edi
call fcn.00405ec2
jmp 0x405b47
mov eax, esi
shl eax, 0xa
add eax, section..ndata
push eax
push edi
call fcn.004063b7
lea eax, [esi - 0x15]
cmp eax, 7
jae 0x405b65
push edi
call fcn.00406546
jmp 0x405b65
cmp cl, 1
jne 0x405b65
not esi
push esi
push edi
call fcn.0040593f
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add edi, eax
mov ebx, 0x7a1bc0
jmp 0x405b83
jne 0x405b80
mov al, byte [ebp]
mov byte [edi], al
inc edi
inc ebp
jmp 0x405b83
mov byte [edi], cl
inc edi
mov cl, byte [ebp]
test cl, cl
jne 0x405993
pop esi
mov eax, dword [esp + 0x2c]
mov byte [edi], 0
test eax, eax
je 0x405ba3
push ebx
push eax
call fcn.004063b7
jmp 0x405ba5
mov eax, ebx
pop edi
pop ebp
pop ebx
add esp, 0x1c
ret 8