Function at 0x4041b0
Capabilities:
Create thread
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
mov eax, dword [0x437008]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [0x43d404], 0
push ebx
push esi
push edi
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x3c], 0
je 0x4041df
cmp byte [0x437a50], 0
jne 0x404241
cmp byte [0x437a51], 0
je 0x404241
push 0
push 0
push 0x4022d0
call fcn.0040bd31
add esp, 0xc
mov dword [0x4392c8], eax
push eax
push str.Creating_thread:_StartFootPedalEventReciever_ThreadHandle:__p
push 0x4390c8
call fcn.00401180
add esp, 0xc
mov ecx, 0x4390c8
call fcn.00403950
mov byte [0x43d404], 1
cmp byte [0x437a50], 0
jne 0x404241
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x1f4
call esi
cmp byte [0x437a50], 0
je 0x404231
mov esi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop word [eax + eax]
cmp byte [0x438d80], 0
je 0x40443e
push 0x438d84
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x43d51c], 0
push 0x438d84
sete bl
call esi
test bl, bl
jne 0x40443e
or edi, 0xffffffff
cmp byte [0x438d80], bl
je 0x40443e
push 0x438d84
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x43d51c]
test esi, esi
je 0x4042e7
mov ebx, dword [0x43d518]
mov edx, ebx
mov eax, dword [0x43d514]
mov ecx, ebx
dec eax
shr edx, 2
and edx, eax
and ecx, 3
mov eax, dword [0x43d510]
sub esi, 1
mov eax, dword [eax + edx*4]
mov edi, dword [eax + ecx*4]
mov dword [0x43d51c], esi
jne 0x4042df
mov dword [0x43d518], 0
jmp 0x4042e7
lea eax, [ebx + 1]
mov dword [0x43d518], eax
mov esi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x438d84
call esi
test edi, edi
js 0x404250
mov ebx, dword [ebp - 0x38]
cmp dword [ebx + 0x4004], 1
jne 0x404250
mov edx, edi
lea ecx, [ebp - 0x1c]
call fcn.00402190
mov edx, eax
cmp dword [edx + 0x14], 0x10
jb 0x404320
mov edx, dword [edx]
mov ecx, edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404325
sub ecx, esi
mov dword [ebp - 0x58], edx
mov dword [ebp - 0x50], ecx
lea eax, [ebx + 4]
lea ecx, [ebp - 0x3c]
mov dword [ebp - 0x4c], 0
push ecx
mov edx, eax
mov dword [ebp - 0x48], 1
lea ecx, [ebp - 0x60]
mov dword [ebp - 0x38], eax
call fcn.00405080
mov edx, dword [ebp - 8]
add esp, 4
cmp edx, 0x10
jb 0x40438d
mov ecx, dword [ebp - 0x1c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x404383
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x404465
push edx
push ecx
call fcn.00405b90
add esp, 8
mov esi, dword [ebx]
mov ebx, dword [ebp - 0x3c]
push 0
push ebx
push dword [ebp - 0x38]
push esi
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x4043b2
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, str.send_failed
jmp 0x4043c6
cmp eax, ebx
je 0x404452
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, str.written_not_all_bytes
push eax
call fcn.0040ff1a
add esp, 4
push str.send
call fcn.0040ff1a
add esp, 4
lea ecx, [ebp - 0x34]
mov edx, edi
call fcn.00402190
cmp dword [eax + 0x14], 0x10
jb 0x4043ee
mov eax, dword [eax]
push dword [ebp - 0x38]
push eax
push str.EventSender:_Send_Error_Event:__s_Buffer:_s
push 0x4390c8
call fcn.00401180
mov edx, dword [ebp - 0x20]
add esp, 0x10
cmp edx, 0x10
jb 0x404434
mov ecx, dword [ebp - 0x34]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40442a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40446a
push edx
push ecx
call fcn.00405b90
add esp, 8
mov ecx, 0x4390c8
call fcn.00403950
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004058fc
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004058fc
mov esp, ebp
pop ebp
ret
call fcn.0040f9c0
call fcn.0040f9c0
int3