Function at 0x513d590
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x522b270
mov eax, dword fs:[0]
push eax
sub esp, 0x870
mov eax, dword [0x53f3c3c]
xor eax, esp
mov dword [esp + 0x868], eax
push ebx
push esi
push edi
mov eax, dword [0x53f3c3c]
xor eax, esp
push eax
lea eax, [esp + 0x880]
mov dword fs:[0], eax
mov edi, dword [ebp + 0x14]
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x20]
mov dword [esp + 0x28], esi
mov dword [esp + 0x24], edi
mov dword [esp + 0x54], ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], ecx
test edi, edi
je 0x513e0b1
test ebx, ebx
je 0x513e0b1
mov dword [ebx], 0
mov ebx, dword [ebp + 0xc]
push ebx
mov ecx, 0x53f4cc8
call fcn.050674e0
test al, al
jne 0x513d678
push str._ERROR:
push 0xff
push 0xbee
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov dword [esp + 0x888], 1
mov edx, dword [0x56bc0f0]
push esi
push ebx
push str.__d___s__:_invalid_handle_
push edx
push eax
call fcn.051ae2d0
add esp, 0x14
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov eax, 0xd
jmp 0x513e10e
cmp dword [esp + 0x2c], 0
je 0x513d6de
push 0x52c722a
push 1
push 0xbf3
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov edi, eax
mov dword [esp + 0x888], 2
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov ecx, dword [esp + 0x2c]
mov eax, dword [eax + 8]
push ecx
push esi
push ebx
push str.__d___s__:_Prefix:__s
push eax
push edi
call fcn.051ae2d0
add esp, 0x18
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x30]
call fcn.051ae2c0
push 0x52c722a
push 1
push 0xbf5
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov edi, eax
mov dword [esp + 0x888], 3
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov eax, dword [eax + 8]
push esi
push ebx
push str.__d___s__:_Enter_...
push eax
push edi
call fcn.051ae2d0
add esp, 0x14
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x30]
call fcn.051ae2c0
push 0x52c722a
push 1
push 0xbf6
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov edi, eax
mov dword [esp + 0x888], 4
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov edx, dword [ebp + 0x10]
mov eax, dword [eax + 8]
push edx
push esi
push ebx
push str.__d___s__:_ms_scan_time_out:_d_...
push eax
push edi
call fcn.051ae2d0
add esp, 0x18
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov eax, 0xff
lea ecx, [esp + 0x58]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
call fcn.050124f0
mov dword [esp + 0x888], 5
xor eax, eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x513d9e9
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x513d7ec
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x290]
push ecx
call sub.brom.dll_Ordinal_49
jmp 0x513d9fc
push eax
lea ecx, [esp + 0x74]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov byte [esp + 0x888], 6
xor edi, edi
push 1
push edi
lea edx, [esp + 0x20]
push edx
lea ecx, [esp + 0x7c]
mov byte [esp + 0x24], 0x20
call dword [sym.imp.MSVCP90.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::find_char_const___unsigned_int__unsigned_int_const]
mov esi, eax
lea ecx, [esp + 0x30]
cmp esi, 0xffffffff
je 0x513d85b
sub eax, edi
push eax
push edi
push ecx
lea ecx, [esp + 0x7c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::substr_unsigned_int__unsigned_int_]
mov byte [esp + 0x888], 7
push eax
lea ecx, [esp + 0x5c]
call fcn.05012550
mov byte [esp + 0x888], 6
lea ecx, [esp + 0x30]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea edi, [esi + 1]
jmp 0x513d801
mov edx, dword [sym.imp.MSVCP90.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov eax, dword [edx]
push eax
push edi
push ecx
lea ecx, [esp + 0x7c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::substr_unsigned_int__unsigned_int_]
mov byte [esp + 0x888], 8
push eax
lea ecx, [esp + 0x5c]
call fcn.05012550
mov byte [esp + 0x888], 6
lea ecx, [esp + 0x30]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov ecx, dword [esp + 0x68]
sub ecx, dword [esp + 0x64]
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov esi, edx
shr esi, 0x1f
add esi, edx
xor ecx, ecx
mov eax, esi
mov edx, 4
mul edx
seto cl
mov dword [esp + 0x4c], esi
neg ecx
or ecx, eax
push ecx
call sub.mfc90.dll_Ordinal_265
xor esi, esi
add esp, 4
mov dword [esp + 0x50], eax
cmp dword [esp + 0x4c], esi
jbe 0x513d905
lea edi, [esi + 0x10]
lea ecx, [ecx]
push esi
lea ecx, [esp + 0x5c]
call fcn.05009810
cmp dword [eax + 0x18], edi
jb 0x513d8f4
mov eax, dword [eax + 4]
jmp 0x513d8f7
add eax, 4
mov ecx, dword [esp + 0x50]
mov dword [ecx + esi*4], eax
inc esi
cmp esi, dword [esp + 0x4c]
jb 0x513d8e0
push 0x52c722a
push 1
push 0xc20
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov edi, eax
mov byte [esp + 0x888], 9
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x28]
mov eax, dword [eax + 8]
push edx
push esi
push ebx
push str.__d___s__:_Com_Port_Enumerate_with_filter:__s
push eax
push edi
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 6
lea ecx, [esp + 0x30]
call fcn.051ae2c0
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x294]
push edx
call sub.brom.dll_Ordinal_245
push 0x52c722a
push 1
push 0xc22
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
mov edi, eax
call fcn.051ae270
mov dword [esp + 0x20], eax
mov byte [esp + 0x888], 0xa
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov eax, dword [eax + 8]
push esi
push ebx
push str.__d___s__:_Com_Port_Enumerate_with_filter
push eax
mov eax, dword [esp + 0x30]
push eax
call fcn.051ae2d0
add esp, 0x14
mov byte [esp + 0x888], 6
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x70]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
jmp 0x513d9fe
push eax
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x294]
push edx
call sub.brom.dll_Ordinal_192
mov edi, eax
cmp edi, 2
jne 0x513da5c
xor eax, eax
movzx edx, ax
mov eax, edx
lea ecx, [edi + 0x7d]
shl edx, 0x10
or eax, edx
push 0x52c722a
lea edi, [esp + 0x290]
rep stosd dword es:[edi], eax
push 1
push 0xc31
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
stosw word es:[edi], ax
mov dword [esp + 0x20], 0
call fcn.051ae270
mov edi, eax
mov byte [esp + 0x888], 0xb
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
movzx ecx, word [esp + 0x10]
push ecx
jmp 0x513da99
lea ecx, [esp + 0x30]
test edi, edi
jne 0x513e03c
push 0x52c722a
push 1
push 0xc35
push str..FunctionPlatformInit.cpp
call fcn.051ae270
mov edi, eax
mov byte [esp + 0x888], 0xc
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
movzx edx, word [esp + 0x10]
push edx
mov eax, dword [eax + 8]
push esi
push ebx
push str.__d___s__:_Current_Port_Number:__d
push eax
push edi
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
mov dword [esp + 0x20], eax
call edi
mov edi, eax
sub edi, dword [esp + 0x20]
cmp dword [ebp + 0x10], edi
jb 0x513dcaa
jmp 0x513dae0
mov eax, dword [esp + 0x54]
cmp dword [eax], 0x2694
je 0x513df12
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x14], 0xff
test eax, eax
jne 0x513db28
lea ecx, [esp + 0x14]
lea edx, [esp + 0x8c]
cmp dword [esp + 0x1c], eax
jne 0x513db1a
push ecx
push edx
call sub.brom.dll_Ordinal_49
jmp 0x513db3b
lea eax, [esp + 0x4c]
push eax
push ecx
push edx
call sub.brom.dll_Ordinal_245
jmp 0x513db3b
push eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x94]
push ecx
call sub.brom.dll_Ordinal_192
mov edi, eax
test edi, edi
je 0x513db71
cmp edi, 2
jne 0x513df8c
lea ecx, [eax + 0x7d]
xor eax, eax
movzx edx, ax
mov eax, edx
shl edx, 0x10
lea edi, [esp + 0x8c]
or eax, edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [esp + 0x14], 0
jmp 0x513dc95
mov eax, dword [esp + 0x10]
cmp word [esp + 0x14], ax
jne 0x513dbe0
movzx eax, ax
add eax, eax
lea edi, [esp + 0x28c]
lea esi, [esp + 0x8c]
cmp eax, 4
jb 0x513dba8
mov ecx, dword [esi]
cmp ecx, dword [edi]
jne 0x513dbdc
sub eax, 4
add edi, 4
add esi, 4
cmp eax, 4
jae 0x513db94
test eax, eax
je 0x513dc91
mov dl, byte [edi]
cmp dl, byte [esi]
jne 0x513dbdc
cmp eax, 1
jbe 0x513dc91
mov cl, byte [edi + 1]
cmp cl, byte [esi + 1]
jne 0x513dbdc
cmp eax, 2
jbe 0x513dc91
mov dl, byte [edi + 2]
cmp dl, byte [esi + 2]
je 0x513dc91
mov esi, dword [esp + 0x28]
cmp dword [esp + 0x2c], 0
jne 0x513dbfc
cmp dword [esp + 0x1c], 0
je 0x513dbfc
mov eax, dword [esp + 0x50]
push eax
call dword [sym.imp.MSVCR90.dll_free]
add esp, 4
push 0x3e8
lea ecx, [esp + 0x490]
push 0
push ecx
call sub.MSVCR90.dll_memset
movzx ecx, word [esp + 0x1c]
add esp, 0xc
xor eax, eax
test ecx, ecx
jbe 0x513dc35
mov edi, edi
movzx edx, word [esp + eax*2 + 0x28c]
inc eax
mov byte [esp + edx + 0x48c], 1
cmp eax, ecx
jb 0x513dc20
mov eax, dword [esp + 0x14]
movzx ecx, ax
xor edi, edi
test ecx, ecx
jbe 0x513dc6b
jmp 0x513dc50
movzx edx, word [esp + edi*2 + 0x8c]
cmp byte [esp + edx + 0x48c], 0
je 0x513dd6c
inc edi
cmp edi, ecx
jb 0x513dc50
mov ecx, 0x7f
lea esi, [esp + 0x8c]
lea edi, [esp + 0x28c]
rep movsd dword es:[edi], dword [esi]
movzx eax, ax
push 2
mov dword [esp + 0x14], eax
movsw word es:[edi], word [esi]
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, eax
sub edi, dword [esp + 0x20]
cmp dword [ebp + 0x10], edi
jae 0x513dae0
push str._ERROR:
push 0xff
push 0xc43
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov esi, eax
mov byte [esp + 0x888], 0xe
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov edx, dword [ebp + 0x10]
mov eax, dword [eax + 8]
push edi
push edx
push ebx
push str.__d__META_GetDynamicUSBComPort_r__:_enumerate_usb_port_timeout__ms_scan_timeout__lu____ms_total_scan_time__lu_
push eax
push esi
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov dword [esp + 0x888], 0xf
mov esi, dword [esp + 0x64]
xor ebx, ebx
cmp esi, ebx
je 0x513dd3e
mov edi, dword [esp + 0x68]
cmp esi, edi
je 0x513dd35
mov ecx, esi
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
add esi, 0x1c
cmp esi, edi
jne 0x513dd22
mov esi, dword [esp + 0x64]
push esi
call sub.mfc90.dll_Ordinal_800
add esp, 4
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], ebx
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x888], 0xffffffff
mov eax, dword [esp + 0x58]
push eax
call sub.mfc90.dll_Ordinal_800
add esp, 4
mov eax, 0xb
jmp 0x513e10e
push 0x52c722a
push 1
push 0xc84
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov dword [esp + 0x1c], eax
mov byte [esp + 0x888], 0x13
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
movzx ecx, word [esp + edi*2 + 0x8c]
mov eax, dword [eax + 8]
mov edx, dword [esp + 0x1c]
lea edi, [esp + edi*2 + 0x8c]
push ecx
push esi
push ebx
push str.__d___s__:_Find_a_new_com_port_:_COM_d__
push eax
push edx
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov ax, word [edi]
mov ecx, dword [esp + 0x24]
mov word [ecx], ax
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, eax
sub edi, dword [esp + 0x20]
cmp dword [ebp + 0x10], edi
jb 0x513de99
jmp 0x513de00
mov edi, dword [esp + 0x54]
cmp dword [edi], 0x2694
je 0x513dfd6
mov eax, dword [esp + 0x24]
movzx ecx, word [eax]
push ecx
call fcn.051b1f50
add esp, 4
test al, al
jne 0x513e021
push 0x52c722a
push 1
push 0xc9f
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov edi, eax
mov byte [esp + 0x888], 0x16
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov eax, dword [eax + 8]
push esi
push str.__d__Retry
push eax
push edi
call fcn.051ae2d0
add esp, 0x10
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
push 0x32
inc esi
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, eax
sub edi, dword [esp + 0x20]
cmp dword [ebp + 0x10], edi
jae 0x513de00
push str._ERROR:
push 0xff
push 0xc93
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov esi, eax
mov byte [esp + 0x888], 0x14
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov edx, dword [ebp + 0x10]
mov eax, dword [eax + 8]
push edi
push edx
push ebx
push str.__d__META_GetDynamicUSBComPort_r__:_enumerate_usb_port_timeout__ms_scan_timeout__lu____ms_total_scan_time__lu_
push eax
push esi
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x58]
call fcn.050097b0
mov eax, 1
jmp 0x513e10e
push str._ERROR:
push 0xff
push 0xc48
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov edi, eax
mov byte [esp + 0x888], 0x11
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov ecx, dword [esp + 0x54]
mov eax, dword [eax + 8]
push ecx
push esi
push ebx
push str.__d___s__:_Stop_enumerate_USB_port__:_p_scanstop_0x_08X_SCAN_STOP.
push eax
push edi
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x58]
call fcn.050097b0
mov eax, 0x33
jmp 0x513e10e
push str._ERROR:
push 0xff
push 0xc69
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov dword [esp + 0x24], eax
mov byte [esp + 0x888], 0x12
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov eax, dword [eax + 8]
mov edx, dword [esp + 0x24]
push edi
push esi
push ebx
push str.__d___s__:_Enumerate_Port_Fail__return:__d_
push eax
push edx
jmp 0x513e07d
push str._ERROR:
push 0xff
push 0xc98
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov esi, eax
mov byte [esp + 0x888], 0x15
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov eax, dword [eax + 8]
push edi
push ebx
push str.__d__META_GetDynamicUSBComPort_r__:_Stop_enumerate_USB_port__:_p_scanstop_0x_08X_SCAN_STOP.
push eax
push esi
call fcn.051ae2d0
add esp, 0x14
jmp 0x513df5d
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x58]
call fcn.050097b0
xor eax, eax
jmp 0x513e10e
push str._ERROR:
push 0xff
push 0xc39
push str..FunctionPlatformInit.cpp
call fcn.051ae270
mov dword [esp + 0x24], eax
mov byte [esp + 0x888], 0xd
push ebx
mov ecx, 0x53f4cc8
call fcn.05065960
mov eax, dword [eax + 8]
push edi
push esi
push ebx
push str.__d___s__:_First_Time:_Enumerate_Port_Fail__return:__d_
push eax
mov eax, dword [esp + 0x38]
push eax
call fcn.051ae2d0
add esp, 0x18
mov byte [esp + 0x888], 5
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x58]
call fcn.050097b0
mov eax, 0x32
jmp 0x513e10e
push str._ERROR:
push 0xff
push 0xbe6
push str..FunctionPlatformInit.cpp
lea ecx, [esp + 0x40]
call fcn.051ae270
mov dword [esp + 0x888], 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x56bc0f0]
push ebx
push edi
push esi
push ecx
push str.__d___s__:_invalid_arguments__com_port_0x_08X__p_scanstop_0x_p.
push edx
push eax
call fcn.051ae2d0
add esp, 0x1c
mov dword [esp + 0x888], 0xffffffff
lea ecx, [esp + 0x30]
call fcn.051ae2c0
mov eax, 0xa
mov ecx, dword [esp + 0x880]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x868]
xor ecx, esp
call fcn.0520b902
mov esp, ebp
pop ebp
ret 0x1c