Function at 0x4054c0
Capabilities:
Check os version

Disassembly:
push 0xffffffffffffffff
push 0x440e70
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push ebp
push esi
push edi
mov eax, dword [0x490130]
xor eax, esp
push eax
lea eax, [esp + 0x30]
mov dword fs:[0], eax
mov esi, ecx
lea ecx, [esi + 0x74]
call fcn.00402810
xor ebp, ebp
cmp eax, 2
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], ebp
jne 0x405566
cmp dword [esi + 0x181], ebp
jne 0x405528
push ebp
push ebp
push str.The_STLinkUSBDriver.dll_file_is_nonexistent_or_in_the_wrong_position._r_nPlease_check_it.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.The_STLinkUSBDriver.dll_file_is_nonexistent_or_in_the_wrong_position._Please_check_it.
push 0x494320
call fcn.00403c50
add esp, 8
mov edi, eax
push 0xa
mov ecx, edi
call fcn.00403e60
mov ecx, edi
call fcn.00403aa0
mov dword [esi + 0x185], ebp
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
cmp eax, 3
jne 0x40559a
cmp dword [esi + 0x181], ebp
jne 0x405593
push ebp
push ebp
push str.No_ST_Link_device_detected._r_nPlease_connect_it_and_then_retry.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.No_ST_Link_device_detected._Please_connect_it_and_then_retry.
jmp 0x40552d
cmp eax, 5
mov ebx, 1
jne 0x4056a1
cmp dword [esi + 0x181], ebp
jne 0x405672
push ebp
push ebp
push str.Several_instances_of_ST_Link_have_been_detected._r_nTo_avoid_any_confusion_for_the_firmware_upgrade__it_is_recommended_to_connect_only_one_ST_Link.
call fcn.004078dc
lea edi, [esi + 0x74]
mov ecx, edi
call fcn.00402760
cmp eax, ebx
jne 0x4057d2
cmp byte [esi + 0xb7], 0
je 0x4057d2
mov ecx, edi
call fcn.00401eb0
cmp word [esi + 0xb5], 0x374b
jne 0x4055fe
cmp byte [esi + 0xb3], 0x3f
jne 0x4055fe
mov dword [esp + 0x18], ebx
cmp eax, ebx
jne 0x4057d2
mov al, byte [esi + 0xb2]
cmp al, 2
ja 0x40561b
jne 0x405639
cmp byte [esi + 0xb3], 0x12
jb 0x405639
mov ecx, edi
call fcn.00402930
cmp eax, ebx
jne 0x4056db
mov ecx, edi
call fcn.00402760
cmp eax, ebx
jne 0x4057d2
cmp byte [esi + 0xb7], 0
je 0x4057d2
cmp dword [esi + 0x181], ebp
jne 0x4057c8
push ebp
push ebp
push str.ST_Link_is_not_in_the_DFU_mode._r_nPlease_restart_it.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.Several_instances_of_ST_Link_have_been_detected._To_avoid_any_confusion_for_the_firmware_upgrade__it_is_recommended_to_connect_only_one_ST_Link.
push 0x494320
call fcn.00403c50
add esp, 8
mov edi, eax
push 0xa
mov ecx, edi
call fcn.00403e60
mov ecx, edi
call fcn.00403aa0
mov dword [esi + 0x185], ebp
jmp 0x4055c0
cmp eax, ebx
je 0x4055c0
cmp dword [esi + 0x181], ebp
jne 0x4056d1
push ebp
push ebp
push str.Communication_error_with_ST_Link._r_nTry_to_start_it.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.Communication_error_with_ST_Link._r_nTry_to_start_it.
jmp 0x40552d
cmp eax, 2
je 0x405728
cmp eax, 3
je 0x40575a
cmp eax, 6
je 0x4056fc
cmp eax, 4
jne 0x405639
cmp eax, 6
jne 0x405796
cmp dword [esi + 0x181], ebp
jne 0x40578c
push ebp
push ebp
push str.Error_in_GoToUsbLoader_command._r_nEnsure_the_hardware_is_recent_enough_for_the_software._r_nTry_to_restart_it.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
cmp dword [esi + 0x181], ebp
jne 0x405750
push ebp
push ebp
push str.ST_Link_DLL_error._r_nCheck_software_installation.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.ST_Link_DLL_error._Check_software_installation.
jmp 0x40552d
cmp dword [esi + 0x181], ebp
jne 0x405782
push ebp
push ebp
push str.No_ST_Link_found_after_GoToUsbLoader_command._r_nWait_for_the_end_of_USB_enumeration_then_try_again.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.No_ST_Link_found_after_GoToUsbLoader_command._Wait_for_the_end_of_USB_enumeration_then_try_again.
jmp 0x40552d
push str.Error_in_GoToUsbLoader_command._Ensure_the_hardware_is_recent_enough_for_the_software._Try_to_restart_it.
jmp 0x40552d
cmp dword [esi + 0x181], ebp
jne 0x4057be
push ebp
push ebp
push str.Error_after_GoToUsbLoader_command._r_nEnsure_the_hardware_is_recent_enough_for_the_software._r_nTry_to_restart_it.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.Error_after_GoToUsbLoader_command._Ensure_the_hardware_is_recent_enough_for_the_software._Try_to_restart_it.
jmp 0x40552d
push str.ST_Link_is_not_in_the_DFU_mode._Please_restart_it.
jmp 0x40552d
mov ecx, edi
call fcn.00402180
cmp byte [esi + 0xb8], 2
jb 0x405810
lea eax, [esp + 0x20]
push eax
mov ecx, edi
call fcn.00401fe0
mov eax, dword [esp + 0x20]
test al, 1
je 0x4057ff
mov word [esi + 0xaf], 0x80
and al, 2
neg al
sbb eax, eax
and eax, 0x5000
mov dword [esi + 0x529], eax
cmp word [esi + 0xaf], 0x40
jae 0x40584c
cmp dword [esi + 0x181], ebp
jne 0x405842
push ebp
push ebp
push str.Unexpected_flash_size_for_ST_Link_micro._Dont_know_how_to_upgrade.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.Unexpected_flash_size_for_ST_Link_micro._Dont_know_how_to_upgrade.
jmp 0x40552d
cmp byte [esi + 0xb1], 0xff
jne 0x40595d
cmp dword [esi + 0x181], ebp
jne 0x4058ee
push ebx
lea ecx, [esi + 0x331]
call fcn.004125b4
push ebx
lea ecx, [esi + 0x385]
call fcn.004125b4
push ebx
lea ecx, [esi + 0x3d9]
call fcn.004125b4
push ebx
lea ecx, [esi + 0x42d]
call fcn.004125b4
push ebx
lea ecx, [esi + 0x481]
call fcn.004125b4
push ebx
lea ecx, [esi + 0x4d5]
call fcn.004125b4
mov ecx, edi
call fcn.00401eb0
lea ecx, [esp + 0x14]
call fcn.00404d00
lea ecx, [esp + 0x18]
mov dword [esp + 0x38], ebp
call fcn.00404d00
cmp word [esi + 0xb5], 0x3744
mov byte [esp + 0x38], 1
jne 0x405a9d
mov edi, 1
lea ebx, [edi + 0xc]
lea ebp, [edi + 3]
jmp 0x405afb
mov eax, dword [esi + 0x189]
cmp dword [eax + 0xa8], ebx
mov dword [esp + 0x1c], ebx
jne 0x405909
mov byte [esi + 0xb1], 0x4a
jmp 0x4058ad
cmp dword [eax + 0xac], ebx
jne 0x40591a
mov byte [esi + 0xb1], 0x53
jmp 0x4058ad
cmp dword [eax + 0xb0], ebx
jne 0x40592b
mov byte [esi + 0xb1], 0x4d
jmp 0x4058ad
cmp dword [eax + 0xb4], ebx
jne 0x40593f
mov byte [esi + 0xb1], 0x42
jmp 0x4058ad
cmp dword [eax + 0xb8], ebx
jne 0x405953
mov byte [esi + 0xb1], 0x41
jmp 0x4058ad
push str.ST_Link_is_blank._You_must_choose_which_firmware_to_program.
jmp 0x40552d
cmp dword [esi + 0x181], ebp
jne 0x4059ad
push ebp
lea ecx, [esi + 0x331]
call fcn.004125b4
push ebp
lea ecx, [esi + 0x385]
call fcn.004125b4
push ebp
lea ecx, [esi + 0x3d9]
call fcn.004125b4
push ebp
lea ecx, [esi + 0x42d]
call fcn.004125b4
push ebp
lea ecx, [esi + 0x481]
call fcn.004125b4
push ebp
lea ecx, [esi + 0x4d5]
call fcn.004125b4
mov al, byte [esi + 0xb1]
cmp al, 0x4a
je 0x4059f9
cmp al, 0x53
je 0x4059f9
cmp al, 0x4d
je 0x4059f9
cmp al, 0x42
je 0x4059f9
cmp al, 0x41
je 0x4059f9
cmp dword [esi + 0x181], ebp
jne 0x4059ef
push ebp
push ebp
push str.The_content_of_the_ST_Link_is_corrupt.
call fcn.004078dc
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push str.The_content_of_the_ST_Link_is_corrupt.
jmp 0x40552d
cmp dword [esp + 0x18], ebx
jne 0x405a0a
cmp al, 0x4a
jne 0x405a0a
mov byte [esi + 0xb1], 0x42
cmp dword [esi + 0x181], ebx
jne 0x4058ad
cmp byte [esi + 0xb3], 0x3f
je 0x4058ad
mov eax, dword [esi + 0x189]
cmp dword [eax + 0xa8], ebx
jne 0x405a44
cmp byte [esi + 0xb1], 0x4a
je 0x405a44
push str.Can_not_update_with_jtag_only_firmware_a_ST_Link_that_is_already_programmed_with_another_type_of_firmware.
jmp 0x40552d
cmp dword [eax + 0xac], ebx
jne 0x405a5f
cmp byte [esi + 0xb1], 0x53
je 0x405a5f
push str.Can_not_update_with_swim_only_firmware_a_ST_Link_that_is_already_programmed_with_another_type_of_firmware.
jmp 0x40552d
cmp dword [eax + 0xb0], ebx
jne 0x405a7a
cmp byte [esi + 0xb1], 0x4d
je 0x405a7a
push str.Can_not_update_with_jtagswim_firmware_a_ST_Link_that_is_already_programmed_with_another_type_of_firmware.
jmp 0x40552d
cmp dword [eax + 0xb4], ebx
jne 0x4058ad
cmp byte [esi + 0xb1], 0x42
je 0x4058ad
push str.Can_not_update_with_swdmsdvcp_firmware_a_ST_Link_that_is_already_programmed_with_another_type_of_firmware.
jmp 0x40552d
mov al, byte [esi + 0xb1]
cmp al, 0x42
mov edi, 2
lea ebx, [edi + 0x19]
jne 0x405ab4
lea ebp, [edi + 0xd]
jmp 0x405ac2
sub al, 0x41
neg al
sbb eax, eax
and eax, 5
add eax, 1
mov ebp, eax
mov al, byte [esi + 0xb8]
cmp al, 1
je 0x405afb
cmp al, 2
je 0x405afb
cmp dword [esi + 0x181], 0
jne 0x405ae9
push 0
push 0
push str.Old_firmware_loader_detected_on_ST_Link_V2._r_nFor_full_operation__especially_SWV_support___please_contact_ST_for_upgrading.
call fcn.004078dc
jmp 0x405afb
push str.Old_firmware_loader_detected_on_ST_Link_V2._For_full_operation__especially_SWV_support___please_contact_ST_for_upgrading.
push 0x494320
call fcn.00403c50
add esp, 8
cmp dword [esp + 0x1c], 1
jne 0x405b3b
lea ecx, [esp + 0x14]
push str.V0.0.0
push ecx
call fcn.00404f00
add esp, 8
cmp dword [esi + 0x181], 1
jne 0x405c7d
mov byte [esi + 0xb2], 0
mov byte [esi + 0xb3], 0
mov byte [esi + 0xb4], 0
jmp 0x405c7d
mov al, byte [esi + 0xb1]
cmp al, 0x4a
jne 0x405b85
movzx edx, byte [esi + 0xb4]
movzx eax, byte [esi + 0xb3]
movzx ecx, byte [esi + 0xb2]
push edx
push eax
push ecx
lea edx, [esp + 0x20]
push str.V_d.J_d.S_d_STM32_Debugger
push edx
call fcn.00404f00
push ebx
push edi
lea eax, [esp + 0x34]
push str.V_d.J_d.S0
push eax
call fcn.00404f00
add esp, 0x24
jmp 0x405c7d
cmp al, 0x53
jne 0x405bc9
movzx ecx, byte [esi + 0xb4]
movzx edx, byte [esi + 0xb3]
movzx eax, byte [esi + 0xb2]
push ecx
push edx
push eax
lea ecx, [esp + 0x20]
push str.V_d.J_d.S_d_STM8_Debugger
push ecx
call fcn.00404f00
push ebp
push edi
lea edx, [esp + 0x34]
push str.V_d.J0.S_d
push edx
call fcn.00404f00
add esp, 0x24
jmp 0x405c7d
cmp al, 0x4d
jne 0x405c03
movzx eax, byte [esi + 0xb4]
movzx ecx, byte [esi + 0xb3]
movzx edx, byte [esi + 0xb2]
push eax
push ecx
push edx
lea eax, [esp + 0x20]
push str.V_d.J_d.S_d_STM32STM8_Debugger
push eax
call fcn.00404f00
push ebp
push ebx
push edi
push str.V_d.J_d.S_d
lea ecx, [esp + 0x3c]
push ecx
jmp 0x405c75
cmp al, 0x42
jne 0x405c3d
movzx edx, byte [esi + 0xb4]
movzx eax, byte [esi + 0xb3]
movzx ecx, byte [esi + 0xb2]
push edx
push eax
push ecx
lea edx, [esp + 0x20]
push str.V_d.J_d.M_d_STM32_DebugMass_storage
push edx
call fcn.00404f00
push ebp
push ebx
push edi
push str.V_d.J_d.M_d
lea eax, [esp + 0x3c]
push eax
jmp 0x405c75
cmp al, 0x41
jne 0x405c7d
movzx ecx, byte [esi + 0xb4]
movzx edx, byte [esi + 0xb3]
movzx eax, byte [esi + 0xb2]
push ecx
push edx
push eax
lea ecx, [esp + 0x20]
push str.V_d.J_d.A_d_STM32_DebugAudio
push ecx
call fcn.00404f00
push ebp
push ebx
push edi
push str.V_d.J_d.A_d
lea edx, [esp + 0x3c]
push edx
call fcn.00404f00
add esp, 0x28
cmp dword [esi + 0x181], 0
jne 0x405ce1
push 0x3e8
mov ecx, esi
call fcn.00412442
test eax, eax
je 0x405c99
mov eax, dword [eax + 0x20]
mov ecx, dword [esp + 0x14]
mov edi, dword [sym.imp.USER32.dll_SetWindowTextA]
push ecx
push eax
call edi
push 1
lea ecx, [esi + 0x1e1]
call fcn.004125f0
push 0x3ea
mov ecx, esi
call fcn.00412442
test eax, eax
jne 0x405cd1
mov edx, dword [esp + 0x18]
push edx
push eax
call edi
jmp 0x405dca
mov edx, dword [esp + 0x18]
mov eax, dword [eax + 0x20]
push edx
push eax
call edi
jmp 0x405dca
mov eax, dword [esp + 0x14]
push eax
push str.Firmware_version_detected:
push 0x494320
call fcn.00403c50
add esp, 8
push eax
call fcn.00403c50
add esp, 8
mov edi, eax
push 0xa
mov ecx, edi
call fcn.00403e60
mov ecx, edi
call fcn.00403aa0
mov ecx, dword [esi + 0x189]
cmp dword [ecx + 0xc0], 0
jne 0x405d98
mov al, byte [esi + 0xb1]
cmp al, 0x4a
jne 0x405d67
movzx edx, byte [esi + 0xb3]
cmp edx, ebx
jl 0x405d67
push str.Detected_firmware_is_up_to_date__use__force_prog_to_enforce_reprogramming.
push 0x494320
call fcn.00403c50
add esp, 8
mov edi, eax
push 0xa
mov ecx, edi
call fcn.00403e60
mov ecx, edi
call fcn.00403aa0
mov dword [esi + 0x185], 0
jmp 0x405dca
cmp al, 0x53
jne 0x405d76
movzx ecx, byte [esi + 0xb4]
cmp ecx, ebp
jge 0x405d37
cmp al, 0x4d
je 0x405d82
cmp al, 0x42
je 0x405d82
cmp al, 0x41
jne 0x405d98
movzx edx, byte [esi + 0xb3]
cmp edx, ebx
jl 0x405d98
movzx eax, byte [esi + 0xb4]
cmp eax, ebp
jge 0x405d37
mov ecx, dword [esp + 0x18]
push ecx
push str.Updating_to_version:
push 0x494320
call fcn.00403c50
add esp, 8
push eax
call fcn.00403c50
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00403e60
mov ecx, esi
call fcn.00403aa0
lea ecx, [esp + 0x18]
call fcn.00404d30
lea ecx, [esp + 0x14]
call fcn.00404d30
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret