Function at 0x401f40
Capabilities:
Check if file exists
Check os version
Create directory
Get common file path
Get file attributes

Disassembly:
mov eax, 0x115c
call fcn.004107f0
mov eax, dword [0x428c1c]
xor eax, esp
mov dword [esp + 0x1158], eax
test byte [0x42ce44], 2
push esi
mov esi, dword [esp + 0x1168]
push edi
mov edi, 4
je 0x401fa3
cmp dword [0x42d460], edi
jb 0x401fa3
push str.____________start_n
call fcn.00402820
mov eax, dword [str.TRACE_LEVEL_INFORMATION]
push 0x42d468
push str.wmain
push 0xba
push eax
push str._n_RsBtSetup___16.16s_____5d___40.39hs__s
call fcn.004027c0
add esp, 0x18
mov eax, dword [esp + 0x1168]
cmp eax, 3
jg 0x402063
cmp eax, 1
je 0x401ff2
cmp eax, 2
jne 0x402063
mov ecx, dword [esi + 4]
push 0x423a1c
push ecx
call fcn.0040d1be
add esp, 8
test eax, eax
je 0x401feb
mov edx, dword [esi + 4]
push 0x423a24
push edx
call fcn.0040d1be
add esp, 8
test eax, eax
jne 0x402063
mov byte [0x42ce42], 1
call fcn.004013d0
test eax, eax
jne 0x4020bc
push str.NO_authorized_card_exist__n
call fcn.0040cb59
add esp, 4
test byte [0x42ce44], 2
je 0x402049
cmp dword [0x42d460], edi
jb 0x402049
push str.NO_authorized_card_exist__IsHPCard_return__1_n
call fcn.00402820
mov eax, dword [str.TRACE_LEVEL_INFORMATION]
push 0x42d468
push str.wmain
push 0xe8
push eax
push str._n_RsBtSetup___16.16s_____5d___40.39hs__s
call fcn.004027c0
add esp, 0x18
pop edi
or eax, 0xffffffff
pop esi
mov ecx, dword [esp + 0x1158]
xor ecx, esp
call fcn.0040c6db
add esp, 0x115c
ret
push str.Usage:
call fcn.0040cb59
push 0x423998
call fcn.0040cb59
push 0x42399c
call fcn.0040cb59
push 0x423998
call fcn.0040cb59
push str.Install.exe__q____Silent_install
call fcn.0040cb59
push 0x423998
call fcn.0040cb59
add esp, 0x18
pop edi
or eax, 0xffffffff
pop esi
mov ecx, dword [esp + 0x1158]
xor ecx, esp
call fcn.0040c6db
add esp, 0x115c
ret
push ebx
push 0x104
push 0x42d258
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x42d258
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x94e]
push edx
mov word [esp + 0x950], cx
call fcn.0040fdf0
mov ebx, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
add esp, 0xc
push 0
push 0x23
lea eax, [esp + 0x94c]
push eax
push 0
call ebx
lea eax, [esp + 0x944]
add eax, 0xfffffffe
lea ebx, [ebx]
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x402120
mov ecx, dword [str.Realtek]
mov edx, dword [0x423874]
mov dword [eax], ecx
mov ecx, dword [0x423878]
mov dword [eax + 4], edx
mov edx, dword [0x42387c]
push ebp
mov ebp, dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
mov dword [eax + 8], ecx
mov cx, word [0x423880]
mov dword [eax + 0xc], edx
push 0
lea edx, [esp + 0x94c]
push edx
push 0
mov word [eax + 0x10], cx
call ebp
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0xd62]
push ecx
mov word [esp + 0xd64], ax
call fcn.0040fdf0
add esp, 0xc
xor eax, eax
jmp 0x4021a0
movzx ecx, word [esp + eax + 0x948]
mov word [esp + eax + 0xd58], cx
add eax, 2
test cx, cx
jne 0x4021a0
lea eax, [esp + 0xd58]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4021c2
mov edx, dword [str._setup.log]
mov ecx, dword [0x423b88]
mov dword [eax], edx
mov edx, dword [0x423b8c]
mov dword [eax + 4], ecx
mov ecx, dword [0x423b90]
mov dword [eax + 8], edx
mov edx, dword [0x423b94]
mov dword [eax + 0xc], ecx
mov cx, word [0x423b98]
mov dword [eax + 0x10], edx
xor edx, edx
push 0x206
mov word [eax + 0x14], cx
push edx
lea eax, [esp + 0x132]
push eax
mov word [esp + 0x134], dx
call fcn.0040fdf0
add esp, 0xc
xor eax, eax
jmp 0x402230
movzx ecx, word [esp + eax + 0x948]
mov word [esp + eax + 0x128], cx
add eax, 2
test cx, cx
jne 0x402230
lea edi, [esp + 0x128]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x402252
push 0
mov ecx, 6
mov esi, str.Install.log
rep movsd dword es:[edi], dword [esi]
push 0
push 3
push 0
push 1
push 0x80000000
lea ecx, [esp + 0x140]
push ecx
movsw word es:[edi], word [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
lea edx, [esp + 0x128]
push edx
push 0x42d258
push str.CurrentPath
push str.General
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push str.IsWow64Process
push str.kernel32
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x42cc30], eax
test eax, eax
je 0x4022e0
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [0x42cc30]
cmp dword [esp + 0x10], 0
push 0
je 0x4022f5
push 0x2a
lea ecx, [esp + 0x748]
push ecx
jmp 0x4022ff
push 0x26
lea edx, [esp + 0x748]
push edx
push 0
call ebx
lea edi, [esp + 0x740]
add edi, 0xfffffffe
lea ecx, [ecx]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x402310
mov ecx, 0xd
mov esi, str.REALTEKREALTEK_Bluetooth
rep movsd dword es:[edi], dword [esi]
push 0
lea eax, [esp + 0x744]
push eax
push 0
movsw word es:[edi], word [esi]
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
lea ecx, [esp + 0x128]
push ecx
lea edx, [esp + 0x744]
push edx
push str.INSTALLDIR
push str.General
call ebx
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0xf6a]
push ecx
mov word [esp + 0xf6c], ax
call fcn.0040fdf0
xor edx, edx
push 0x206
push edx
lea eax, [esp + 0x346]
push eax
mov word [esp + 0x348], dx
call fcn.0040fdf0
add esp, 0x18
xor eax, eax
pop ebp
lea ebx, [ebx]
movzx ecx, word [eax + 0x42d258]
mov word [esp + eax + 0xf5c], cx
add eax, 2
test cx, cx
jne 0x4023a0
xor eax, eax
lea esp, [esp]
movzx ecx, word [esp + eax + 0x73c]
mov word [esp + eax + 0x32c], cx
add eax, 2
test cx, cx
jne 0x4023c0
lea edi, [esp + 0xf5c]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4023e2
mov ecx, 9
mov esi, str.BTIsConfigSP.ini
rep movsd dword es:[edi], dword [esi]
lea edi, [esp + 0x32c]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x402404
mov ecx, 8
mov esi, str.BTIsConfig.ini
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0xf5c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x402483
push str.BTIsConfigSP.ini_Not_Exist__n
call fcn.0040cb59
lea edx, [esp + 0x128]
push 0x423884
push edx
call fcn.0040c9a2
mov esi, eax
add esp, 0xc
test esi, esi
je 0x402468
push str.BTIsConfigSP.ini_Not_Exist__n
push esi
call fcn.0040c7ba
push esi
call fcn.0040d031
add esp, 0xc
pop ebx
pop edi
or eax, 0xffffffff
pop esi
mov ecx, dword [esp + 0x1158]
xor ecx, esp
call fcn.0040c6db
add esp, 0x115c
ret
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0xb56]
push ecx
mov word [esp + 0xb58], ax
call fcn.0040fdf0
add esp, 0xc
lea edx, [esp + 0x10]
push edx
mov dword [esp + 0x14], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [esp + 0x14], 6
jne 0x4024fc
cmp dword [esp + 0x18], 1
jne 0x4024fc
lea eax, [esp + 0x124]
push 0x423884
push eax
call fcn.0040c9a2
mov esi, eax
add esp, 8
test esi, esi
je 0x4024f3
push str.Its_Windows_7__n
push esi
call fcn.0040c7ba
push esi
call fcn.0040d031
add esp, 0xc
mov byte [0x42ce43], 1
jmp 0x402509
cmp byte [0x42ce43], 0
je 0x402634
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x336]
push edx
mov word [esp + 0x338], cx
call fcn.0040fdf0
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x54a]
push ecx
mov word [esp + 0x54c], ax
call fcn.0040fdf0
add esp, 0x18
xor eax, eax
jmp 0x402550
movzx ecx, word [eax + 0x42d258]
mov word [esp + eax + 0x32c], cx
add eax, 2
test cx, cx
jne 0x402550
xor eax, eax
lea esp, [esp]
movzx ecx, word [esp + eax + 0x73c]
mov word [esp + eax + 0x534], cx
add eax, 2
test cx, cx
jne 0x402570
lea edi, [esp + 0x32c]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x402592
mov ecx, 8
mov esi, str.BTIsConfig.ini
rep movsd dword es:[edi], dword [esi]
lea edi, [esp + 0x534]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4025b4
mov ecx, 8
mov esi, str.BTIsConfig.ini
rep movsd dword es:[edi], dword [esi]
cmp byte [0x42ce42], al
je 0x402608
lea edx, [esp + 0xd54]
push edx
push 0x42d258
lea eax, [esp + 0xb54]
push str._s_setup.exe__s__f2__s_
push eax
call fcn.0040d251
add esp, 0x10
lea ecx, [esp + 0x124]
push ecx
push str.FullPackageSilentInstall
jmp 0x40275c
push 0x42d258
lea edx, [esp + 0xb50]
push str._s_setup.exe
push edx
call fcn.0040d251
add esp, 0xc
lea eax, [esp + 0x124]
push eax
push str.FullPackageUIInstall
jmp 0x40275c
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x53e]
push edx
mov word [esp + 0x540], cx
call fcn.0040fdf0
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x342]
push ecx
mov word [esp + 0x344], ax
call fcn.0040fdf0
add esp, 0x18
xor eax, eax
jmp 0x402680
movzx ecx, word [eax + 0x42d258]
mov word [esp + eax + 0x534], cx
add eax, 2
test cx, cx
jne 0x402680
xor eax, eax
lea esp, [esp]
movzx ecx, word [esp + eax + 0x73c]
mov word [esp + eax + 0x32c], cx
add eax, 2
test cx, cx
jne 0x4026a0
lea edi, [esp + 0x534]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4026c2
mov ecx, 9
mov esi, str.BTIsConfigSP.ini
rep movsd dword es:[edi], dword [esi]
lea edi, [esp + 0x32c]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4026e4
mov ecx, 8
mov esi, str.BTIsConfig.ini
rep movsd dword es:[edi], dword [esi]
cmp byte [0x42ce42], al
je 0x402735
lea edx, [esp + 0xd54]
push edx
push 0x42d258
lea eax, [esp + 0xb54]
push str._s_setup.exe__s__f2__s_
push eax
call fcn.0040d251
add esp, 0x10
lea ecx, [esp + 0x124]
push ecx
push str.SilentInstallHPPackage
jmp 0x40275c
push 0x42d258
lea edx, [esp + 0xb50]
push str._s_setup.exe
push edx
call fcn.0040d251
add esp, 0xc
lea eax, [esp + 0x124]
push eax
push str.HPPackageNoSilent
push str.InstallType
push str.General
call ebx
lea ecx, [esp + 0xb4c]
push ecx
call fcn.00401e80
add esp, 4
test al, al
jne 0x4027a4
push str.CallInstallShield_Failed__n
call fcn.0040cb59
add esp, 4
pop ebx
pop edi
or eax, 0xffffffff
pop esi
mov ecx, dword [esp + 0x1158]
xor ecx, esp
call fcn.0040c6db
add esp, 0x115c
ret
mov ecx, dword [esp + 0x1164]
pop ebx
pop edi
pop esi
xor ecx, esp
xor eax, eax
call fcn.0040c6db
add esp, 0x115c
ret