Function at 0x408590
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x464
mov eax, dword [0x542040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 8]
push esi
movzx esi, byte [ebp + 0x10]
mov dword [ebp - 0x45c], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x440], eax
movzx eax, word [0x54941c]
shl esi, 0x10
or esi, eax
mov dword [ebp - 0x41c], edx
push edi
lea eax, [ebp - 0x420]
mov dword [ebp - 0x458], ebx
push eax
lea eax, [ebp - 0x464]
mov dword [ebp - 0x420], esi
push eax
call fcn.0040a870
mov edi, dword [eax]
add edi, 0xc
cmp dword [edi + 4], 0
jne 0x4088f5
cmp dword [edi], 0
jne 0x4088f5
push 0x208
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x4087b0
push 0x51b47c
lea eax, [ebp - 0x418]
push 0x208
push eax
call fcn.004ef767
add esp, 0xc
lea eax, [ebp - 0x418]
push dword [ebp - 0x45c]
push 0x208
push eax
call fcn.004ef767
mov esi, dword [sym.imp.SHELL32.dll_ExtractIconExW]
lea eax, [ebp - 0x418]
add esp, 0xc
push 0
push 0
push 0
push 0xffffffffffffffff
push eax
call esi
test eax, eax
jle 0x4087b0
cmp byte [ebp + 0x18], 0
lea eax, [ebp - 0x43c]
mov dword [ebp - 0x43c], 0
push 1
je 0x408694
push 0
push eax
jmp 0x408697
push eax
push 0
push dword [ebp - 0x440]
lea eax, [ebp - 0x418]
push eax
call esi
lea eax, [ebp - 0x454]
push eax
push dword [ebp - 0x43c]
call dword [sym.imp.USER32.dll_GetIconInfo]
test eax, eax
je 0x40872a
lea eax, [ebp - 0x438]
xorps xmm0, xmm0
push eax
push 0x18
push dword [ebp - 0x448]
movups xmmword [ebp - 0x438], xmm0
movq qword [ebp - 0x428], xmm0
call dword [sym.imp.GDI32.dll_GetObjectW]
mov ecx, dword [ebp - 0x444]
cmp eax, 0x18
jne 0x40870a
mov eax, dword [ebp - 0x434]
mov dword [edi + 8], eax
mov eax, dword [ebp - 0x430]
test ecx, ecx
jne 0x408707
cdq
sub eax, edx
sar eax, 1
mov dword [edi + 0xc], eax
mov eax, dword [ebp - 0x448]
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
test eax, eax
je 0x408723
push eax
call esi
mov ecx, dword [ebp - 0x444]
test ecx, ecx
je 0x40872a
push ecx
call esi
mov ebx, dword [ebp - 0x43c]
test ebx, ebx
je 0x4087aa
push 0x10
call dword [sym.imp.gdiplus.dll_GdipAlloc]
mov esi, eax
mov dword [ebp - 0x458], esi
test esi, esi
je 0x408790
lea eax, [ebp - 0x440]
mov dword [ebp - 0x440], 0
xorps xmm0, xmm0
push eax
movups xmmword [esi], xmm0
push ebx
mov dword [esi], vtable.Gdiplus::Bitmap.0
call dword [sym.imp.gdiplus.dll_GdipCreateBitmapFromHICON]
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x440]
mov dword [esi + 4], eax
mov eax, edi
mov dword [edi], esi
mov dword [edi + 4], ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004dadd7
mov esp, ebp
pop ebp
ret
xor esi, esi
mov dword [edi + 4], ebx
mov dword [edi], esi
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004dadd7
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x458]
cmp dword [ebp - 0x41c], 0
je 0x40889b
test ebx, ebx
je 0x40889b
push ebx
push 2
mov dword [ebp - 0x43c], 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
je 0x40888b
lea eax, [ebp - 0x43c]
push eax
push 1
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x408884
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
je 0x408884
push ebx
push dword [ebp - 0x41c]
push eax
call fcn.004def30
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push 0x10
call dword [sym.imp.gdiplus.dll_GdipAlloc]
mov esi, eax
mov dword [ebp - 0x458], esi
test esi, esi
je 0x408874
xorps xmm0, xmm0
mov dword [ebp - 0x41c], 0
lea eax, [ebp - 0x41c]
movups xmmword [esi], xmm0
mov ecx, dword [ebp - 0x43c]
push eax
push ecx
mov dword [esi], vtable.Gdiplus::Bitmap.0
call dword [sym.imp.gdiplus.dll_GdipCreateBitmapFromStream]
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x41c]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x43c]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
jmp 0x40889d
mov eax, dword [ebp - 0x43c]
xor esi, esi
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
jmp 0x40889d
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [ebp - 0x43c]
test ecx, ecx
je 0x40889b
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
xor esi, esi
lea eax, [ebp - 0x41c]
mov dword [edi], esi
push eax
push dword [esi + 4]
mov dword [ebp - 0x41c], 0
call dword [sym.imp.gdiplus.dll_GdipGetImageWidth]
test eax, eax
je 0x4088c0
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x41c]
mov esi, dword [edi]
mov dword [edi + 8], eax
lea eax, [ebp - 0x41c]
push eax
mov dword [ebp - 0x41c], 0
push dword [esi + 4]
call dword [sym.imp.gdiplus.dll_GdipGetImageHeight]
test eax, eax
je 0x4088ec
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x41c]
mov dword [edi + 0xc], eax
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004dadd7
mov esp, ebp
pop ebp
ret