Function at 0x41d7f0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x42c
mov eax, dword [0x47c554]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [ebp + 8], 1
push ebx
push esi
push edi
jne 0x41db7a
cmp byte [0x4c0c60], 1
jne 0x41de2a
push 0x41e5a0
push 0x14
push dword [0x4c0c64]
push 0x4c0c70
call fcn.0044a570
push 0x1fc
push 0
push 0x5099d8
call fcn.0043d400
push 0x1fc
push 0
push 0x509bd8
call fcn.0043d400
mov eax, dword [0x4c0c64]
add esp, 0x28
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
shl eax, 4
push eax
push 8
push dword [0x47ceb8]
call ebx
cmp dword [0x4c0c64], 0
mov dword [0x5095c4], eax
mov dword [ebp - 0x424], 0
jle 0x41da40
xor esi, esi
mov edi, 0x4c0c70
nop word [eax + eax]
push dword [edi + 0xc]
lea eax, [ebp - 0x408]
push dword [edi + 8]
push str.Can_DeviceList_V_08X_D_08X
push 0x401
push eax
call fcn.004038d0
push 0
push str.IsGateWay
lea eax, [ebp - 0x408]
push eax
push dword [0x4b07c0]
call fcn.004037a0
mov ebx, eax
add esp, 0x24
test ebx, ebx
je 0x41da02
push str.true
push ebx
call fcn.00443047
test eax, eax
mov eax, dword [0x5095c4]
push ebx
sete cl
mov byte [esi + eax + 8], cl
call fcn.0044af5d
push 0
push str.LgIn
lea eax, [ebp - 0x408]
push eax
push dword [0x4b07c0]
call fcn.004037a0
mov ebx, eax
add esp, 0x1c
test ebx, ebx
je 0x41d930
push ebx
call fcn.0044b487
add esp, 4
mov ecx, eax
jmp 0x41d932
xor ecx, ecx
mov eax, dword [0x5095c4]
push ebx
mov dword [esi + eax], ecx
call fcn.0044af5d
push 0
push str.LgOut
lea eax, [ebp - 0x408]
push eax
push dword [0x4b07c0]
call fcn.004037a0
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x41d96f
push ebx
call fcn.0044b487
add esp, 4
mov ecx, eax
jmp 0x41d971
xor ecx, ecx
mov eax, dword [0x5095c4]
push ebx
mov dword [esi + eax + 4], ecx
call fcn.0044af5d
push 0
push str.ObjectId
lea eax, [ebp - 0x408]
push eax
push dword [0x4b07c0]
call fcn.004037a0
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x41d9af
push ebx
call fcn.0044b487
add esp, 4
mov ecx, eax
jmp 0x41d9b1
xor ecx, ecx
mov eax, dword [0x5095c4]
push ebx
mov dword [esi + eax + 0xc], ecx
call fcn.0044af5d
mov ebx, dword [0x5095c4]
add esp, 4
mov eax, dword [ebx + esi]
test eax, eax
je 0x41d9e4
mov ecx, dword [edi]
dec eax
cdq
and edx, 7
add eax, edx
sar eax, 3
inc eax
add dword [ecx*4 + 0x5099d8], eax
mov eax, dword [ebx + esi + 4]
test eax, eax
je 0x41da1b
mov ecx, dword [edi]
dec eax
cdq
and edx, 7
add eax, edx
sar eax, 3
inc eax
add dword [ecx*4 + 0x509bd8], eax
jmp 0x41da1b
mov eax, dword [0x5095c4]
mov byte [esi + eax + 8], 0
mov dword [esi + eax], 0
mov dword [esi + eax + 4], 0
mov eax, dword [ebp - 0x424]
add edi, 0x14
inc eax
add esi, 0x10
mov dword [ebp - 0x424], eax
cmp eax, dword [0x4c0c64]
jl 0x41d8a0
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
xor esi, esi
mov eax, dword [esi + 0x5099d8]
test eax, eax
je 0x41da72
dec eax
mov eax, eax
test eax, eax
jns 0x41da56
add eax, 1
sar eax, 1
lea eax, [eax*2 + 2]
push eax
push 8
push dword [0x47ceb8]
mov dword [esi + 0x5099d8], eax
call ebx
jmp 0x41da74
xor eax, eax
mov dword [esi + 0x5095d8], eax
mov eax, dword [esi + 0x509bd8]
test eax, eax
je 0x41daaa
dec eax
mov eax, eax
test eax, eax
jns 0x41da8e
add eax, 1
sar eax, 1
lea eax, [eax*2 + 2]
push eax
push 8
push dword [0x47ceb8]
mov dword [esi + 0x509bd8], eax
call ebx
jmp 0x41daac
xor eax, eax
mov dword [esi + 0x5097d8], eax
add esi, 4
cmp esi, 0x1fc
jl 0x41da42
push 0xe000
push 0
push 0x509de0
mov dword [0x5095c0], 0
mov byte [0x5095d0], 0xff
call fcn.0043d400
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
add esp, 0xc
mov esi, 0x509e10
nop dword [eax]
push 0
push 0
push 1
push 0
call edi
mov dword [esi - 4], eax
call fcn.0043b350
mov dword [esi], eax
add esi, 0x38
cmp esi, 0x517e10
jl 0x41daf0
mov esi, 0x509dd4
push 0
push 0
push 1
push 0
call edi
mov dword [esi], eax
add esi, 4
cmp esi, 0x509de0
jl 0x41db14
mov esi, dword [sym.imp.KERNEL32.dll_CreateThread]
lea eax, [ebp - 0x42c]
push eax
push 0
push 0
push 0x41e5c0
push 0
push 0
call esi
mov dword [0x5095c8], eax
lea eax, [ebp - 0x42c]
push eax
push 0
push 0
push 0x41f3f0
push 0
push 0
call esi
pop edi
pop esi
mov dword [0x5095cc], eax
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043b572
mov esp, ebp
pop ebp
ret
cmp byte [0x4c0c60], 1
jne 0x41de2a
xor esi, esi
nop dword [eax]
mov eax, dword [esi + 0x509bd8]
test eax, eax
je 0x41dbab
push eax
push 0
push dword [esi + 0x5097d8]
call fcn.0043d400
add esp, 0xc
add esi, 4
cmp esi, 0x1fc
jl 0x41db90
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x7d0
call edi
mov ecx, dword [0x4c0c64]
xor esi, esi
test ecx, ecx
jle 0x41dc2f
xor ebx, ebx
mov edi, 0x4c0c70
nop word [eax + eax]
mov eax, dword [0x5095c4]
cmp byte [ebx + eax + 8], 1
jne 0x41dc1e
push dword [edi]
lea eax, [ebp - 0x41c]
push 2
push 2
push 0
push eax
call fcn.0041e4b0
push 0x1f4
push 0
lea eax, [ebp - 0x41c]
push 0
push eax
call fcn.00420120
mov ecx, dword [0x4c0c64]
add esp, 0x24
inc esi
add ebx, 0x10
add edi, 0x14
cmp esi, ecx
jl 0x41dbe0
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x7d0
call edi
mov eax, dword [0x4c18d9]
and byte [eax + 0x183], 0xfe
push dword [0x509dd4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov esi, dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
lea eax, [ebp - 0x420]
push eax
push dword [0x5095c8]
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_SwitchToThread]
cmp eax, 1
jne 0x41dc92
nop
cmp dword [ebp - 0x420], 0x103
jne 0x41dc92
call ebx
lea eax, [ebp - 0x420]
push eax
push dword [0x5095c8]
call esi
cmp eax, 1
je 0x41dc70
lea eax, [ebp - 0x420]
push eax
push dword [0x5095cc]
call esi
cmp eax, 1
jne 0x41dcd2
nop word [eax + eax]
cmp dword [ebp - 0x420], 0x103
jne 0x41dcd2
call ebx
lea eax, [ebp - 0x420]
push eax
push dword [0x5095cc]
call esi
cmp eax, 1
je 0x41dcb0
push dword [0x5095cc]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push dword [0x5095c8]
call ebx
mov esi, 0x509dd4
nop dword [eax]
push dword [esi]
call ebx
add esi, 4
cmp esi, 0x509de0
jl 0x41dcf0
push str.Stopping_IBS_CanGW02_Driver
call fcn.0040e750
movzx eax, byte [0x5095d1]
add esp, 4
push 0
push 0
push eax
call sub.USBCAN32.dll_UcanResetCanEx
movzx eax, al
push eax
call fcn.0041fae0
add esp, 4
push 0x3e8
call edi
cmp dword [0x5095c0], 2
jne 0x41dd6d
movzx eax, byte [0x5095d1]
push eax
call sub.USBCAN32.dll_UcanDeinitCan
movzx eax, al
push eax
call fcn.0041fae0
add esp, 4
cmp dword [0x5095c0], 2
jne 0x41dd6d
nop dword [eax + eax]
push 0xa
call edi
cmp dword [0x5095c0], 2
je 0x41dd60
push 0x3e8
call edi
cmp dword [0x5095c0], 0
jle 0x41ddad
movzx eax, byte [0x5095d1]
push eax
call sub.USBCAN32.dll_UcanDeinitHardware
movzx eax, al
push eax
call fcn.0041fae0
add esp, 4
cmp dword [0x5095c0], 0
je 0x41ddad
nop
push 0xa
call edi
cmp dword [0x5095c0], 0
jne 0x41dda0
push 0x3e8
call edi
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
xor esi, esi
nop dword [eax]
mov eax, dword [esi + 0x5095d8]
test eax, eax
je 0x41ddd5
push eax
push 0
push dword [0x47ceb8]
call edi
mov eax, dword [esi + 0x5097d8]
test eax, eax
je 0x41ddea
push eax
push 0
push dword [0x47ceb8]
call edi
add esi, 4
cmp esi, 0x1fc
jl 0x41ddc0
push dword [0x5095c4]
push 0
push dword [0x47ceb8]
call edi
mov esi, 0x509e10
nop word [eax + eax]
push dword [esi - 4]
call ebx
push dword [esi]
call fcn.0043b340
add esi, 0x38
add esp, 4
cmp esi, 0x517e10
jl 0x41de10
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043b572
mov esp, ebp
pop ebp
ret