Function at 0x406341
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
test ebx, ebx
jge 0x406362
mov ecx, dword [0x7cd31c]
lea eax, [ebx*4 + 4]
sub ecx, eax
mov ebx, dword [ecx]
mov eax, dword [0x7d1378]
mov ecx, dword [ebp + 8]
add ebx, eax
mov eax, 0x7c12c0
sub ecx, eax
mov edi, eax
cmp ecx, 0x4000
jae 0x406384
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
mov dl, byte [ebx]
test dl, dl
je 0x406568
mov ecx, edi
sub ecx, eax
cmp ecx, 0x2000
jge 0x406568
inc ebx
cmp dl, 0xfc
mov dword [ebp + 0xc], ebx
jbe 0x406553
movsx eax, byte [ebx + 1]
movsx ecx, byte [ebx]
mov esi, eax
mov ebx, ecx
and esi, 0x7f
and ebx, 0x7f
shl esi, 7
or esi, ebx
mov ebx, 0x8000
mov dword [ebp - 0x14], eax
or eax, ebx
mov dword [ebp - 0x1c], ecx
push 2
or ecx, ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x10], eax
pop eax
add ebx, eax
cmp dl, 0xfe
mov dword [ebp - 0x18], ecx
jne 0x4064fd
and dword [ebp - 4], 0
and dword [ebp + 0xc], 0
and byte [edi], 0
push 4
pop esi
cmp dword [ebp - 0x14], esi
jne 0x406406
mov dword [ebp - 4], 0x40aa94
mov dword [ebp + 0xc], eax
jmp 0x406475
mov eax, dword [ebp - 0x1c]
cmp eax, 0x2b
jne 0x406425
push edi
push 0x40aa84
push 0x40aa58
push 0x80000002
call fcn.00406200
jmp 0x406475
cmp eax, 0x26
jne 0x406451
push edi
push 0x40aa48
push 0x40aa58
push 0x80000002
call fcn.00406200
cmp byte [edi], 0
jne 0x40648d
push 0x40aa34
push edi
call fcn.0040630d
jmp 0x406475
cmp eax, 0x25
jne 0x406464
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x406475
cmp eax, 0x24
jne 0x406475
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
cmp byte [edi], 0
jne 0x40648d
cmp dword [0x7d13c4], 0
mov dword [ebp + 0xc], esi
jne 0x40648d
mov dword [ebp + 0xc], 2
mov eax, dword [ebp + 0xc]
dec dword [ebp + 0xc]
test eax, eax
je 0x4064e1
mov eax, dword [ebp + 0xc]
lea esi, [ebp + eax*4 - 0x1c]
lea eax, [ebp - 8]
push eax
push dword [esi]
push dword [0x7d1344]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x4064d1
push edi
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [ebp - 8]
mov dword [ebp - 0xc], eax
call fcn.00405afa
cmp dword [ebp - 0xc], 0
jne 0x4064e1
jmp 0x4064d4
and byte [edi], 0
mov eax, dword [ebp + 0xc]
dec dword [ebp + 0xc]
sub esi, 4
test eax, eax
jne 0x40649e
cmp byte [edi], 0
je 0x4064f5
cmp dword [ebp - 4], 0
je 0x4064f5
push dword [ebp - 4]
push edi
call fcn.00406330
push edi
call fcn.00406581
jmp 0x406541
cmp dl, 0xfd
jne 0x406530
cmp esi, 0x1b
jne 0x406515
push dword [0x7d1344]
push edi
call fcn.0040626a
jmp 0x406526
mov eax, esi
shl eax, 0xd
add eax, section..ndata
push eax
push edi
call fcn.0040630d
add esi, 0xffffffeb
cmp esi, 6
jae 0x406541
jmp 0x4064f5
cmp dl, 0xff
jne 0x406541
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.00406341
push edi
call fcn.00406323
add edi, eax
mov eax, 0x7c12c0
jmp 0x406384
jne 0x406560
mov cl, byte [ebx]
mov byte [edi], cl
inc edi
inc ebx
jmp 0x406384
mov byte [edi], dl
inc edi
jmp 0x406384
and byte [edi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x40657d
push eax
push dword [ebp + 8]
call fcn.0040630d
leave
ret 8