Function at 0x1017f980
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push esi
mov dword [ebp - 4], 0
cmp dword [ebp + 8], 0
jl 0x1017f9a0
cmp dword [ebp + 8], 0
jne 0x1017f9b4
cmp dword [ebp + 0xc], 2
je 0x1017f9b4
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
or eax, 0xffffffff
jmp 0x1017fbf8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp dword [ebp + 8], eax
jne 0x1017f9f5
cmp dword [ebp + 0xc], 0
je 0x1017f9f5
cmp dword [ebp + 0xc], 9
je 0x1017f9f5
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_raise]
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x1017f9ed
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
mov eax, dword [ebp - 4]
jmp 0x1017fbf8
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0xc], ecx
cmp dword [ebp - 0xc], 0
je 0x1017fa16
cmp dword [ebp - 0xc], 2
je 0x1017fa77
cmp dword [ebp - 0xc], 9
je 0x1017fae3
jmp 0x1017fbe2
mov edx, dword [ebp + 8]
push edx
push 0
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x1017fa36
cmp dword [ebp - 0x10], 0xffffffff
jne 0x1017fa64
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x57
jne 0x1017fa4f
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 3
jmp 0x1017fa5b
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 1
mov dword [ebp - 4], 0xffffffff
jmp 0x1017fa6e
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
jne 0x1017fa16
jmp 0x1017fbf5
mov dword [ebp - 0x18], 0
cmp dword [ebp + 8], 0
je 0x1017fa8b
mov dword [ebp - 0x18], 1
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GenerateConsoleCtrlEvent]
test eax, eax
jne 0x1017fada
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x1017faba
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 1
jmp 0x1017fad3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.ruby.dll_rb_w32_map_errno
add esp, 4
mov esi, eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], esi
mov dword [ebp - 4], 0xffffffff
xor ecx, ecx
jne 0x1017fa77
jmp 0x1017fbf5
mov edx, dword [ebp + 8]
push edx
call fcn.10184720
add esp, 4
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x1017fb02
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
mov dword [ebp - 8], ecx
jmp 0x1017fb16
mov edx, dword [ebp + 8]
push edx
push 0
push 0x401
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x1017fb22
cmp dword [ebp - 8], 0xffffffff
jne 0x1017fb53
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x57
jne 0x1017fb3b
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 3
jmp 0x1017fb47
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 1
mov dword [ebp - 4], 0xffffffff
jmp 0x1017fbd8
lea eax, [ebp - 0x20]
push eax
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
jne 0x1017fb87
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.ruby.dll_rb_w32_map_errno
add esp, 4
mov esi, eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], esi
mov dword [ebp - 4], 0xffffffff
jmp 0x1017fbc8
cmp dword [ebp - 0x20], 0x103
jne 0x1017fbb5
push 0
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
test eax, eax
jne 0x1017fbb3
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 1
mov dword [ebp - 4], 0xffffffff
jmp 0x1017fbc8
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 3
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x14], 0
jne 0x1017fbd8
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
jne 0x1017fae3
jmp 0x1017fbf5
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 4]
pop esi
mov esp, ebp
pop ebp
ret