Function at 0x405030
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42bf95
mov eax, dword fs:[0]
push eax
sub esp, 0x48
mov eax, dword [0x43a680]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, ecx
mov dword [ebp - 0x3c], esi
cmp dword [ebp + 0xc], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x30], eax
je 0x405308
cmp dword [esi + 0x4c], 0
je 0x40508a
push dword [esi + 0x64]
call dword [sym.imp.KERNEL32.dll_SetEvent]
lea ecx, [esi + 0x48]
call fcn.00404c70
push dword [esi + 0x64]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov edi, dword [ebp - 0x30]
mov eax, 0x7fffffff
mov ecx, dword [edi + 0x10]
sub eax, ecx
mov dword [ebp - 0x30], ecx
cmp eax, 9
jb 0x405323
cmp dword [edi + 0x14], 0xf
jbe 0x4050b4
mov edi, dword [edi]
lea eax, [ecx + 9]
mov edx, 0xf
mov dword [ebp - 0x38], eax
xorps xmm0, xmm0
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x44], ecx
movups xmmword [ebp - 0x2c], xmm0
cmp eax, edx
jbe 0x40510b
or eax, edx
cmp eax, 0x7fffffff
jbe 0x4050e0
mov eax, 0x7fffffff
jmp 0x4050ea
mov ecx, 0x16
cmp eax, ecx
cmovb eax, ecx
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.004019f0
mov edx, dword [ebp - 0x40]
mov ecx, eax
mov eax, dword [ebp - 0x38]
add esp, 8
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x2c], ecx
movq xmm0, qword [str..pipe_]
push dword [ebp - 0x30]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edx
movq qword [ecx], xmm0
mov al, byte [0x42d4f8]
mov byte [ecx + 8], al
lea eax, [ecx + 9]
push edi
push eax
call fcn.004129d0
mov eax, dword [ebp - 0x44]
lea edi, [esi + 0x30]
mov ecx, dword [ebp - 0x30]
add esp, 0xc
mov byte [eax + ecx + 9], 0
lea eax, [ebp - 0x2c]
cmp edi, eax
je 0x40516d
mov ecx, edi
call fcn.004023d0
movups xmm0, xmmword [ebp - 0x2c]
mov ecx, 0xf
mov byte [ebp - 0x2c], 0
movups xmmword [edi], xmm0
movq xmm0, qword [ebp - 0x1c]
movq qword [edi + 0x10], xmm0
jmp 0x405170
mov ecx, dword [ebp - 0x18]
cmp ecx, 0xf
jbe 0x4051a1
mov edx, dword [ebp - 0x2c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x405197
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x405328
push ecx
push edx
call fcn.004118c3
add esp, 8
mov eax, dword [ebp + 0x10]
mov dword [esi + 0x60], eax
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x5c], eax
mov dword [ebp - 0x30], 0
cmp dword [esi + 0x44], 0xf
lea eax, [esi + 0x30]
jbe 0x4051c0
mov eax, dword [esi + 0x30]
push 0
push 0
push 3
push 0
push 0
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x38], edi
cmp edi, 0xffffffff
jne 0x405215
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
jne 0x405215
cmp dword [esi + 0x44], 0xf
lea eax, [esi + 0x30]
jbe 0x4051f9
mov eax, dword [esi + 0x30]
push 0x3e8
push eax
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeA]
test eax, eax
je 0x405215
mov ecx, dword [ebp - 0x30]
inc ecx
mov dword [ebp - 0x30], ecx
cmp ecx, 2
jl 0x4051b4
mov dword [ebp - 0x48], edi
mov byte [ebp - 0x44], 0
mov dword [ebp - 4], 0
cmp edi, 0xffffffff
je 0x4052ca
push 0xc
mov byte [ebp - 4], 1
call fcn.00411893
mov esi, dword [ebp - 0x3c]
add esp, 4
test eax, eax
je 0x40524f
mov dword [eax], edi
mov dword [eax + 4], esi
mov dword [eax + 8], 0x404050
jmp 0x405251
xor eax, eax
mov dword [ebp - 0x3c], eax
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 2
push ecx
push 0
push eax
push 0x403580
push 0
push 0
call fcn.004174e5
mov ecx, eax
add esp, 0x18
mov dword [ebp - 0x34], ecx
test ecx, ecx
je 0x405332
cmp dword [esi + 0x4c], 0
jne 0x40532d
mov eax, dword [ebp - 0x30]
mov dword [esi + 0x4c], eax
mov al, 1
mov dword [esi + 0x48], ecx
jmp 0x4052ea
push str.Failed_to_connect_to_pipe
push 0x42d414
push 0xa7
push str.C:BuildAgent_work1_s_agent_rcapi_sourcekvm_sourcewin32ipc_client.cpp
push 1
call fcn.00403780
add esp, 0x14
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004118d1
mov esp, ebp
pop ebp
ret 0xc
push str.Exception:_Invalid_argument._Connection_id_invalid
lea ecx, [ebp - 0x54]
call fcn.00403ca0
push 0x4375e4
lea eax, [ebp - 0x54]
push eax
call fcn.0041312c
call fcn.00402af0
call fcn.0041672f
call fcn.0041734d
push 6
mov dword [ebp - 0x30], 0
call fcn.00410a11
int3