Function at 0x4133b0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x5c8eb0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, ecx
mov dword [ebp - 0x40], esi
cmp dword [ebx + 0x818], 0
je 0x41366a
cmp dword [ebx + 0x814], 0
jne 0x41366a
movzx eax, word [ebx + 0x81c]
dec eax
je 0x413565
dec eax
je 0x41340b
dec eax
jne 0x413660
mov dword [ebx + 0x834], 1
jmp 0x413660
push ecx
movzx ecx, word [ebx + 0x81e]
lea edx, [ebp - 0x3c]
call fcn.00415990
mov eax, dword [str.ReadEnd]
lea edx, [ebp - 0x3c]
mov dword [ebp - 0x18], eax
add esp, 4
mov eax, dword [0x5a9844]
mov esi, edx
mov dword [ebp - 0x14], eax
mov al, byte [edx]
inc edx
test al, al
jne 0x413433
push edi
lea edi, [ebp - 0x18]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x413441
mov ecx, edx
lea eax, [ebp - 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push eax
push 0
mov ecx, edx
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov ecx, dword [ebp - 0x40]
lea edx, [ebp - 0x3c]
mov esi, edx
mov dword [ecx + 8], eax
mov eax, dword [str.Write]
mov dword [ebp - 0x18], eax
mov ax, word [0x5a9894]
mov word [ebp - 0x14], ax
mov al, byte [edx]
inc edx
test al, al
jne 0x413484
lea edi, [ebp - 0x18]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x413491
mov ecx, edx
lea eax, [ebp - 0x18]
shr ecx, 2
xorps xmm0, xmm0
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x40]
push 1
push 1
push 0
movdqu xmmword [esi + 0x10], xmm0
mov dword [esi + 0x20], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esi + 0x20], eax
lea edx, [ebp - 0x3c]
mov eax, dword [str.Read]
mov esi, edx
mov dword [ebp - 0x18], eax
mov al, byte [0x5a989c]
mov byte [ebp - 0x14], al
mov al, byte [edx]
inc edx
test al, al
jne 0x4134e1
lea edi, [ebp - 0x18]
sub edx, esi
dec edi
mov edi, edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4134f0
mov ecx, edx
lea eax, [ebp - 0x18]
shr ecx, 2
xorps xmm0, xmm0
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x40]
push 0
push 1
push 0
movdqu xmmword [esi + 0x24], xmm0
mov dword [esi + 0x34], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
push ebx
push 0
push 0x4132c0
mov dword [esi + 0x34], eax
call fcn.0054c187
add esp, 0xc
pop edi
cmp eax, 0xffffffff
jne 0x413660
push 0x2030
push str.Tera_Term:_Error
push str.Cant_create_thread
push dword [ebx + 0x810]
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x413660
mov ecx, dword [ebp + 0xc]
shr ecx, 0x10
mov eax, ecx
sub eax, 0x2743
je 0x4135d3
sub eax, 9
je 0x4135b4
dec eax
je 0x413593
movdqu xmm0, xmmword [str.Cannot_connect_the_host]
movdqu xmmword [ebp - 0x38], xmm0
movq xmm0, qword [0x5a980c]
jmp 0x4135f2
mov ax, word [0x5a9858]
movdqu xmm0, xmmword [str.Connection_refused]
mov word [ebp - 0x28], ax
mov al, byte [0x5a985a]
movdqu xmmword [ebp - 0x38], xmm0
mov byte [ebp - 0x26], al
jmp 0x4135f7
mov eax, dword [0x5a9888]
movdqu xmm0, xmmword [str.Connection_timed_out]
mov dword [ebp - 0x28], eax
mov al, byte [0x5a988c]
movdqu xmmword [ebp - 0x38], xmm0
mov byte [ebp - 0x24], al
jmp 0x4135f7
movdqu xmm0, xmmword [str.Network_cannot_be_reached]
mov ax, word [0x5a9874]
mov word [ebp - 0x20], ax
movdqu xmmword [ebp - 0x38], xmm0
movq xmm0, qword [0x5a986c]
movq qword [ebp - 0x28], xmm0
test cx, cx
je 0x413644
cmp word [ebx + 0x8c8], 0
jne 0x413620
push 0x2030
push str.Tera_Term:_Error
lea eax, [ebp - 0x38]
push eax
push dword [ebx + 0x810]
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0x20
push 0
push 0x44
push dword [ebx + 0x810]
call dword [sym.imp.USER32.dll_PostMessageA]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054a5f8
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi + 0x74]
push 0x25
push 0x44
push dword [ebx + 0x810]
push dword [ebx + 0x824]
call eax
mov dword [esi + 4], 0
mov dword [ebx + 0x814], 1
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.0054a5f8
mov esp, ebp
pop ebp
ret 8