Function at 0x401642
Capabilities:
Create thread
Terminate process
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
call dbg.CreateSession
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4016b5
call sym._GetLastError_0
mov dword [esp + 8], 0xa
mov dword [esp + 4], 0x40a138
mov dword [esp], eax
call sym._itoa
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], str.Failed_to_execute_file__error___s
call dbg.holler
mov eax, 0
jmp 0x401a4b
mov dword [ebp - 0x1c], 0xc
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp + 8]
mov dword [eax + 0xc], edx
mov eax, dbg.SessionReadShellThreadFn
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 0
mov edx, dword [ebp - 0x10]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call sym._CreateThread_24
sub esp, 0x18
mov edx, dword [ebp - 0x10]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x401781
call sym._GetLastError_0
mov dword [esp + 8], 0xa
mov dword [esp + 4], 0x40a138
mov dword [esp], eax
call sym._itoa
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], str.Failed_to_create_ReadShell_session_thread__error___s
call dbg.holler
mov eax, dword [ebp - 0x10]
mov dword [eax + 0xc], 0xffffffff
mov eax, 0
jmp 0x401a4b
mov eax, dbg.SessionWriteShellThreadFn
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 0
mov edx, dword [ebp - 0x10]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call sym._CreateThread_24
sub esp, 0x18
mov edx, dword [ebp - 0x10]
mov dword [edx + 0x14], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
test eax, eax
jne 0x40184c
call sym._GetLastError_0
mov dword [esp + 8], 0xa
mov dword [esp + 4], 0x40a138
mov dword [esp], eax
call sym._itoa
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], str.Failed_to_create_ReadShell_session_thread__error___s
call dbg.holler
mov eax, dword [ebp - 0x10]
mov dword [eax + 0xc], 0xffffffff
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._TerminateThread_8
sub esp, 8
mov eax, 0
jmp 0x401a4b
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov dword [ebp - 0x24], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 0
lea eax, [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], 3
call sym._WaitForMultipleObjects_16
sub esp, 0x10
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
cmp eax, 1
je 0x4018dc
cmp eax, 2
je 0x401913
test eax, eax
jne 0x401947
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._TerminateThread_8
sub esp, 8
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._TerminateProcess_8
sub esp, 8
jmp 0x40199c
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._TerminateThread_8
sub esp, 8
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._TerminateProcess_8
sub esp, 8
jmp 0x40199c
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._TerminateThread_8
sub esp, 8
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._TerminateThread_8
sub esp, 8
jmp 0x40199c
call sym._GetLastError_0
mov dword [esp + 8], 0xa
mov dword [esp + 4], 0x40a138
mov dword [esp], eax
call sym._itoa
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], str.WaitForMultipleObjects_error:__s
call dbg.holler
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
mov dword [esp + 4], 2
mov dword [esp], eax
call sym._shutdown_8
sub esp, 8
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov dword [esp], eax
call sym._DisconnectNamedPipe_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sym._DisconnectNamedPipe_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x10]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._free
mov eax, 1
leave
ret