Function at 0x417790
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x308
mov eax, dword [0x456d10]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [0x457dd0]
push ebx
mov ebx, dword [0x45aa7c]
push esi
push edi
push dword [0x45a95c]
mov dword [ebp - 0x2f8], eax
mov edi, ecx
push dword [0x45a940]
xor eax, eax
mov dword [ebp - 0x2dc], edi
push str.Entering_ReadScreen_width_d_height_d_n
push 1
mov dword [ebp - 0x2ec], ebx
mov dword [ebp - 0x300], 1
mov dword [ebp - 0x308], 1
mov dword [ebp - 0x2d8], 0x64
mov dword [ebp - 0x2e0], eax
mov dword [ebp - 0x2f0], eax
mov dword [ebp - 0x304], 0x50
mov dword [ebp - 0x2fc], 0x19
call fcn.0041a380
add esp, 0x10
cmp dword [0x45ad44], 0
je 0x41786c
push 0x104
lea eax, [ebp - 0x17c]
push eax
push dword [0x457dcc]
call fcn.0041cf50
lea ecx, [ebp - 0x17c]
add esp, 0xc
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x417850
push 0
sub ecx, edx
lea eax, [ebp - 0x17c]
push ecx
push eax
push ebx
call fcn.004045f0
add esp, 0x10
lea eax, [ebp - 0x2ac]
push eax
push dword [ebp - 0x2e0]
lea eax, [ebp - 0x2d4]
push 1
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadConsoleOutputAttribute]
push dword [ebp - 0x2d4]
call fcn.0041c680
add esp, 4
mov esi, eax
push dword [ebp - 0x2d4]
call fcn.0041c6b0
add esp, 4
push 0x47b748
push dword [0x45ac1c]
push 0xffffffffffffffff
push eax
push esi
lea eax, [ebp - 0x2d8]
push eax
lea eax, [ebp - 0x74]
push eax
push dword [0x457dcc]
call fcn.0041d250
push 0x64
push eax
push dword [0x457dcc]
call fcn.0041cee0
mov esi, dword [ebp - 0x2e8]
add esp, 0x2c
cmp dword [0x457eb0], 0
mov ebx, dword [0x457e48]
je 0x417e00
push str.Send_first_screen._n
push 2
call fcn.0041a380
mov ecx, dword [0x45a95c]
add esp, 8
mov edx, dword [0x45a940]
mov eax, ecx
imul eax, edx
cmp dword [ebp - 0x2f8], 0
mov dword [0x457eb0], 0
mov dword [ebp - 0x2e0], edx
mov dword [ebp - 0x2f4], ecx
mov dword [ebp - 0x2e4], eax
jne 0x417962
cmp ecx, 0x19
jge 0x417956
mov dword [0x45a95c], 0x19
mov dword [0x47baac], 1
jmp 0x417990
mov dword [0x47baac], 0
jmp 0x417990
lea ecx, [ebp - 0x74]
mov dword [0x47baac], 0
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x417972
push 0
sub ecx, edx
lea eax, [ebp - 0x74]
push ecx
push eax
push dword [ebp - 0x2ec]
call fcn.004045f0
add esp, 0x10
lea eax, [ebp - 0x2c8]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
je 0x417a59
movsx eax, word [ebp - 0x2c8]
push eax
movsx eax, word [ebp - 0x2c6]
push eax
push str.screen_buffer_info_height__d_width_d_n
push 8
call fcn.0041a380
movsx eax, word [ebp - 0x2ba]
push eax
movsx eax, word [ebp - 0x2b8]
push eax
movsx eax, word [ebp - 0x2be]
push eax
movsx eax, word [ebp - 0x2bc]
push eax
push str.screen_rect_T_d_L_d_B_d_R_d_n
push 8
call fcn.0041a380
movsx eax, word [ebp - 0x2b6]
push eax
movsx eax, word [ebp - 0x2b4]
push eax
push str.screen_max_window_size_height_d_width_d_n
push 8
call fcn.0041a380
movsx eax, word [ebp - 0x2c2]
push eax
movsx eax, word [ebp - 0x2c4]
push eax
push str.screen_cursor_x_d_y___d_n
push 8
call fcn.0041a380
movzx eax, word [ebp - 0x2c0]
add esp, 0x48
push eax
push str.screen_attributes__0x_04x_n
push 8
call fcn.0041a380
mov ax, word [ebp - 0x2b6]
mov si, word [ebp - 0x2b4]
mov edx, dword [0x45a95c]
mov ecx, dword [0x45a940]
jmp 0x417a7e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetConsoleScreenBufferInfo_failed_rc__0x_08x_n
push 8
call fcn.0041a380
mov ecx, dword [0x45a940]
mov ax, cx
mov edx, dword [0x45a95c]
mov si, dx
cwde
add esp, 0xc
cmp eax, ecx
mov edi, ecx
cmovl edi, eax
movsx eax, si
cmp eax, edx
mov dword [ebp - 0x304], edi
mov esi, edx
cmovl esi, eax
cmp dword [ebp - 0x2f8], 0
mov dword [ebp - 0x2fc], esi
je 0x417ad2
movsx eax, word [ebp - 0x2c8]
cmp ecx, eax
jne 0x417ac8
movsx eax, word [ebp - 0x2c6]
mov dword [ebp - 0x300], 0
cmp edx, eax
je 0x417ad2
mov dword [ebp - 0x300], 1
mov ecx, dword [ebp - 0x2f4]
xor eax, eax
mov dword [0x47baa8], eax
xor edx, edx
mov dword [0x46b210], eax
mov dword [ebp - 0x2a8], eax
lea eax, [edi - 1]
mov word [ebp - 0x2a4], ax
lea eax, [esi - 1]
mov word [ebp - 0x2a2], ax
mov eax, dword [ebp - 0x2e0]
mov word [ebp - 0x2e8], ax
dec eax
mov word [ebp - 0x2cc], ax
lea eax, [ecx - 1]
mov word [ebp - 0x2ca], ax
mov eax, dword [0x47bab4]
mov word [ebp - 0x2e6], cx
mov dword [ebp - 0x2d0], edx
test eax, eax
je 0x417b3e
push eax
call fcn.0041b930
add esp, 4
mov eax, dword [0x47b998]
test eax, eax
je 0x417b50
push eax
call fcn.0041b930
add esp, 4
push esi
push edi
push str.After_adjustments_width_d_height_d_n
push 2
call fcn.0041a380
mov edi, dword [ebp - 0x2e4]
add esp, 0x10
lea esi, [edi*4]
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push esi
push 0x40
mov dword [0x47bab4], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp dword [ebp - 0x2f8], 0
mov dword [0x47b998], eax
jne 0x417ba9
push esi
push 0xff
push dword [0x47bab4]
call fcn.0042bf20
add esp, 0xc
jmp 0x417bd5
xor ecx, ecx
test edi, edi
jle 0x417bd5
mov edx, dword [0x47bab4]
jmp 0x417bc0
mov byte [edx + ecx*4], 0x20
mov ax, word [ebp - 0x2d4]
mov word [edx + ecx*4 + 2], ax
inc ecx
cmp ecx, edi
jl 0x417bc0
mov esi, dword [ebp - 0x2fc]
push dword [ebp - 0x2f0]
lea eax, [esi + 1]
mov dword [0x47baec], eax
call fcn.0041b930
mov edi, esi
add esp, 4
imul edi, dword [ebp - 0x304]
imul esi, edi, 0x13
push esi
push str.allocate_recvBuf_size_d_n
push 2
call fcn.0041a380
add esp, 0xc
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp dword [ebp - 0x2f8], 0
mov esi, dword [ebp - 0x2e8]
mov dword [ebp - 0x2f0], eax
mov byte [eax], 0
jne 0x417c89
mov edi, dword [ebp - 0x2dc]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleScreenBufferSize]
test eax, eax
jne 0x417c56
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetConsoleBufferSize_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0xc
lea eax, [ebp - 0x2a8]
push eax
push 1
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleWindowInfo]
test eax, eax
jne 0x417de9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetConsoleWindow_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0xc
jmp 0x417de9
cmp dword [ebp - 0x300], 0
je 0x417de3
movsx ecx, word [ebp - 0x2c6]
movsx eax, word [ebp - 0x2c8]
imul ecx, eax
mov dword [ebp - 0x300], 0
cmp ecx, edi
jbe 0x417d62
movsx eax, word [ebp - 0x2bc]
movsx edx, word [ebp - 0x2b8]
movsx ecx, word [ebp - 0x2ba]
sub edx, eax
movsx eax, word [ebp - 0x2be]
dec edx
sub ecx, eax
dec ecx
imul edx, ecx
cmp edx, edi
jle 0x417d62
mov edi, dword [ebp - 0x2dc]
lea eax, [ebp - 0x2a8]
push eax
push 1
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleWindowInfo]
test eax, eax
jne 0x417d37
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
movsx eax, word [ebp - 0x2a4]
push eax
movsx eax, word [ebp - 0x2a2]
push eax
movsx eax, word [ebp - 0x2a8]
push eax
movsx eax, word [ebp - 0x2a6]
push eax
push edi
push str.SetConsoleWindow_0x_x_T_d_L_d_B_d_R_d_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0x20
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleScreenBufferSize]
test eax, eax
jne 0x417de9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetConsoleBufferSize_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0xc
jmp 0x417de9
mov edi, dword [ebp - 0x2dc]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleScreenBufferSize]
test eax, eax
jne 0x417d8a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetConsoleBufferSize_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0xc
lea eax, [ebp - 0x2a8]
push eax
push 1
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleWindowInfo]
test eax, eax
jne 0x417de9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
movsx eax, word [ebp - 0x2a4]
push eax
movsx eax, word [ebp - 0x2a2]
push eax
movsx eax, word [ebp - 0x2a8]
push eax
movsx eax, word [ebp - 0x2a6]
push eax
push edi
push str.SetConsoleWindow_0x_x_T_d_L_d_B_d_R_d_failed_with__d_n
push 2
call fcn.0041a380
add esp, 0x20
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x2ac], eax
jmp 0x417de9
mov edi, dword [ebp - 0x2dc]
cmp dword [0x457eb0], 0
jne 0x4178e3
jmp 0x417e00
push str.start_readscreen_while_n
push 4
call fcn.0041a380
add esp, 8
lea eax, [ebp - 0x2c8]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
test eax, eax
jne 0x417e37
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetConsoleScreenBufferInfo_failure__rc___d___n
push 1
call fcn.0041a380
add esp, 0xc
movsx eax, word [ebp - 0x2c8]
push eax
movsx eax, word [ebp - 0x2c6]
push eax
push str.screen_buffer_info_height__d_width_d_n
push 4
call fcn.0041a380
mov eax, 0x1f4
add esp, 0x10
cmp word [ebp - 0x2c8], ax
jle 0x417e7b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push eax
push str.Failed_sanity_check.__Last_error___d__0x_x__n
push 8
call fcn.0041a380
add esp, 0x10
push 0x47baa0
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleCursorInfo]
test eax, eax
je 0x418556
cmp dword [0x47baa4], 0
jne 0x417efa
cmp dword [0x457fa4], 0
je 0x417f51
push 0x104
lea eax, [ebp - 0x17c]
push eax
push dword [0x457dcc]
call fcn.0041cf50
lea ecx, [ebp - 0x17c]
add esp, 0xc
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x417ec8
push 0
sub ecx, edx
lea eax, [ebp - 0x17c]
push ecx
push eax
push dword [ebp - 0x2ec]
call fcn.004045f0
xor eax, eax
add esp, 0x10
mov dword [0x457fa4], eax
cmp dword [0x47baa4], eax
je 0x417f51
jmp 0x417eff
mov eax, dword [0x457fa4]
test eax, eax
jne 0x417f51
push 0x104
lea eax, [ebp - 0x284]
push eax
push dword [0x457dcc]
call fcn.0041cfa0
lea eax, [ebp - 0x284]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x417f26
sub eax, edx
push 0
push eax
lea eax, [ebp - 0x284]
push eax
push dword [ebp - 0x2ec]
call fcn.004045f0
add esp, 0x10
mov dword [0x457fa4], 1
cmp byte [0x45a950], 1
je 0x417f82
mov cx, word [ebp - 0x2c8]
mov ax, word [ebp - 0x2c6]
cmp word [ebp - 0x2e8], cx
jne 0x4183e2
cmp word [ebp - 0x2e6], ax
jne 0x4183e2
mov eax, dword [ebp - 0x2e4]
mov edi, dword [0x47b998]
shl eax, 2
push eax
push 0x20
push edi
call fcn.0042bf20
add esp, 0xc
lea eax, [ebp - 0x2d0]
cmp byte [0x45a54e], 0
push eax
push dword [0x46b210]
push esi
je 0x418011
mov ecx, dword [ebp - 0x2dc]
mov edx, edi
call fcn.00413860
add esp, 0xc
test eax, eax
jne 0x417fe0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadConsoleOutput_failed_with__d_n
push 4
call fcn.0041a380
add esp, 0xc
jmp 0x41801e
movsx eax, word [ebp - 0x2ca]
push eax
movsx eax, word [ebp - 0x2cc]
push eax
movsx eax, word [ebp - 0x2ce]
push eax
movsx eax, word [ebp - 0x2d0]
push eax
push str.ReadConsoleOutput_L_T_R_B__d__d__d__d_n
push 4
call fcn.0041a380
add esp, 0x18
jmp 0x41801e
push edi
push dword [ebp - 0x2dc]
call dword [sym.imp.KERNEL32.dll_ReadConsoleOutputA]
cmp dword [0x47baac], 0
mov edi, dword [ebp - 0x2fc]
je 0x41803d
cmp word [ebp - 0x2c2], 0x17
mov eax, 0x18
cmove edi, eax
mov eax, dword [ebp - 0x2f0]
push dword [0x45a960]
mov dword [ebp - 0x2a0], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [ebp - 0x2fc]
lea edx, [ebp - 0x2b0]
imul ecx, dword [ebp - 0x304]
push dword [ebp - 0x2c4]
push 0x47baa8
mov eax, ecx
shl eax, 4
add eax, ecx
cmp byte [0x45a54e], 0
mov dword [ebp - 0x2b0], eax
je 0x4180e2
cmp byte [0x45a951], 0
lea ecx, [ebp - 0x2a0]
je 0x4180b7
sub esp, 8
push dword [ebp - 0x2f4]
push dword [ebp - 0x2e0]
push dword [ebp - 0x2e4]
sub esp, 8
call fcn.00416720
jmp 0x418104
push 0x47baec
push edi
push dword [ebp - 0x2f4]
push dword [ebp - 0x2e0]
push dword [ebp - 0x2e4]
push dword [0x47b998]
push dword [0x47bab4]
call fcn.00416a50
jmp 0x418104
push ecx
push edi
push dword [ebp - 0x2f4]
lea ecx, [ebp - 0x2a0]
push dword [ebp - 0x2e0]
push dword [ebp - 0x2e4]
sub esp, 8
call fcn.004170e0
mov edi, dword [ebp - 0x2a0]
add esp, 0x24
cmp dword [0x47bb2c], 0
je 0x418125
mov byte [edi], 7
inc edi
mov dword [0x47bb2c], 0
inc eax
test eax, eax
je 0x4181a8
mov ecx, dword [0x47bab4]
mov eax, dword [0x47b998]
push dword [0x45af84]
mov dword [0x47bab4], eax
mov dword [0x47b998], ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [ebp - 0x2f0]
sub edi, eax
mov dword [ebp - 0x2b0], edi
je 0x418184
push dword [0x45ac08]
mov ecx, dword [ebp - 0x2ec]
mov edx, eax
push edi
call fcn.00418e40
add esp, 8
mov dword [ebp - 0x2ac], eax
test eax, eax
je 0x4184f5
push dword [0x45af84]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov edi, dword [ebp - 0x2dc]
cmp dword [0x457eb0], 0
je 0x417e00
jmp 0x4178e3
mov eax, dword [0x45a960]
mov dword [ebp - 0x29c], eax
mov eax, dword [0x45a944]
mov dword [ebp - 0x298], eax
mov eax, dword [0x45aa84]
mov dword [ebp - 0x294], eax
mov eax, dword [0x45af7c]
mov dword [ebp - 0x290], eax
mov eax, dword [0x45af8c]
mov dword [ebp - 0x28c], eax
mov eax, dword [0x45af90]
mov dword [ebp - 0x288], 0
test eax, eax
je 0x418213
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
je 0x41824f
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.Released_Output_Lock_n
push 7
call fcn.0041a380
add esp, 0xc
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
push 0
lea eax, [ebp - 0x29c]
push eax
push 5
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 0x102
jg case.default.0x418248
je 0x418300
lea ecx, [eax + 1]
cmp ecx, 5
ja case.default.0x418248
jmp dword [ecx*4 + 0x41860c]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
push eax
push eax
push str.Failed_to_release_lock_rc___d__0x_0x__n
push 7
call fcn.0041a380
add esp, 0x10
jmp 0x418219
push str.ReadScreen_First_wait_keybdata_n
push 4
call fcn.0041a380
add esp, 8
push dword [0x45a960]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ebx, dword [0x457e48]
jmp case.default.0x418248
push str.Got_hSwitchConsoleEvent_first_wait_n
push 2
call fcn.0041a380
mov ecx, dword [ebp - 0x2dc]
add esp, 8
call fcn.004176a0
push dword [0x45af7c]
mov edi, eax
mov dword [0x457eb0], 1
mov dword [ebp - 0x2dc], edi
call dword [sym.imp.KERNEL32.dll_ResetEvent]
jmp 0x418196
push str.Got_hBeepEvent_first_wait_n
push 2
call fcn.0041a380
mov eax, dword [0x47bb2c]
add esp, 8
cmp dword [0x457ea0], 0
mov ecx, 1
cmovne eax, ecx
push dword [0x45af8c]
mov dword [0x47bb2c], eax
jmp 0x41818a
push str.ReadScreen_First_wait_WAIT_TIMEOUT_n
push 4
call fcn.0041a380
mov eax, dword [0x457e60]
add esp, 8
cmp ebx, eax
je 0x418323
add ebx, dword [0x457e54]
cmp ebx, eax
cmovg ebx, eax
call fcn.00419c60
cmp eax, 0x259
je 0x418344
mov ecx, dword [ebp - 0x2dc]
call fcn.004176a0
mov edi, eax
mov dword [ebp - 0x2dc], edi
jmp 0x41834a
mov edi, dword [ebp - 0x2dc]
cmp dword [0x45af90], 0
je 0x418196
push 0xffffffffffffffff
push str.Waiting_on_Output_Lock_timeout___d_n
push 7
call fcn.0041a380
add esp, 0xc
push 0xffffffffffffffff
push dword [0x45af90]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x418384
push str.Continuing_after_timeout_n
jmp 0x418389
push str.Got_Output_Lock_n
push 7
call fcn.0041a380
mov eax, dword [0x45af90]
add esp, 8
test eax, eax
je 0x418196
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
je 0x4183c6
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.Released_Output_Lock_n
push 7
call fcn.0041a380
add esp, 0xc
jmp 0x418196
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push eax
push str.Failed_to_release_lock_rc___d__0x_0x__n
push 7
call fcn.0041a380
add esp, 0x10
jmp 0x418196
cmp dword [0x47baac], 0
movsx ecx, cx
cwde
mov dword [0x45a940], ecx
mov dword [0x45a95c], eax
mov dword [0x457eb0], 1
jne 0x4178e3
cmp byte [0x45a54d], 0
mov byte [0x457ea8], cl
mov ecx, dword [0x45a96c]
mov edi, ecx
mov byte [0x457eaa], al
mov dword [ebp - 0x2a0], 0
je 0x418439
mov edi, dword [ebp - 0x2dc]
jmp 0x4178e3
mov eax, dword [0x45a938]
mov ebx, dword [ebp - 0x2ec]
cmp ebx, eax
je 0x418474
cmp ebx, ecx
je 0x418476
cmp ebx, dword [0x45aa7c]
je 0x418476
test ebx, ebx
je 0x418476
push 9
mov edx, 0x457ea4
mov ecx, ebx
call fcn.00404560
mov edi, dword [ebp - 0x2dc]
add esp, 4
jmp 0x4178e3
mov edi, eax
cmp dword [0x45aa80], 0
je 0x418497
cmp edi, ecx
jne 0x418497
push 9
push 0x457ea4
push 0x45a828
call fcn.0041c5b0
add esp, 0xc
push 0
push dword [0x45af78]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x4184d0
push 0
lea eax, [ebp - 0x2a0]
push eax
push 9
push 0x457ea4
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [0x45a958]
test ecx, ecx
jne 0x4184db
lea ebx, [ebx]
mov edi, dword [ebp - 0x2dc]
jmp 0x4178e3
push 9
mov edx, 0x457ea4
call fcn.00404560
mov edi, dword [ebp - 0x2dc]
add esp, 4
jmp 0x4178e3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x308], 0
jmp 0x418566
cmp eax, 0xffffffff
jne 0x41852a
call edi
push eax
push str.Got_wait_failed_terminate_event_first_wait__d._n
push 2
call fcn.0041a380
add esp, 0xc
mov dword [ebp - 0x2b0], 0
jmp 0x41856c
cmp eax, 1
je 0x41853b
cmp eax, 2
je 0x41853b
push str.Got_shell_terminate_event_first_wait_n
jmp 0x418540
push str.Got_hRSTerminate_failed_terminate_event_first_wait._n
push 2
call fcn.0041a380
add esp, 8
mov dword [ebp - 0x2b0], 0
jmp 0x41856c
mov dword [ebp - 0x308], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x2ac], eax
push str.Exiting_ReadScreen___n
push 1
call fcn.0041a380
add esp, 8
cmp dword [ebp - 0x308], 0
jne 0x4185a5
push str.Console_Read_Error.
push dword [ebp - 0x2ac]
push 1
push 2
push 0xe0000003
push str.TelnetServer
call fcn.00419930
add esp, 0x18
push dword [0x45af84]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x47b998]
test eax, eax
je 0x4185c3
push eax
call fcn.0041b930
add esp, 4
mov eax, dword [0x47bab4]
test eax, eax
je 0x4185d5
push eax
call fcn.0041b930
add esp, 4
mov eax, dword [ebp - 0x2f0]
test eax, eax
je 0x4185e8
push eax
call fcn.0041b930
add esp, 4
mov eax, dword [0x45a958]
test eax, eax
je 0x4185f8
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004265fb
mov esp, ebp
pop ebp
ret