Function at 0x406c60
Capabilities:
Accept command line arguments
Check os version
Read file on windows
Set registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x76ec
call fcn.00415110
mov eax, dword [0x426004]
xor eax, esp
mov dword [esp + 0x76e8], eax
push ebx
push esi
push edi
xor esi, esi
push esi
push str.SECUREW2MGR
mov dword [esp + 0x1c], 0x1000
mov dword [esp + 0x18], esi
call dword [sym.imp.rtutils.dll_TraceRegisterExW]
mov dword [0x4278b4], eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager
mov eax, 0x40000
call fcn.0040b690
add esp, 4
push 0x20c
lea eax, [esp + 0x52cc]
push esi
push eax
call fcn.00410110
add esp, 0xc
push esi
push 1
push esi
xor edi, edi
mov dword [0x4285cc], esi
call dword [sym.imp.KERNEL32.dll_HeapCreate]
mov dword [0x4285cc], eax
cmp eax, esi
jne 0x406d03
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2InitializeHeap__::Heap_creation_failed____hit_error__d_
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
mov dword [esp + 0x10], edi
cmp edi, esi
jne 0x4073a3
call dword [sym.imp.KERNEL32.dll_GetVersion]
movzx ecx, al
shr eax, 8
movzx edx, al
mov dword [0x4285c4], ecx
mov dword [0x4285c8], edx
call dword [sym.imp.USER32.dll_GetDesktopWindow]
lea edx, [esp + 0x54d8]
mov ecx, eax
call fcn.0040ce10
mov dword [esp + 0x10], eax
cmp eax, esi
jne 0x4073a3
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov esi, eax
mov dword [esp + 0x20], esi
mov ebx, 0xd
test esi, esi
je 0x406dc8
mov ecx, dword [esp + 0x1c]
push ecx
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2RunManager__::nr_of_arguments:__ld
mov eax, 0x40000
call fcn.0040b690
add esp, 0xc
cmp dword [esp + 0x1c], 2
jle 0x406db4
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push str.sw2_res_default.dll
call edi
mov dword [0x4285b8], eax
test eax, eax
je 0x406db4
push str.sw2_lang.dll
call edi
mov dword [0x4285bc], eax
test eax, eax
jne 0x406dba
mov dword [esp + 0x10], ebx
jmp 0x406dc1
cmp dword [esp + 0x10], 0
je 0x406dd3
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [esp + 0x10], 0
jne 0x4073a7
mov edi, dword [esi + 4]
mov ecx, str.profile
mov eax, edi
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x406e06
test dx, dx
je 0x406e02
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x406e06
add eax, 4
add ecx, 4
test dx, dx
jne 0x406de0
xor eax, eax
jmp 0x406e0b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x406f1a
cmp dword [esp + 0x1c], 3
jne 0x407379
mov edx, dword [esi + 8]
push edx
lea eax, [esp + 0x52cc]
push 0x100
push eax
call fcn.0040f5cc
add esp, 0xc
cmp dword [0x4285c4], 5
jbe 0x406e48
call dword [sym.imp.USER32.dll_GetForegroundWindow]
jmp 0x406e4a
xor eax, eax
mov edx, dword [0x4285b8]
lea ecx, [esp + 0x52c8]
push ecx
push 0x4067f0
push eax
push 0x6d
push edx
call dword [sym.imp.USER32.dll_DialogBoxParamW]
test eax, eax
je 0x406e84
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2RunManager__::dialog_returned
mov eax, 0x40000
call fcn.0040b690
add esp, 8
jmp 0x406e9e
push str.none
lea eax, [esp + 0x52cc]
push 0x100
push eax
call fcn.0040f5cc
add esp, 0xc
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2RunManager__::opening_manager_reg_key
mov eax, 0x40000
call fcn.0040b690
push str.SOFTWARESecureW2Manager
lea edx, [esp + 0x3c]
lea ecx, [esp + 0x24]
call fcn.0040c2e0
add esp, 0xc
mov dword [esp + 0x10], eax
test eax, eax
jne 0x40737d
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::opened_manager_reg_key
mov eax, 0x40000
call fcn.0040b690
mov edx, dword [esp + 0x1c]
add esp, 4
push 0x200
lea ecx, [esp + 0x52cc]
push ecx
push 1
push 0
push str.SelectedProfile
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40737d
mov ecx, str.certificate
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x406f47
test dx, dx
je 0x406f43
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x406f47
add eax, 4
add ecx, 4
test dx, dx
jne 0x406f21
xor eax, eax
jmp 0x406f4c
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x407379
cmp dword [esp + 0x1c], 5
jne 0x407379
mov ecx, dword [esi + 8]
push ecx
lea edx, [esp + 0x64f4]
push 0x100
push edx
call fcn.0040f5cc
add esp, 0xc
mov ecx, str.NONE
lea eax, [esp + 0x64f0]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x406faa
test dx, dx
je 0x406fa6
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x406faa
add eax, 4
add ecx, 4
test dx, dx
jne 0x406f84
xor eax, eax
jmp 0x406faf
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x406fc3
lea edx, [esp + 0x38]
lea ecx, [esp + 0x64f0]
call fcn.00407600
mov edi, dword [esi + 0xc]
mov ecx, 0x41b8e8
mov eax, edi
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x406ff6
test dx, dx
je 0x406ff2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x406ff6
add eax, 4
add ecx, 4
test dx, dx
jne 0x406fd0
xor eax, eax
jmp 0x406ffb
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x407006
xor ebx, ebx
jmp 0x407086
mov ecx, 0x41b8ec
mov eax, edi
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x407036
test dx, dx
je 0x407032
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x407036
add eax, 4
add ecx, 4
test dx, dx
jne 0x407010
xor eax, eax
jmp 0x40703b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x407044
lea ebx, [eax + 1]
jmp 0x407086
mov ecx, 0x41b8f0
mov eax, edi
jmp 0x407050
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x407076
test dx, dx
je 0x407072
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x407076
add eax, 4
add ecx, 4
test dx, dx
jne 0x407050
xor eax, eax
jmp 0x40707b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x407379
lea ebx, [eax + 2]
mov eax, dword [esi + 0x10]
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
test edi, edi
je 0x4070ed
mov edx, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x18]
push ecx
push edx
lea eax, [esp + 0x66fc]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4070e4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esp + 0x14], eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::ReadFile_Failed___ld_
mov eax, 0x40000
call fcn.0040b690
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40710a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov dword [esp + 0x14], eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::CreateFile_Failed___ld_
mov eax, 0x40000
call fcn.0040b690
add esp, 8
cmp dword [esp + 0x10], 0
jne 0x40737d
mov ecx, dword [esp + 0x14]
push ecx
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::found_certificate__ld
mov eax, 0x40000
call fcn.0040b690
mov edx, dword [esp + 0x1c]
mov ecx, dword [0x4278b4]
add esp, 8
push 0
push 0
push 4
push edx
lea eax, [esp + 0x6700]
push eax
push 0x80006
push ecx
call dword [sym.imp.rtutils.dll_TraceDumpExW]
mov edx, dword [esp + 0x14]
push edx
lea eax, [esp + 0x66f4]
push eax
push 0x10001
call dword [sym.imp.CRYPT32.dll_CertCreateCertificateContext]
mov esi, eax
mov dword [esp + 0x34], esi
test esi, esi
je 0x407352
test ebx, ebx
jne 0x407182
push 0x4192cc
jmp 0x407187
push str.ROOT
push 0x20000
push 0
push 0x10001
push 0xa
call dword [sym.imp.CRYPT32.dll_CertOpenStore]
mov edi, eax
test edi, edi
je 0x4071dd
push 0
push 3
push esi
push edi
call dword [sym.imp.CRYPT32.dll_CertAddCertificateContextToStore]
test eax, eax
jne 0x4071d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::CertAddCertificateContextToStore____FAILED:__x
mov eax, 0x40000
call fcn.0040b690
add esp, 8
mov dword [esp + 0x10], 0x800b0109
push 1
push edi
call dword [sym.imp.CRYPT32.dll_CertCloseStore]
jmp 0x4071fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::CertOpenSystemStore____FAILED:__x
mov eax, 0x40000
call fcn.0040b690
add esp, 8
mov dword [esp + 0x10], 0x800b0109
cmp ebx, 2
jne 0x407345
lea eax, [esp + 0x28]
call fcn.0040b8a0
mov dword [esp + 0x10], eax
mov ecx, str.NONE
lea eax, [esp + 0x64f0]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x407246
test dx, dx
je 0x407242
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x407246
add eax, 4
add ecx, 4
test dx, dx
jne 0x407220
xor eax, eax
jmp 0x40724b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x407345
mov ecx, dword [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x66f4]
push edx
lea edi, [esp + 0x34]
lea ebx, [esp + 0x2c]
call fcn.0040b8e0
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x407325
mov ebx, dword [esp + 0x24]
push ebx
mov eax, 0x528c
lea esi, [esp + 0x3c]
call fcn.00415110
mov ecx, 0x14a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
call fcn.004017e0
add esp, 0x5290
test eax, eax
je 0x407316
mov eax, dword [esp + 0x2ec8]
push eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::profileData.dwNrOfTrustedRootCAInList:__ld
mov eax, 0x40000
call fcn.0040b690
mov eax, dword [esp + 0x2ed0]
mov ecx, dword [esp + 0x34]
push ecx
lea edx, [eax + eax*4]
lea eax, [esp + edx*4 + 0x2ed8]
push ebx
push eax
call fcn.00410190
inc dword [esp + 0x2edc]
add esp, 0x14
mov eax, 0x528c
lea esi, [esp + 0x38]
call fcn.00415110
mov ecx, 0x14a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x7f54]
call fcn.00409a60
add esp, 0x528c
mov dword [esp + 0x10], eax
lea eax, [esp + 0x24]
call fcn.0040bb70
mov esi, dword [esp + 0x34]
jmp 0x407338
push eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::SW2GetMD5_FAILED:__ld
mov eax, 0x40000
call fcn.0040b690
add esp, 8
mov ecx, dword [esp + 0x28]
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push esi
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
mov esi, dword [esp + 0x20]
jmp 0x40737d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::CertCreateCertificateContext____FAILED:__x
mov eax, 0x40000
call fcn.0040b690
mov esi, dword [esp + 0x28]
add esp, 8
mov dword [esp + 0x10], 0x800b0109
jmp 0x40737d
mov dword [esp + 0x10], ebx
mov eax, dword [0x4285b8]
mov edi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
test eax, eax
je 0x40738f
push eax
call edi
cmp dword [0x4285bc], 0
je 0x4073a7
mov edx, dword [0x4285bc]
push edx
call edi
jmp 0x4073a7
mov esi, dword [esp + 0x20]
test esi, esi
je 0x4073b2
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push str.SOFTWARESecureW2Manager
lea edx, [esp + 0x34]
lea ecx, [esp + 0x1c]
call fcn.0040c2e0
add esp, 4
test eax, eax
jne 0x407407
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::opened_manager_reg_key
mov eax, 0x40000
call fcn.0040b690
mov ecx, dword [esp + 0x1c]
add esp, 4
push 4
lea eax, [esp + 0x14]
push eax
push 4
push 0
push str.Error
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edx, dword [esp + 0x18]
push edx
mov dword [esp + 0x14], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [0x4285cc]
test eax, eax
jne 0x407429
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2DeInitializeHeap__::Heap_has_not_been_created_yet__exiting.
mov eax, 0x10000
call fcn.0040b690
add esp, 8
jmp 0x40745e
push eax
call dword [sym.imp.KERNEL32.dll_HeapDestroy]
test eax, eax
jne 0x407454
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2DeInitializeHeap__::Heap_destruction_failed____hit_error__d_
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
jmp 0x40745e
mov dword [0x4285cc], 0
mov eax, dword [esp + 0x10]
push eax
push str.SW2_TRACE_LEVEL_INFO::ProfileManager::returning:__ld
mov eax, 0x40000
call fcn.0040b690
mov ecx, dword [0x4278b4]
add esp, 8
push ecx
call dword [sym.imp.rtutils.dll_TraceDeregisterW]
mov ecx, dword [esp + 0x76f4]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040f43d
mov esp, ebp
pop ebp
ret