Function at 0x100040be4
Capabilities:
Get file version info

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0x130
mov rax, qword [0x10004a110]
xor rax, rsp
mov qword [rsp + 0x120], rax
mov r12, r8
mov r13, rdx
mov rsi, rcx
test rdx, rdx
je 0x100040e71
test r8, r8
je 0x100040e71
and dword [rsp + 0x60], 0
lea rdx, [rsp + 0x60]
call sub.VERSION.dll_GetFileVersionInfoSizeW
mov ebp, eax
test eax, eax
jne 0x100040e03
mov rcx, rsi
call fcn.1000400f0
test eax, eax
jne 0x100040c53
mov eax, 0x80070002
jmp 0x100040e76
and qword [rsp + 0x30], 0
xor r9d, r9d
xor edx, edx
lea ebp, [r9 + 1]
mov rcx, rsi
mov dword [rsp + 0x28], 0x80
mov r8d, ebp
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x100040e71
lea r9, [rsp + 0x50]
xor r8d, r8d
xor edx, edx
mov rcx, rax
mov ebx, 0x80004005
call qword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
je 0x100040df8
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
test eax, eax
je 0x100040df8
lea rcx, [rsp + 0x70]
xor edx, edx
mov r8d, 0xac
call sub.msvcrt.dll_memset
movzx ecx, word [rsp + 0x42]
movzx eax, word [rsp + 0x46]
movzx r11d, word [rsp + 0x40]
shl ecx, 0x10
xor ebx, ebx
or ecx, eax
mov dword [r13], r11d
mov dword [r12], ecx
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetTimeZoneInformation]
cmp eax, 0xffffffff
je 0x100040df8
mov r8d, dword [rsp + 0x70]
movzx eax, r8w
neg ax
test r8d, r8d
cmovg ax, r8w
movzx ecx, ax
mov eax, 0x88888889
imul ecx
add edx, ecx
movzx ecx, word [rsp + 0x46]
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp r8d, ebp
movzx eax, word [rsp + 0x48]
jge 0x100040d46
add ax, dx
jmp 0x100040d61
cmp ax, dx
jae 0x100040d5e
mov r8d, 0xffff
add cx, r8w
add ax, 0x18
mov word [rsp + 0x46], cx
sub ax, dx
mov word [rsp + 0x48], ax
cmp ax, 0x17
jbe 0x100040da9
add cx, bp
mov edx, 0xffe8
add ax, dx
mov word [rsp + 0x46], cx
mov word [rsp + 0x48], ax
cmp cx, 0x20
jne 0x100040da9
movzx eax, word [rsp + 0x42]
mov word [rsp + 0x46], bp
add ax, bp
mov word [rsp + 0x42], ax
cmp ax, 0xd
jne 0x100040da9
add word [rsp + 0x40], bp
mov word [rsp + 0x42], bp
xorpd xmm0, xmm0
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0x40]
movsd qword [rsp + 0x58], xmm0
call qword [sym.imp.OLEAUT32.dll_VariantTimeToSystemTime]
test eax, eax
je 0x100040df8
movsd xmm0, qword [rsp + 0x58]
lea rdx, [rsp + 0x40]
call qword [sym.imp.OLEAUT32.dll_UnRegisterTypeLib]
test eax, eax
je 0x100040df8
movzx eax, word [rsp + 0x40]
movzx ecx, word [rsp + 0x42]
mov dword [r13], eax
movzx eax, word [rsp + 0x46]
shl ecx, 0x10
or ecx, eax
mov dword [r12], ecx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x100040e6d
mov rcx, rbp
call sub.msvcrt.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__
mov rdi, rax
test rax, rax
jne 0x100040e1a
mov eax, 0x8007000e
jmp 0x100040e76
mov r9, rax
mov r8d, ebp
xor edx, edx
mov rcx, rsi
mov ebx, 0x80004005
call sub.VERSION.dll_GetFileVersionInfoW
test eax, eax
je 0x100040e65
lea r9, [rsp + 0x58]
lea r8, [rsp + 0x50]
lea rdx, [0x10001f980]
mov rcx, rdi
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x100040e65
mov rcx, qword [rsp + 0x50]
xor ebx, ebx
mov eax, dword [rcx + 8]
mov dword [r13], eax
mov eax, dword [rcx + 0xc]
mov dword [r12], eax
mov rcx, rdi
call sub.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_
mov eax, ebx
jmp 0x100040e76
mov eax, 0x80004005
mov rcx, qword [rsp + 0x120]
xor rcx, rsp
call fcn.1000475f0
mov rbx, qword [rsp + 0x178]
add rsp, 0x130
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret