Function at 0x5809e5
Capabilities:
Hide graphical window
Terminate process

Disassembly:
push ebp
sub esp, 0x58
mov eax, 0x6b04f9
call fcn.006426c4
sub esp, 0x48
cmp dword [0x7e6a30], 0
push ebx
mov ebx, ecx
mov dword [ebp + 0x40], ebx
je 0x580a14
mov ecx, dword [0x7e6a44]
test ecx, ecx
je 0x580a14
call fcn.005b7262
cmp dword [ebp + 0x64], 0
mov eax, dword [ebp + 0x64]
jne 0x580a22
mov eax, 0x7479ec
push eax
push str.DoDestroy__s
call fcn.0040e6e4
add esp, 8
call fcn.0059fa08
call fcn.00488cb1
call fcn.0047ecca
test al, al
jne 0x5811cd
push esi
push edi
lea ecx, [ebx + 0xa8]
mov byte [0x7b158d], al
call fcn.005dbc5f
lea ecx, [ebx + 0xb8]
call fcn.005dbc5f
lea ecx, [ebx + 0xc8]
call fcn.005dbc5f
lea ecx, [ebx + 0xd8]
call fcn.005dbc5f
lea ecx, [ebx + 0xe8]
call fcn.005dbc5f
lea ecx, [ebx + 0xf8]
call fcn.005dbc5f
call fcn.004a7bf3
mov esi, dword [eax + 4]
mov edi, esi
jmp 0x580aa4
mov ecx, dword [esi + 8]
mov eax, dword [ecx]
call dword [eax + 8]
mov esi, dword [esi]
cmp esi, edi
jne 0x580a9c
xor eax, eax
mov dword [ebp], 0x6c40ec
mov dword [ebp + 4], eax
mov dword [ebp + 8], eax
mov dword [ebp + 0xc], eax
push dword [ebp + 0x64]
lea ecx, [ebp + 0x10]
mov dword [ebp - 4], eax
call fcn.0040f32f
push 0x6d1930
lea ecx, [ebp + 0x44]
mov byte [ebp - 4], 1
call fcn.0040f32f
lea eax, [ebp + 0x10]
mov byte [ebp - 4], 2
push eax
lea eax, [ebp + 0x44]
push eax
lea ecx, [ebp]
call fcn.0043a257
xor edi, edi
lea ecx, [ebp + 0x44]
push 0
inc edi
push edi
call fcn.0040f95f
push 0
push edi
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 0
call fcn.0040f95f
lea eax, [ebp - 0x54]
push eax
lea ecx, [ebp]
call fcn.00440920
push str.ShutdownBegin
lea ecx, [ebp + 0x44]
mov byte [ebp - 4], 3
call fcn.0040f32f
push edi
push 0
push 0
lea eax, [ebp + 0x44]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x54]
push eax
push 0x1e
call fcn.00489021
push 0
push edi
lea ecx, [ebp + 0x44]
mov byte [ebp - 4], 3
call fcn.0040f95f
push dword [0x7c1ee4]
call dword [sym.imp.USER32.dll_IsIconic]
push dword [0x7c1ee4]
test eax, eax
setne byte [ebp + 0x28]
call dword [sym.imp.USER32.dll_IsWindowVisible]
test eax, eax
setne byte [ebp + 0x2c]
call fcn.0047ecee
cmp byte [0x7b0fd1], 0
je 0x580bff
push str.Helper_shutdown
lea ecx, [ebp + 0x44]
call fcn.0040f32f
push 0x1f4
mov ecx, 0x7b5960
mov byte [ebp - 4], 5
call fcn.005046ed
mov esi, str.succeeded
test al, al
jne 0x580bb0
mov esi, str.failed
push esi
call fcn.0040f53e
pop ecx
push eax
push esi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
cmp dword [ebp + 0x58], 0x10
mov eax, dword [ebp + 0x44]
jae 0x580bcd
lea eax, [ebp + 0x44]
push eax
push 0x6d5368
call fcn.0040e3f1
cmp dword [ebp + 0x58], 0x10
mov eax, dword [ebp + 0x44]
pop ecx
pop ecx
jae 0x580be6
lea eax, [ebp + 0x44]
push eax
push 0x10
call fcn.0048941f
pop ecx
pop ecx
push 0
push edi
lea ecx, [ebp + 0x44]
mov byte [ebp - 4], 3
call fcn.0040f95f
call fcn.005af707
mov eax, dword [0x7e6a44]
push edi
push dword [eax + 4]
call fcn.00584e7b
cmp byte [0x7b10b5], 0
mov ecx, ebx
je 0x580c2d
push 4
call fcn.0058010e
mov byte [0x7b10b5], 0
jmp 0x580c37
push 0x200
call fcn.0058010e
mov ecx, ebx
call fcn.0058081e
call fcn.005eb9c8
lea ecx, [ebx + 0x78]
call fcn.00595e42
mov ecx, ebx
call fcn.00584c49
push edi
call fcn.004c2960
mov byte [ebp + 0x67], 1
call fcn.00479151
mov ecx, dword [0x7b5030]
mov byte [ebp - 4], 6
mov eax, dword [ecx]
call dword [eax + 0x64]
mov eax, dword [0x7b8620]
or byte [eax + 0x28], 1
mov eax, dword [0x7b8624]
test eax, eax
je 0x580c86
or byte [eax + 0x28], 1
mov eax, dword [0x7b8628]
or byte [eax + 0x1c], 1
mov eax, dword [0x7b862c]
test eax, eax
je 0x580c9c
or byte [eax + 0x1c], 1
mov ecx, dword [0x7b63b0]
test ecx, ecx
je 0x580cad
push 1
call fcn.00479701
mov ecx, dword [0x7b63b4]
test ecx, ecx
je 0x580cbe
push 1
call fcn.00479701
mov byte [ebp - 4], 7
call fcn.00479192
push 0
push dword [ebx + 4]
mov byte [ebp - 4], 3
call dword [sym.imp.USER32.dll_ShowWindow]
mov esi, dword [0x7c1dc4]
test esi, esi
je 0x580cfb
mov ecx, esi
call fcn.005dc0a3
push 0xb4
push esi
call fcn.006426e4
and dword [0x7c1dc4], 0
pop ecx
pop ecx
mov ecx, dword [ebx + 0x70]
test ecx, ecx
je 0x580d11
and dword [ebx + 0x70], 0
test ecx, ecx
je 0x580d11
mov eax, dword [ecx]
push 1
call dword [eax + 0x14]
xor esi, esi
mov edi, 0x7c2128
cmp dword [0x7c2138], esi
jbe 0x580d3e
push esi
mov ecx, edi
call fcn.00424466
mov ecx, dword [eax]
test ecx, ecx
je 0x580d35
push 1
call fcn.0057f777
inc esi
cmp esi, dword [0x7c2138]
jb 0x580d20
mov ecx, edi
call fcn.0044777c
call fcn.00697e84
mov esi, dword [ebp + 0x40]
xor edi, edi
xor bl, bl
call fcn.0048dde9
mov ecx, dword [0x78db40]
inc edi
mov dword [ebp + 0x40], eax
mov dword [ebp + 0x64], eax
mov dword [ebp + 0x3c], edi
test ecx, ecx
je 0x580d88
imul eax, ecx, 0x3e8
push 0x32
pop ecx
cdq
idiv ecx
cmp edi, eax
jl 0x580d85
mov eax, dword [ebp + 0x40]
and eax, 0xfffffff7
mov dword [ebp + 0x64], eax
jmp 0x580d88
mov eax, dword [ebp + 0x64]
cmp byte [0x7b0fd1], 0
je 0x580da7
mov ecx, 0x7b5960
call fcn.00502566
test eax, eax
mov eax, dword [ebp + 0x64]
je 0x580da7
or eax, 0x10
jmp 0x580daa
and eax, 0xffffffef
cmp byte [0x78db39], 0
mov dword [ebp + 0x64], eax
je 0x580dd4
cmp edi, 0xc8
jl 0x580dc3
cmp eax, 1
je 0x580ddc
cmp edi, 0x12c
jl 0x580de0
test eax, 0xffffffee
jne 0x580de0
jmp 0x580ddc
cmp edi, 0xc8
jl 0x580de0
and dword [ebp + 0x64], 0
test byte [ebp + 0x40], 2
jne 0x580e03
test bl, bl
jne 0x580e03
push 1
call fcn.00585e0f
push dword [esi + 4]
lea ebx, [eax - 1]
neg bl
sbb bl, bl
inc bl
call dword [sym.imp.USER32.dll_DestroyWindow]
cmp dword [ebp + 0x64], 0
je 0x580fe6
mov eax, edi
mov ecx, 0x4b0
cdq
idiv ecx
test edx, edx
jne 0x580fd7
and dword [ebp + 0x54], edx
mov dword [ebp + 0x58], 0xf
mov byte [ebp + 0x44], dl
mov edi, str.Shutdown_pending:
mov byte [ebp - 4], 8
push edi
call fcn.0040f53e
pop ecx
push eax
push edi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
test byte [ebp + 0x64], 1
mov edi, 0x711f94
jne 0x580e56
mov edi, 0x7479ec
push edi
call fcn.0040f53e
pop ecx
push eax
push edi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
test byte [ebp + 0x64], 2
mov edi, str.DiskIO
jne 0x580e77
mov edi, 0x7479ec
push edi
call fcn.0040f53e
pop ecx
push eax
push edi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
test byte [ebp + 0x64], 4
mov edi, str.DelTorrents
jne 0x580e98
mov edi, 0x7479ec
push edi
call fcn.0040f53e
pop ecx
push eax
push edi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
test byte [ebp + 0x64], 8
mov edi, str.UPnP
jne 0x580eb9
mov edi, 0x7479ec
push edi
call fcn.0040f53e
pop ecx
push eax
push edi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
test byte [ebp + 0x64], 0x10
mov edi, str.Helper
jne 0x580eda
mov edi, 0x7479ec
push edi
call fcn.0040f53e
pop ecx
push eax
push edi
lea ecx, [ebp + 0x44]
call fcn.0040f4a2
cmp dword [ebp + 0x58], 0x10
mov eax, dword [ebp + 0x44]
jae 0x580ef7
lea eax, [ebp + 0x44]
push eax
call fcn.0040e3f1
mov dword [esp], 0x7480c4
call fcn.0040e3f1
cmp dword [ebp + 0x58], 0x10
mov eax, dword [ebp + 0x44]
pop ecx
jae 0x580f16
lea eax, [ebp + 0x44]
push eax
push 0x10
call fcn.0048941f
xor eax, eax
mov dword [ebp + 0x18], 0x6c40ec
pop ecx
pop ecx
mov dword [ebp + 0x1c], eax
mov dword [ebp + 0x20], eax
mov dword [ebp + 0x24], eax
push 0x6d1930
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 9
call fcn.0040f32f
lea eax, [ebp + 0x44]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp + 0x18]
call fcn.0043a257
push 0
push 1
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 9
call fcn.0040f95f
lea eax, [ebp - 0x24]
push eax
lea ecx, [ebp + 0x18]
call fcn.00440920
push str.ShutdownPending
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 0xb
call fcn.0040f32f
push 1
push 0
push 0
lea eax, [ebp - 0x3c]
mov byte [ebp - 4], 0xc
push eax
lea eax, [ebp - 0x24]
push eax
push 0x1e
call fcn.00489021
push 0
push 1
lea ecx, [ebp - 0x3c]
call fcn.0040f95f
push 0
push 1
lea ecx, [ebp - 0x24]
call fcn.0040f95f
lea ecx, [ebp + 0x1c]
call fcn.00438f50
push 0
push 1
lea ecx, [ebp + 0x44]
mov dword [ebp + 0x18], 0x6c40b4
mov byte [ebp - 4], 3
call fcn.0040f95f
mov edi, dword [ebp + 0x3c]
push 0x32
pop eax
push eax
call dword [sym.imp.KERNEL32.DLL_Sleep]
jmp 0x580d51
xor eax, eax
push eax
push eax
push eax
push 0xa
call fcn.0050a6de
test eax, eax
je 0x580ffb
add eax, 0xc
jmp 0x580ffd
xor eax, eax
push 0
push eax
call fcn.0050c1b0
test bl, bl
jne 0x581019
push 0
call fcn.00585e0f
lea ebx, [eax - 1]
neg bl
sbb bl, bl
inc bl
lea eax, [ebp + 0x38]
push eax
lea eax, [ebp + 0x34]
push eax
lea eax, [ebp + 0x30]
push eax
call fcn.00494aef
call fcn.004949f1
mov esi, eax
call fcn.004949a5
mov edi, eax
call fcn.004948ef
cmp dword [eax + 0x14], 0x10
jb 0x581045
mov eax, dword [eax]
push edi
push esi
push dword [ebp + 0x38]
push dword [ebp + 0x34]
push dword [ebp + 0x30]
push eax
lea eax, [ebp - 0x24]
push str._action_:__s._d._d._02d._d._05d_
push eax
call fcn.00465d5a
add esp, 0x20
lea ecx, [ebp - 0x54]
push eax
call fcn.0040ef82
push 0
push 1
lea ecx, [ebp - 0x24]
call fcn.0040f95f
xor eax, eax
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.DLL_CreateEventW]
push str.ShutdownDone
lea ecx, [ebp - 0x24]
mov esi, eax
call fcn.0040f32f
push 1
push esi
push 0x57e1c2
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 0xd
push eax
lea eax, [ebp - 0x54]
push eax
push 0x1e
call fcn.00489021
push 0
push 1
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 3
call fcn.0040f95f
push 0x1388
push esi
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
test eax, eax
sete cl
test cl, cl
mov ecx, str.SENT
jne 0x5810dc
mov ecx, 0x712014
push eax
push ecx
push str.ShutdownDone__s_with_wait_result__d.
call fcn.0040e6e4
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
call fcn.004a7bf3
mov esi, dword [eax + 4]
mov edi, esi
jmp 0x581106
mov ecx, dword [esi + 8]
mov eax, dword [ecx]
call dword [eax + 0xc]
mov esi, dword [esi]
cmp esi, edi
jne 0x5810fe
pop edi
pop esi
test bl, bl
jne 0x581121
xor ebx, ebx
mov ecx, 0x7b5b9c
push ebx
call fcn.005114b9
jmp 0x581123
xor ebx, ebx
mov byte [ebp + 0x67], 1
call fcn.00479151
mov ecx, dword [0x7b8620]
push ebx
mov byte [ebp - 4], 0xe
call fcn.00479701
mov ecx, dword [0x7b8624]
test ecx, ecx
je 0x58114c
push ebx
call fcn.00479701
mov ecx, dword [0x7b8628]
push ebx
call fcn.00479701
mov ecx, dword [0x7b862c]
test ecx, ecx
je 0x581168
push ebx
call fcn.00479701
mov byte [ebp - 4], 0xf
call fcn.00479192
mov byte [ebp - 4], 3
call fcn.00488cd4
cmp byte [ebp + 0x68], 0
je 0x5811a3
push dword [0x7c1da4]
call dword [sym.imp.KERNEL32.DLL_ReleaseMutex]
push dword [0x7c1da4]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [ebp + 0x2c]
push dword [ebp + 0x28]
call fcn.0059e4ea
push ebx
push 0x107
call fcn.0048d97a
cmp byte [ebp + 0x6c], 0
push ebx
je 0x5811bb
call dword [sym.imp.KERNEL32.DLL_ExitProcess]
push 1
lea ecx, [ebp - 0x54]
call fcn.0040f95f
lea ecx, [ebp + 4]
call fcn.00438f50
mov ecx, dword [ebp - 0xc]
pop ebx
mov dword fs:[0], ecx
lea esp, [ebp + 0x5c]
pop ebp
ret 0xc