Function at 0x415980
Capabilities:
Check if file exists
Create thread

Disassembly:
push 0xffffffffffffffff
push 0x4186f8
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4294ec]
xor eax, esp
push eax
lea eax, [esp + 0x18]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [esp + 0x28]
push eax
push str.CSerialComm::OpenDeviceID
xor ebx, ebx
push str._s__s_
mov dword [esp + 0x2c], ebx
call fcn.00416aa0
add esp, 0xc
cmp dword [esi + 0x34], ebx
je 0x4159ea
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esp + 0x20], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x415c23
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventW]
xor eax, eax
push ebx
mov dword [esi + 0x38], eax
push ebx
mov dword [esi + 0x3c], eax
mov dword [esi + 0x40], eax
push 1
mov dword [esi + 0x44], eax
push ebx
mov dword [esi + 0x48], eax
call edi
mov dword [esi + 0x48], eax
cmp eax, ebx
jne 0x415a41
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esp + 0x20], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x415a37
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 6
jmp 0x415c31
xor eax, eax
push ebx
mov dword [esi + 0x4c], eax
push ebx
mov dword [esi + 0x50], eax
mov dword [esi + 0x54], eax
push 1
mov dword [esi + 0x58], eax
push ebx
mov dword [esi + 0x5c], eax
call edi
mov dword [esi + 0x5c], eax
cmp eax, ebx
jne 0x415a8b
mov ecx, dword [esi + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esi + 0x48], ebx
mov dword [esp + 0x20], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x415a2b
mov ebp, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [esp + 0x28]
mov edi, 1
lea ebx, [ebx]
push edi
push str.Open_Try_d
call fcn.00416aa0
mov ecx, dword [esp + 0x30]
add esp, 8
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push ecx
call ebp
mov dword [esi + 0x30], eax
cmp eax, 0xffffffff
jne 0x415b05
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push str.OpenError_d
call fcn.00416aa0
add esp, 8
cmp ebx, 2
je 0x415b13
cmp ebx, 0x4e8
je 0x415b13
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
inc edi
cmp edi, 0xa
jle 0x415aa0
jmp 0x415b13
push edi
push str.Open_Success___Try_count___d
call fcn.00416aa0
add esp, 8
or ebp, 0xffffffff
cmp dword [esi + 0x30], ebp
jne 0x415b75
cmp ebx, 0x20
jne 0x415b2d
push str.ERROR_SHARING_VIOLATION
call fcn.00416aa0
add esp, 4
mov edx, dword [esi + 0x48]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [esi + 0x5c]
push eax
mov dword [esi + 0x48], 0
call edi
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esi + 0x5c], 0
mov dword [esp + 0x20], ebp
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x415b6e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
jmp 0x415c31
mov ecx, esi
call fcn.00415160
test eax, eax
jne 0x415bcb
mov ecx, dword [esi + 0x30]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call edi
mov edx, dword [esi + 0x48]
xor ebx, ebx
push edx
mov dword [esi + 0x30], ebx
call edi
mov eax, dword [esi + 0x5c]
push eax
mov dword [esi + 0x48], ebx
call edi
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esi + 0x5c], ebx
mov dword [esp + 0x20], ebp
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x415bc4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0x10e0
jmp 0x415c31
lea ecx, [esi + 0x8c]
call fcn.004017b0
mov ecx, dword [esi + 0x84]
mov eax, 1
push ecx
mov dword [esi + 0x34], eax
mov dword [esi + 0x120], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
lea edx, [esp + 0x14]
push edx
push 0
push esi
push 0x415280
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 0x88], eax
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
mov dword [esp + 0x20], ebp
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x415c2f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 4