Function at 0x40b5d0
Capabilities:
Check os version
Listen for remote procedure calls
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4304fc
mov eax, dword fs:[0]
push eax
sub esp, 0x278
mov eax, dword [0x43b860]
xor eax, esp
mov dword [esp + 0x270], eax
push ebx
push esi
push edi
mov eax, dword [0x43b860]
xor eax, esp
push eax
lea eax, [esp + 0x288]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
cmp edi, 2
jl 0x40b6bb
push str.DefaultPort
push dword [esi + 4]
call fcn.00415d7f
add esp, 8
test eax, eax
je 0x40b6bb
push ecx
push str.__0_9___
lea ecx, [esp + 0x1c]
call fcn.0040c0e0
mov dword [esp + 0x290], 0
push ecx
mov ecx, dword [esi + 4]
mov edx, eax
call fcn.0040c4c0
add esp, 4
lea ecx, [esp + 0x14]
mov bl, al
mov dword [esp + 0x290], 0xffffffff
call fcn.0040c180
push dword [esi + 4]
test bl, bl
je 0x40b714
call fcn.00416dab
add esp, 4
test eax, eax
js 0x40b6fc
push dword [esi + 4]
call fcn.00416dab
add esp, 4
cmp eax, 0xffff
jg 0x40b6fc
mov ecx, dword [esi + 4]
call fcn.0040ae00
push dword [esi + 4]
mov dword [0x442c84], eax
push str.KMS_Port:__s__n
call fcn.00416fd1
add esp, 8
cmp edi, 3
jl 0x40b7b2
push str.DefaultKMSPID
push dword [esi + 8]
call fcn.00415d7f
add esp, 8
test eax, eax
je 0x40b79f
push str.RandomKMSPID
push dword [esi + 8]
call fcn.00415d7f
add esp, 8
test eax, eax
jne 0x40b729
mov byte [0x44430c], 1
jmp 0x40b7b2
push dword [esi + 4]
push str.Invalid_Port_Range___s_is_not_a_valid_argument._n
call fcn.00416fd1
add esp, 8
or eax, 0xffffffff
jmp 0x40bbca
push str.Invalid_Port___s_is_not_a_valid_argument._n
call fcn.00416fd1
add esp, 8
or eax, 0xffffffff
jmp 0x40bbca
push ecx
push str.__0_9_5____0_9_5____0_9_3____0_9_6____0_9_2____0_9_4_5____0_9_4_.__0_9_4____0_9_7__
lea ecx, [esp + 0x1c]
call fcn.0040c0e0
mov dword [esp + 0x290], 1
push ecx
mov ecx, dword [esi + 8]
mov edx, eax
call fcn.0040c4c0
add esp, 4
lea ecx, [esp + 0x14]
mov bl, al
mov dword [esp + 0x290], 0xffffffff
call fcn.0040c180
test bl, bl
je 0x40b787
mov ecx, dword [esi + 8]
call fcn.0040ae00
push dword [esi + 8]
mov dword [str.55041_00168_305_246209_03_1033_7600.0000_0522010], eax
push 0x436c74
call fcn.00416fd1
jmp 0x40b7af
push dword [esi + 8]
push str.Invalid_PID___s_is_not_a_valid_argument._n
call fcn.00416fd1
add esp, 8
or eax, 0xffffffff
jmp 0x40bbca
push dword [0x442c80]
push str.KMS_PID:__s__n
call fcn.00416dc8
add esp, 8
cmp edi, 4
jl 0x40b815
push str.DefaultActivationInterval
push dword [esi + 0xc]
call fcn.00415d7f
add esp, 8
test eax, eax
je 0x40b815
push dword [esi + 0xc]
call fcn.00416dab
add esp, 4
cmp eax, 0xf
jl 0x40b91f
push dword [esi + 0xc]
call fcn.00416dab
add esp, 4
cmp eax, 0xa8c0
jg 0x40b91f
push dword [esi + 0xc]
call fcn.00416dab
add esp, 4
push dword [esi + 0xc]
mov dword [0x442c88], eax
push str.KMS_Activation_Interval:__s_minutes__n
call fcn.00416fd1
add esp, 8
cmp edi, 5
jl 0x40b878
push str.DefaultRenewalInterval
push dword [esi + 0x10]
call fcn.00415d7f
add esp, 8
test eax, eax
je 0x40b878
push dword [esi + 0x10]
call fcn.00416dab
add esp, 4
cmp eax, 0xf
jl 0x40b937
push dword [esi + 0x10]
call fcn.00416dab
add esp, 4
cmp eax, 0xa8c0
jg 0x40b937
push dword [esi + 0x10]
call fcn.00416dab
add esp, 4
push dword [esi + 0x10]
mov dword [0x442c8c], eax
push str.KMS_Renewal_Interval:__s_minutes__n
call fcn.00416fd1
add esp, 8
cmp edi, 6
jl 0x40b8a4
push str.KillProcessOnPort
push dword [esi + 0x14]
call fcn.00415d7f
movzx ecx, byte [0x44430b]
add esp, 8
mov edx, 1
test eax, eax
cmove ecx, edx
mov byte [0x44430b], cl
push 0
push dword [0x442c84]
push 0xa
push 0x436e48
call dword [sym.imp.RPCRT4.dll_RpcServerUseProtseqEpW]
mov esi, eax
test esi, esi
je 0x40bb48
cmp esi, 0x6cc
jne 0x40bb82
cmp byte [0x44430b], 1
jne 0x40bb82
lea eax, [esp + 0x5c]
push eax
mov dword [esp + 0x60], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
mov dword [esp + 0x40], 0xf
mov dword [esp + 0x3c], 0
mov byte [esp + 0x2c], 0
mov dword [esp + 0x290], 2
mov eax, dword [esp + 0x60]
cmp eax, 5
jne 0x40b94f
push str.FOR__F__tokens4_delims____P_IN__netstat__ano__findstr_:1688___DO_echo__P
jmp 0x40b959
push dword [esi + 0xc]
push str.Invalid_Activation_Interval_Range___s_is_not_a_valid_argument._n
call fcn.00416fd1
add esp, 8
or eax, 0xffffffff
jmp 0x40bbca
push dword [esi + 0x10]
push str.Invalid_Renewal_Interval_Range___s_is_not_a_valid_argument._n
call fcn.00416fd1
add esp, 8
or eax, 0xffffffff
jmp 0x40bbca
cmp eax, 6
jb 0x40b962
push str.FOR__F__tokens5_delims____P_IN__netstat__ano__findstr_:1688___DO_echo__P
lea ecx, [esp + 0x30]
call fcn.0040c020
push 4
sub esp, 8
lea ecx, [esp + 0x38]
call fcn.0040b250
mov esi, eax
call fcn.0040ae60
push eax
push ecx
push esi
lea ecx, [esp + 0x38]
call fcn.0040c060
cmp dword [esp + 0x40], 0x10
lea eax, [esp + 0x2c]
cmovae eax, dword [esp + 0x2c]
push 0x436e64
push eax
call fcn.00416676
mov edi, eax
push edi
lea eax, [esp + 0x180]
push 0x104
push eax
call fcn.00416e74
add esp, 0x14
test eax, eax
je 0x40bb0c
mov ebx, dword [sym.imp.KERNEL32.dll_OpenProcess]
jmp 0x40b9d0
cmp byte [esp + 0x174], 0
mov dword [esp + 0x28], 0xf
mov dword [esp + 0x24], 0
mov byte [esp + 0x14], 0
jne 0x40b9f3
xor ecx, ecx
jmp 0x40ba09
lea ecx, [esp + 0x174]
lea edx, [ecx + 1]
lea ecx, [ecx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40ba00
sub ecx, edx
push ecx
lea eax, [esp + 0x178]
push eax
lea ecx, [esp + 0x1c]
call fcn.00403500
sub esp, 8
lea eax, [esp + 0x18]
mov byte [esp + 0x298], 3
push eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x1c], 0x20
call fcn.0040c450
lea ecx, [eax + 1]
cmp dword [esp + 0x24], ecx
jb 0x40bb78
cmp dword [esp + 0x28], 0x10
lea eax, [esp + 0x14]
cmovae eax, dword [esp + 0x14]
mov dword [esp + 0x24], ecx
mov byte [eax + ecx], 0
sub esp, 8
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x1c], 0x20
call fcn.0040c3e0
push ecx
inc eax
push eax
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x20]
call fcn.0040c0a0
push eax
lea ecx, [esp + 0x18]
call fcn.00408280
cmp dword [esp + 0x58], 0x10
jb 0x40baa0
push dword [esp + 0x44]
call fcn.0041557d
add esp, 4
cmp dword [esp + 0x28], 0x10
lea eax, [esp + 0x14]
cmovae eax, dword [esp + 0x14]
push eax
call fcn.00416dab
add esp, 4
push eax
push 0
push 0x1fffff
call ebx
mov esi, eax
push 0
push esi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [esp + 0x290], 2
cmp dword [esp + 0x28], 0x10
jb 0x40baee
push dword [esp + 0x14]
call fcn.0041557d
add esp, 4
push edi
lea eax, [esp + 0x178]
push 0x104
push eax
call fcn.00416e74
add esp, 0xc
test eax, eax
jne 0x40b9d0
push edi
call fcn.004165a7
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push dword [0x442c84]
push 0xa
push str.ncacn_ip_tcp
call dword [sym.imp.RPCRT4.dll_RpcServerUseProtseqEpW]
cmp dword [esp + 0x40], 0x10
jb 0x40bb48
push dword [esp + 0x2c]
call fcn.0041557d
add esp, 4
push 0
push 0x4d2
push 0x11
push 0
push 0
push 0x4368d0
call dword [sym.imp.RPCRT4.dll_RpcServerRegisterIfEx]
mov esi, eax
test esi, esi
je 0x40bb94
push esi
push str.RpcServerRegisterIfEx_failed_with_code__i._n
call fcn.00416fd1
add esp, 8
mov eax, esi
jmp 0x40bbca
push str.invalid_string_position
call fcn.00412eca
push esi
push str.RpcServerUseProtseqEp_failed_with_code__i._n
call fcn.00416fd1
add esp, 8
mov eax, esi
jmp 0x40bbca
push str.KMS_Server_Emulator_running..._n
call fcn.00416fd1
add esp, 4
push 0
push 0x4d2
push 1
call dword [sym.imp.RPCRT4.dll_RpcServerListen]
mov esi, eax
test esi, esi
je 0x40bbc8
push esi
push str.RpcServerListen_failed_with_code__i._n
call fcn.00416fd1
add esp, 8
mov eax, esi
jmp 0x40bbca
xor eax, eax
mov ecx, dword [esp + 0x288]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x270]
xor ecx, esp
call fcn.00414dc0
mov esp, ebp
pop ebp
ret