Function at 0x402410
Capabilities:
Extract resource via kernel32 functions
Get common file path
Get file version info
Link many functions at runtime
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd40
mov eax, dword [0x42e430]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, ecx
mov dword [ebp - 0xc3c], ebx
push edi
mov edi, dword [ebp + 8]
mov eax, dword [esi]
test eax, eax
je 0x402441
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0xa
push edi
push 0
mov dword [esi], 0
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0xc28], eax
test eax, eax
je 0x402c09
push eax
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0xc34], eax
test eax, eax
je 0x402c09
push dword [ebp - 0xc28]
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
je 0x402c09
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0xc28], eax
test eax, eax
je 0x402c09
lea eax, [ebp - 0xc1c]
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x402b72
lea edi, [esi + 4]
push edi
push 0
push 0x423b54
lea eax, [ebp - 0xc1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x402b72
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0xc2c], eax
test eax, eax
je 0x402ae6
push 0
lea ecx, [ebp - 0xc38]
push ecx
push dword [ebp - 0xc34]
push dword [ebp - 0xc28]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402ae6
push dword [ebp - 0xc2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x402ae6
push edi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi], eax
test eax, eax
jne 0x4025f0
lea eax, [ebp - 0xc24]
mov dword [ebp - 0xc24], edi
push eax
push 0x400
lea eax, [ebp - 0x804]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x4025a9
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cce5
add esp, 8
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x4025d4
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cce5
add esp, 8
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x804]
push eax
push str.ERROR___s_
push 0xffffffffffffffff
push dword [ebp + 0x10]
push ebx
call fcn.0040ca2e
jmp 0x402cb3
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, 0x423b58
push ebx
push eax
call edi
mov dword [0x430700], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423b68
push ebx
push dword [esi]
call edi
mov dword [0x430704], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423b78
push ebx
push dword [esi]
call edi
mov dword [0x430710], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423b8c
push ebx
push dword [esi]
call edi
mov dword [0x430708], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423b98
push ebx
push dword [esi]
call edi
mov dword [0x43070c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423ba4
push ebx
push dword [esi]
call edi
mov dword [0x430714], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423bb8
push ebx
push dword [esi]
call edi
mov dword [0x430718], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423bcc
push ebx
push dword [esi]
call edi
mov dword [0x43072c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423be0
push ebx
push dword [esi]
call edi
mov dword [0x43071c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423bf4
push ebx
push dword [esi]
call edi
mov dword [0x430720], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c08
push ebx
push dword [esi]
call edi
mov dword [0x430724], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c14
push ebx
push dword [esi]
call edi
mov dword [0x430728], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c24
push ebx
push dword [esi]
call edi
mov dword [0x430730], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c38
push ebx
push dword [esi]
call edi
mov dword [0x430734], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c48
push ebx
push dword [esi]
call edi
mov dword [0x430738], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c60
push ebx
push dword [esi]
call edi
mov dword [0x43073c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c7c
push ebx
push dword [esi]
call edi
mov dword [0x430740], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423c94
push ebx
push dword [esi]
call edi
mov dword [0x430744], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423cb0
push ebx
push dword [esi]
call edi
mov dword [0x430748], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423ccc
push ebx
push dword [esi]
call edi
mov dword [0x43074c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423ce0
push ebx
push dword [esi]
call edi
mov dword [0x430750], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423cf8
push ebx
push dword [esi]
call edi
mov dword [0x430768], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d08
push ebx
push dword [esi]
call edi
mov dword [0x43076c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d18
push ebx
push dword [esi]
call edi
mov dword [0x430770], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d30
push ebx
push dword [esi]
call edi
mov dword [0x430754], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d48
push ebx
push dword [esi]
call edi
mov dword [0x430758], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d54
push ebx
push dword [esi]
call edi
mov dword [0x43075c], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d64
push ebx
push dword [esi]
call edi
mov dword [0x430760], eax
test eax, eax
je 0x402a7b
mov ebx, 0x423d70
push ebx
push dword [esi]
call edi
mov dword [0x430764], eax
test eax, eax
je 0x402a7b
push 0x20a
lea eax, [ebp - 0xa10]
mov dword [ebp - 0xc2c], 0
push eax
push dword [esi]
mov dword [ebp - 0xc30], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0xc38]
push eax
lea eax, [ebp - 0xa10]
push eax
call sub.VERSION.dll_GetFileVersionInfoSizeW
push eax
mov dword [ebp - 0xc38], eax
call fcn.0040c1cf
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x402a66
push ebx
push dword [ebp - 0xc38]
lea eax, [ebp - 0xa10]
push 0
push eax
call sub.VERSION.dll_GetFileVersionInfoW
push str.VarFileInfoTranslation
lea eax, [ebp - 0x804]
push 0x400
push eax
call fcn.0040ca4d
add esp, 0xc
lea eax, [ebp - 0xc20]
push eax
lea eax, [ebp - 0xc34]
push eax
lea eax, [ebp - 0x804]
push eax
push ebx
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x4029ed
cmp dword [ebp - 0xc20], 0
je 0x4029ed
mov ecx, dword [ebp - 0xc34]
movzx eax, word [ecx + 2]
push eax
movzx eax, word [ecx]
push eax
push str.StringFileInfo_04x_04xProductName
lea eax, [ebp - 0x804]
push 0x400
push eax
call fcn.0040ca4d
add esp, 0x14
lea eax, [ebp - 0xc20]
push eax
lea eax, [ebp - 0xc2c]
push eax
lea eax, [ebp - 0x804]
push eax
push ebx
call sub.VERSION.dll_VerQueryValueW
test eax, eax
mov esi, 0x423e04
mov ecx, esi
cmovne ecx, dword [ebp - 0xc2c]
mov dword [ebp - 0xc2c], ecx
mov ecx, dword [ebp - 0xc34]
movzx eax, word [ecx + 2]
push eax
movzx eax, word [ecx]
push eax
push 0x423e08
lea eax, [ebp - 0x804]
push 0x400
push eax
call fcn.0040ca4d
add esp, 0x14
lea eax, [ebp - 0xc20]
push eax
lea eax, [ebp - 0xc30]
push eax
lea eax, [ebp - 0x804]
push eax
push ebx
call sub.VERSION.dll_VerQueryValueW
test eax, eax
cmovne esi, dword [ebp - 0xc30]
mov dword [ebp - 0xc30], esi
lea eax, [ebp - 0xc20]
push eax
lea eax, [ebp - 0xc28]
push eax
push 0x423b50
push ebx
call sub.VERSION.dll_VerQueryValueW
test eax, eax
jne 0x402a1b
push 0x34
push eax
push dword [ebp - 0xc28]
call fcn.0040cae0
add esp, 0xc
mov ecx, dword [ebp - 0xc28]
mov esi, dword [ebp + 0x10]
mov edi, dword [ebp - 0xc3c]
movzx eax, word [ecx + 0xc]
push eax
movzx eax, word [ecx + 0xe]
push eax
movzx eax, word [ecx + 8]
push eax
movzx eax, word [ecx + 0xa]
push eax
push dword [ebp - 0xc30]
push dword [ebp - 0xc2c]
push str.__s______s_:_u._u._u._u
push esi
push edi
call fcn.0040ca4d
push esi
push edi
call fcn.0040cfad
push ebx
call fcn.0040cc32
add esp, 0x30
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040ca69
mov esp, ebp
pop ebp
ret 0xc
push dword [esi]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 3
lea eax, [ebp - 0xd3c]
mov dword [esi], 0
push ebx
lea ecx, [ebp - 0xd40]
mov dword [ebp - 0xd40], eax
call fcn.00401720
push dword [ebp - 0xd40]
mov edi, dword [ebp - 0xc3c]
lea eax, [esi + 4]
push eax
push str.ERROR_ON___s_.GetProcAddress___s__
push dword [ebp + 0x10]
push edi
call fcn.0040ca4d
mov eax, dword [ebp - 0xd40]
lea ecx, [ebp - 0xd3c]
add esp, 0x14
cmp eax, ecx
je 0x402cb6
push eax
call fcn.0040c91b
add esp, 4
jmp 0x402cb6
push 0
push 0x400
lea eax, [ebp - 0x804]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x402b35
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cc37
add esp, 8
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x402b60
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cc37
add esp, 8
xor ecx, ecx
mov word [eax], cx
push edi
lea eax, [ebp - 0x804]
push eax
push str.I_O_ERROR___s__ON__s
jmp 0x402caa
push 0
push 0x400
lea eax, [ebp - 0x804]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x402bc1
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cc37
add esp, 8
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x402bec
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cc37
add esp, 8
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x804]
push eax
push str.ERROR___s__ON_GetTemp_PathFileName___
push dword [ebp + 0x10]
push ebx
call fcn.0040ca4d
add esp, 0x10
jmp 0x402cb6
push 0
push 0x400
lea eax, [ebp - 0x804]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x402c58
lea eax, [ebp - 0x804]
push 0xd
push eax
call fcn.0040cc37
add esp, 8
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cce5
add esp, 8
test eax, eax
je 0x402c83
lea eax, [ebp - 0x804]
push 0x2e
push eax
call fcn.0040cc37
add esp, 8
xor ecx, ecx
mov word [eax], cx
test edi, 0xffff0000
jne 0x402c9d
movzx eax, word [edi]
push eax
lea eax, [ebp - 0x804]
push eax
push str.ERROR___s__ON_FindResource_NULL__u_RT_RCDATA_
jmp 0x402caa
push edi
lea eax, [ebp - 0x804]
push eax
push str.ERROR___s__ON_FindResource_NULL__s_RT_RCDATA_
push dword [ebp + 0x10]
push ebx
call fcn.0040ca4d
add esp, 0x14
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040ca69
mov esp, ebp
pop ebp
ret 0xc