Function at 0x406230
Capabilities:
Check if file exists
Create thread
Get common file path
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x810
mov eax, dword [0x420008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
push esi
push dword [ebp + 8]
mov edi, ecx
push str.SessionChanged___Session:_d__event:_d_r_n
call fcn.00404ad0
add esp, 0xc
cmp esi, 6
jne 0x40641b
cmp dword [edi + 0xc4], 0
lea ebx, [edi + 0xac]
mov dword [ebp - 0x80c], ebx
je 0x406281
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [edi + 0xa4]
lea eax, [ebp + 8]
add edi, 0xa4
push eax
lea eax, [ebp - 0x808]
mov dword [ebp - 0x810], edi
push eax
mov ecx, edi
call fcn.00407010
cmp dword [eax], esi
je 0x4063f7
mov edx, dword [edi]
mov esi, edx
mov eax, dword [esi + 4]
cmp byte [eax + 0xd], 0
jne 0x4062dd
mov ecx, dword [ebp + 8]
nop dword [eax]
cmp dword [eax + 0x10], ecx
jae 0x4062ca
mov eax, dword [eax + 8]
jmp 0x4062ce
mov esi, eax
mov eax, dword [eax]
cmp byte [eax + 0xd], 0
je 0x4062c0
cmp esi, edx
je 0x4062dd
cmp ecx, dword [esi + 0x10]
jae 0x406310
lea eax, [ebp + 8]
push ecx
mov dword [ebp - 0x808], eax
lea eax, [ebp - 0x808]
push eax
push ecx
mov ecx, edi
call fcn.00407850
push eax
add eax, 0x10
mov ecx, edi
push eax
push esi
lea eax, [ebp - 0x808]
push eax
call fcn.00407880
mov esi, dword [ebp - 0x808]
mov esi, dword [esi + 0x14]
mov ecx, esi
call fcn.00403a80
test esi, esi
je 0x406333
mov ecx, esi
call fcn.00402a50
push 0xd8
push esi
call fcn.00416baa
add esp, 8
mov ebx, dword [edi]
mov esi, ebx
mov edi, dword [ebp + 8]
mov ecx, dword [ebx + 4]
mov eax, ecx
cmp byte [eax + 0xd], 0
jne 0x406362
cmp dword [eax + 0x10], edi
jae 0x40634f
mov eax, dword [eax + 8]
jmp 0x40635c
jbe 0x406358
cmp byte [esi + 0xd], 0
cmovne esi, eax
mov ebx, eax
mov eax, dword [eax]
cmp byte [eax + 0xd], 0
je 0x406345
cmp byte [esi + 0xd], 0
jne 0x40636a
mov ecx, dword [esi]
cmp byte [ecx + 0xd], 0
jne 0x406384
cmp edi, dword [ecx + 0x10]
jae 0x40637b
mov esi, ecx
mov ecx, dword [ecx]
jmp 0x40637e
mov ecx, dword [ecx + 8]
cmp byte [ecx + 0xd], 0
je 0x406370
mov eax, ebx
cmp ebx, esi
je 0x4063dd
nop word [eax + eax]
cmp byte [eax + 0xd], 0
jne 0x4063d9
mov ecx, dword [eax + 8]
cmp byte [ecx + 0xd], 0
jne 0x4063be
mov eax, ecx
mov edx, dword [eax]
cmp byte [edx + 0xd], 0
jne 0x4063d9
nop dword [eax]
mov ecx, dword [edx]
mov eax, edx
mov edx, ecx
cmp byte [ecx + 0xd], 0
je 0x4063b0
jmp 0x4063d9
mov ecx, dword [eax + 4]
cmp byte [ecx + 0xd], 0
jne 0x4063d7
cmp eax, dword [ecx + 8]
jne 0x4063d7
mov eax, ecx
mov ecx, dword [ecx + 4]
cmp byte [ecx + 0xd], 0
je 0x4063c7
mov eax, ecx
cmp eax, esi
jne 0x406390
mov ecx, dword [ebp - 0x810]
lea eax, [ebp - 0x808]
push esi
push ebx
push eax
call fcn.00407070
mov ebx, dword [ebp - 0x80c]
cmp dword [ebx + 0x18], 0
je 0x406537
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004168de
mov esp, ebp
pop ebp
ret 8
cmp esi, 5
je 0x406429
cmp esi, 8
jne 0x406537
mov esi, dword [edi + 0x20]
mov eax, dword [esi + 8]
mov dword [esi + 0x10], 0
test eax, eax
je 0x406476
push 0x3e8
push eax
mov dword [esi + 0x10], 1
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40645f
push 0
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0
mov dword [esi + 0x10], 0
mov ebx, dword [esi + 4]
mov ecx, dword [ebx + 8]
test ecx, ecx
je 0x4064b7
lea eax, [ecx + 8]
mov dword [ebp - 0x80c], eax
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x4064a6
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x80c]
mov dword [eax], 0xffffffff
mov ecx, dword [ebx + 8]
test ecx, ecx
je 0x4064b7
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [ebx + 8], 0
push 0
push 0
push esi
push 0x40db20
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 8], eax
test eax, eax
jne 0x4064ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_create_tcp_listener_thread:_d_n
call fcn.004027f0
mov ecx, dword [esi + 4]
add esp, 8
call fcn.0040e1a0
lea eax, [ebp - 0x804]
push eax
push 0
push 0
push 0x23
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
js 0x406537
push str.ASUSGiftBox3_reboot.tmp
lea eax, [ebp - 0x804]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x804]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x406537
mov eax, dword [edi]
mov ecx, edi
push 0
push 0
push 5
call dword [eax + 8]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004168de
mov esp, ebp
pop ebp
ret 8