Function at 0x4017c0
Capabilities:
Get common file path
Get file version info

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x584
mov eax, dword [0x52b004]
xor eax, esp
mov dword [esp + 0x580], eax
push ebx
mov eax, ecx
push esi
push edi
mov dword [esp + 0x24], eax
mov dword [eax], 0
lea eax, [esp + 0x170]
push eax
push 0
push 0
push 0x17
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
je 0x40181d
mov eax, 0xe
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x580]
xor ecx, esp
call fcn.00407a00
mov esp, ebp
pop ebp
ret
push str.Nuvoton_EX_CommanderEX_Commander.lnk
lea eax, [esp + 0x174]
push 0x208
push eax
call fcn.0040bd11
add esp, 0xc
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [esp + 0xc]
mov esi, 0xe
push eax
push 0x41f1d0
push 1
push 0
push 0x41f1f0
call dword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jne 0x4018db
mov eax, dword [esp + 0xc]
lea edx, [esp + 0x10]
push edx
push 0x41f1e0
push eax
mov ecx, dword [eax]
call dword [ecx]
test eax, eax
jne 0x4018d1
push 0x104
lea eax, [esp + 0x37c]
push eax
push 0xffffffffffffffff
lea eax, [esp + 0x17c]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x378]
push 0
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x14]
test eax, eax
jne 0x4018d1
mov eax, dword [esp + 0xc]
lea edx, [esp + 0x30]
push 0
push edx
push 0x104
mov ecx, dword [eax]
lea edx, [esp + 0x17c]
push edx
push eax
call dword [ecx + 0xc]
xor esi, esi
mov ecx, dword [esp + 0xc]
push ecx
mov edx, dword [ecx]
call dword [edx + 8]
call dword [sym.imp.ole32.dll_CoUninitialize]
test esi, esi
je 0x4018fc
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x580]
xor ecx, esp
call fcn.00407a00
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x174]
push eax
call dword [sym.imp.VERSION.dll_GetFileVersionInfoSizeA]
mov ebx, eax
test ebx, ebx
jne 0x40191c
xor esi, esi
jmp 0x40199e
push ebx
call fcn.0041068b
mov edi, eax
add esp, 4
xor esi, esi
test edi, edi
je 0x40199e
push edi
push ebx
push esi
lea eax, [esp + 0x17c]
push eax
call dword [sym.imp.VERSION.dll_GetFileVersionInfoA]
test eax, eax
je 0x401995
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x18]
push eax
push str.StringFileInfo041104b0ProductVersion
push edi
call dword [sym.imp.VERSION.dll_VerQueryValueA]
test eax, eax
je 0x401995
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x20]
push eax
push str._d._d._d
push dword [esp + 0x24]
call fcn.00401090
movzx esi, byte [esp + 0x2c]
add esp, 0x14
movzx eax, byte [esp + 0x1c]
shl esi, 8
or esi, eax
movzx eax, byte [esp + 0x20]
shl esi, 8
or esi, eax
push edi
call fcn.0040bcf6
add esp, 4
mov eax, dword [esp + 0x24]
push 0x5c
mov dword [eax], esi
lea eax, [esp + 0x174]
push eax
call fcn.004088b0
mov byte [eax + 1], 0
lea eax, [esp + 0x178]
push eax
push 0x104
push 0x52c2e0
call fcn.0040bb18
push 0x52c2e0
push 0x104
push 0x52c4f0
call fcn.0040bb18
push str.DefFiles_
push 0x104
push 0x52c4f0
call fcn.0040bd11
push 0x52c2e0
push 0x104
push 0x52c690
call fcn.0040bb18
push str.Document_
push 0x104
push 0x52c690
call fcn.0040bd11
add esp, 0x44
push 0x52c2e0
push 0x104
push 0x52c798
call fcn.0040bb18
push str.Tools_
push 0x104
push 0x52c798
call fcn.0040bd11
add esp, 0x18
push 0
push 0x1a
push 0x52c3e8
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
push str.NuvotonEXCommanderPatch_
push 0x80
push 0x52c3e8
call fcn.0040bd11
mov ecx, dword [esp + 0x598]
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00407a00
mov esp, ebp
pop ebp
ret