Function at 0x405950
Capabilities:
Extract resource via kernel32 functions
Get common file path
Get system information on windows
Print debug messages

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e5be2
mov eax, dword fs:[0]
push eax
sub esp, 0x2a0
mov eax, dword [0x526060]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov edi, dword [ebp + 8]
push str.CInstallCtrl::Install____r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
cmp word [edi], 0
jne 0x4059a0
xor ecx, ecx
jmp 0x4059b4
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4059a5
sub ecx, edx
sar ecx, 1
push ecx
lea esi, [ebx + 4]
push edi
mov ecx, esi
call fcn.00401d30
cmp dword [esi + 0x14], 8
jb 0x4059ca
mov ecx, dword [esi]
jmp 0x4059cc
mov ecx, esi
mov eax, dword [esi + 0x10]
cmp word [ecx + eax*2 - 2], 0x5c
jne 0x4059fd
lea ecx, [eax - 1]
cmp eax, ecx
jae 0x4059e8
push str.invalid_string_position
call fcn.0040c614
cmp dword [esi + 0x14], 8
mov dword [esi + 0x10], ecx
jb 0x4059f5
mov eax, dword [esi]
jmp 0x4059f7
mov eax, esi
xor edx, edx
mov word [eax + ecx*2], dx
cmp dword [esi + 0x14], 8
jb 0x405a07
mov ecx, dword [esi]
jmp 0x405a09
mov ecx, esi
call fcn.0040b410
cmp eax, 1
je 0x405a2f
push 1
push 0x515260
mov ecx, esi
call fcn.004076e0
push 4
push 0x515264
mov ecx, eax
call fcn.004076e0
cmp dword [esi + 0x14], 8
jb 0x405a39
mov ecx, dword [esi]
jmp 0x405a3b
mov ecx, esi
call fcn.0040bea0
cmp dword [esi + 0x14], 8
jb 0x405a4a
mov ecx, dword [esi]
jmp 0x405a4c
mov ecx, esi
mov eax, dword [esi + 0x10]
cmp word [ecx + eax*2 - 2], 0x5c
je 0x405a65
push 1
push 0x515260
mov ecx, esi
call fcn.004076e0
push 0
mov ecx, ebx
call fcn.00406900
push 0x104
lea eax, [ebp - 0x21c]
mov byte [ebp - 0x27d], 0
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov dword [ebp - 0x220], 7
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x234]
mov ax, word [ebp - 0x21c]
mov word [ebp - 0x234], ax
xor eax, eax
push 0xd
push str.:ProgramData
mov dword [ebp - 0x224], 1
mov word [ebp - 0x232], ax
call fcn.004076e0
push 4
xor eax, eax
mov dword [ebp - 0x290], 7
push 0x515264
lea ecx, [ebp - 0x2a4]
mov dword [ebp - 0x294], 0
mov word [ebp - 0x2a4], ax
call fcn.00401d30
lea eax, [ebp - 0x2a4]
mov byte [ebp - 4], 1
push eax
lea eax, [ebp - 0x24c]
push 0x515260
push eax
call fcn.00407b60
add esp, 0xc
push 0xffffffffffffffff
push 0
push eax
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 2
call fcn.004078f0
mov eax, dword [ebp - 0x238]
cmp eax, 8
jb 0x405b4b
inc eax
lea ecx, [ebp - 0x24c]
push eax
push dword [ebp - 0x24c]
call fcn.00401e90
xor eax, eax
mov dword [ebp - 0x238], 7
mov word [ebp - 0x24c], ax
mov byte [ebp - 4], al
mov eax, dword [ebp - 0x290]
mov dword [ebp - 0x23c], 0
cmp eax, 8
jb 0x405b89
inc eax
lea ecx, [ebp - 0x2a4]
push eax
push dword [ebp - 0x2a4]
call fcn.00401e90
cmp dword [ebp - 0x220], 8
lea ecx, [ebp - 0x234]
cmovae ecx, dword [ebp - 0x234]
call fcn.0040bfc0
lea eax, [ebp - 0x258]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov ax, word [ebp - 0x258]
cmp ax, 9
je 0x405bc6
cmp ax, 6
je 0x405bc6
xor eax, eax
jmp 0x405bcb
mov eax, 1
test eax, eax
mov dword [ebp - 0x290], 7
mov edx, str.zzdsMenu_64.dll
mov dword [ebp - 0x294], 0
mov ecx, str.zzdsMenu_32.dll
cmove edx, ecx
xor eax, eax
mov word [ebp - 0x2a4], ax
cmp word [edx], ax
jne 0x405c00
xor ecx, ecx
jmp 0x405c14
mov ecx, edx
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405c05
sub ecx, edi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x2a4]
call fcn.00401d30
lea eax, [ebp - 0x2a4]
mov byte [ebp - 4], 3
push eax
mov ecx, ebx
call fcn.004071f0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x290]
cmp eax, 8
jb 0x405c55
inc eax
lea ecx, [ebp - 0x2a4]
push eax
push dword [ebp - 0x2a4]
call fcn.00401e90
push 0xf
xor eax, eax
mov dword [ebp - 0x290], 7
push str.ZZWordAddin.dll
lea ecx, [ebp - 0x2a4]
mov dword [ebp - 0x294], 0
mov word [ebp - 0x2a4], ax
call fcn.00401d30
lea eax, [ebp - 0x2a4]
mov byte [ebp - 4], 4
push eax
mov ecx, ebx
call fcn.004071f0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x290]
cmp eax, 8
jb 0x405cb8
inc eax
lea ecx, [ebp - 0x2a4]
push eax
push dword [ebp - 0x2a4]
call fcn.00401e90
push 0
mov dword [ebp - 0x28c], 0
mov dword [ebp - 0x2a8], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov edi, eax
push str.CInstallCtrl::LoadResource____r_n
mov dword [ebp - 0x284], edi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push str.ZIPRES
push 0x84
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
jne 0x405d06
mov dword [ebp - 0x284], eax
jmp 0x405d54
push edi
push dword [ebp - 0x284]
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x288], eax
push edi
test eax, eax
jne 0x405d30
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov dword [ebp - 0x284], 0
jmp 0x405d54
push dword [ebp - 0x284]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push dword [ebp - 0x288]
mov dword [ebp - 0x28c], eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x284], eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov edi, eax
push str.CInstallCtrl::LoadResource____r_n
mov dword [ebp - 0x288], edi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x51536c
push 0x83
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
test edi, edi
je 0x405dc8
push edi
push dword [ebp - 0x288]
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x2ac], eax
push edi
test eax, eax
jne 0x405da8
call dword [sym.imp.KERNEL32.dll_FreeResource]
xor edi, edi
jmp 0x405dc8
push dword [ebp - 0x288]
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push dword [ebp - 0x2ac]
mov dword [ebp - 0x2a8], eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
cmp dword [ebp - 0x284], 0
je 0x405e9e
cmp dword [ebp - 0x28c], 0
je 0x405e9e
test edi, edi
je 0x405e9e
cmp dword [ebp - 0x2a8], 0
je 0x405e9e
push 0x48
lea eax, [ebp - 0x27c]
push 0
push eax
call fcn.004c40b0
add esp, 0xc
lea ecx, [ebp - 0x27c]
push edi
call fcn.00401680
sub esp, 0x28
mov byte [ebp - 4], 5
mov ecx, esp
push 0x64
mov dword [ecx], vtable.std::_Func_base_void__int_.0
mov dword [ecx], vtable.._AV___Func_impl_V___Binder_U_Unforced_std__P8CInstallCtrl__AEXH_ZQAV3_ABU___Ph__00_2__std__V__allocator_H_2_XH_std__.0
mov dword [ecx + 4], 0x4068e0
mov al, byte [ebp - 0x228]
mov byte [ecx + 8], al
mov dword [ecx + 0xc], ebx
mov dword [ecx + 0x24], ecx
lea ecx, [ebp - 0x27c]
push 0
call fcn.004017a0
cmp dword [esi + 0x14], 8
jb 0x405e58
mov esi, dword [esi]
push esi
push dword [ebp - 0x28c]
lea ecx, [ebp - 0x27c]
push dword [ebp - 0x284]
call fcn.00401820
lea ecx, [ebp - 0x27c]
mov byte [ebp - 0x27d], al
mov byte [ebp - 4], 0
call fcn.00401730
cmp byte [ebp - 0x27d], 0
je 0x405e9e
push 1
mov ecx, ebx
call fcn.00406900
mov ecx, ebx
call fcn.00407030
call dword [sym.imp.ole32.dll_CoUninitialize]
mov ecx, dword [ebx + 0x1c]
test ecx, ecx
je 0x405ec1
movzx eax, byte [ebp - 0x27d]
push 0
push eax
push 0x403
push ecx
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [ebp - 0x220]
cmp eax, 8
jb 0x405edf
inc eax
lea ecx, [ebp - 0x234]
push eax
push dword [ebp - 0x234]
call fcn.00401e90
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00412aed
mov esp, ebp
pop ebp
ret 4