Function at 0x10051975
Capabilities:
Persist via windows service
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x46c
push ebx
xor ebx, ebx
cmp byte [0x100e2e70], bl
push esi
push edi
je 0x10051a28
or esi, 0xffffffff
push esi
push dword [ebp + 8]
lea ecx, [ebp - 0x18]
call fcn.10050221
mov edi, dword [eax]
push esi
push dword [ebp + 0x18]
lea ecx, [ebp - 0x34]
call fcn.10050221
push esi
push dword [ebp + 0x14]
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x24], eax
call fcn.10050221
push esi
push dword [ebp + 0x10]
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x20], eax
call fcn.10050221
push esi
mov esi, dword [ebp + 0xc]
push esi
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x1c], eax
call fcn.10050221
mov ecx, dword [ebp - 0x24]
push dword [ecx]
mov ecx, dword [ebp - 0x20]
push dword [ecx]
mov ecx, dword [ebp - 0x1c]
push dword [ecx]
push dword [eax]
push edi
push str._r_nRegSetIP__s__s__s__s__s__r_n
push 0x100e3108
call fcn.10011029
add esp, 0x1c
lea ecx, [ebp - 0x18]
call fcn.1003f96c
lea ecx, [ebp - 0x14]
call fcn.1003f96c
lea ecx, [ebp - 0x30]
call fcn.1003f96c
lea ecx, [ebp - 0x2c]
call fcn.1003f96c
lea ecx, [ebp - 0x34]
call fcn.1003f96c
jmp 0x10051a2b
mov esi, dword [ebp + 0xc]
mov al, byte [esi]
cmp al, 0x2a
mov byte [ebp - 5], bl
je 0x10051a38
cmp al, 0x3f
jne 0x10051a3b
mov byte [ebp - 5], al
push str.SYSTEMCurrentControlSetServicesTcpipParametersInterfaces_
lea ecx, [ebp - 0x24]
call fcn.10050195
push dword [ebp + 8]
lea ecx, [ebp - 0x24]
call fcn.10046015
movzx ecx, word [0x100e2c20]
lea eax, [ebp - 0x10]
push eax
mov al, byte [ebp - 5]
neg al
sbb eax, eax
and eax, 0xfffdfffa
add eax, 0x20006
or eax, ecx
or eax, 1
push eax
push ebx
push dword [ebp - 0x24]
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x10051bd8
cmp byte [esi], 0x2d
jne 0x10051aa8
push dword [ebp + 0x18]
lea ebx, [ebp - 0x10]
push dword [ebp + 8]
call fcn.10051882
pop ecx
pop ecx
mov ebx, eax
jmp 0x10051bd8
cmp byte [ebp - 5], bl
je 0x10051be7
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0xc]
push eax
push ebx
push str.EnableDHCP
push dword [ebp - 0x10]
mov esi, 0x320
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
call edi
test eax, eax
je 0x10051ae3
mov dword [ebp - 0x18], ebx
cmp byte [ebp - 5], 0x3f
jne 0x10051af1
cmp dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ebx
jne 0x10051af8
mov dword [ebp - 0x14], 4
mov eax, dword [ebp + 0xc]
inc eax
lea ecx, [ebp - 4]
push ecx
push eax
mov dword [ebp + 0xc], eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x14]
push ebx
lea eax, [eax + str.DhcpIPAddress]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
call edi
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 0xc]
call fcn.1004117a
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x10]
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x14]
push ebx
lea eax, [eax + str.DhcpSubnetMask]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
call edi
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 0x10]
call fcn.1004117a
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x14]
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x14]
push ebx
lea eax, [eax + str.DhcpDefaultGateway]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
call edi
mov eax, dword [ebp - 4]
mov edx, dword [ebp + 0x14]
call fcn.1004117a
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x18]
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x14]
push ebx
lea eax, [eax + str.DhcpNameServer]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
call edi
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x1c]
lea eax, [ebp - 0xc]
push eax
push ebx
push str.DhcpServer
push dword [ebp - 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
call edi
mov eax, dword [ebp + 0x20]
cmp eax, ebx
je 0x10051bd5
cmp dword [ebp - 0x18], ebx
setne cl
add cl, 0x30
movsx cx, cl
mov word [eax], cx
xor ebx, ebx
inc ebx
lea ecx, [ebp - 0x24]
call fcn.1003f96c
mov eax, ebx
jmp 0x10051f2f
xor eax, eax
push 0x36
pop edx
mov byte [ebp - 0x2b4], bl
mov ecx, edx
lea edi, [ebp - 0x2b3]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov byte [ebp - 0x1d8], bl
mov ecx, edx
lea edi, [ebp - 0x1d7]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov byte [ebp - 0x46c], bl
mov ecx, edx
lea edi, [ebp - 0x46b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov byte [ebp - 0x390], bl
mov ecx, edx
lea edi, [ebp - 0x38f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x46c]
push eax
lea eax, [ebp - 0xc]
push eax
push ebx
push str.IPAddress
push dword [ebp - 0x10]
mov edi, 0xc8
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], edi
call esi
mov eax, dword [ebp - 4]
lea edx, [ebp - 0x46c]
call fcn.1004117a
shl eax, 0x10
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x30], eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x390]
push eax
lea eax, [ebp - 0xc]
push eax
push ebx
push str.SubnetMask
push dword [ebp - 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], edi
call esi
mov eax, dword [ebp - 4]
lea edx, [ebp - 0x390]
call fcn.1004117a
shl eax, 0x10
add dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x2c], eax
push 0x31
xor eax, eax
mov byte [ebp - 0xfc], bl
pop ecx
lea edi, [ebp - 0xfb]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x28], ebx
mov dword [ebp - 4], 4
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0xc]
push eax
push ebx
push str.EnableDHCP
push dword [ebp - 0x10]
call esi
cmp dword [ebp - 0x28], ebx
jle 0x10051d00
add dword [ebp - 0x14], 0x10000
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x2d
jne 0x10051d0d
mov eax, 0x100c78c2
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpynA]
mov esi, 0xc6
push esi
push eax
lea eax, [ebp - 0x2b4]
push eax
call edi
mov eax, dword [ebp + 0x10]
cmp byte [eax], 0x2d
jne 0x10051d30
mov eax, 0x100c78c2
push esi
push eax
lea eax, [ebp - 0x1d8]
push eax
call edi
mov eax, dword [ebp + 0x14]
cmp byte [eax], 0x2d
jne 0x10051d48
mov eax, 0x100c78c2
cmp byte [eax], 0x30
je 0x10051d58
push esi
push eax
lea eax, [ebp - 0xfc]
push eax
call edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea eax, [ebp - 0x2b4]
push eax
call edi
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1d8]
push eax
call edi
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0xfc]
push eax
call edi
push dword [ebp + 0xc]
mov esi, eax
call dword [0x100e3340]
mov eax, dword [ebp - 0x18]
mov byte [ebp + eax - 0x1d7], bl
mov eax, dword [ebp - 0x1c]
cmp eax, ebx
mov byte [ebp + esi - 0xfb], bl
mov byte [ebp + eax - 0x2b3], bl
je 0x10051dad
add dword [ebp - 0x1c], 2
cmp dword [ebp - 0x18], ebx
je 0x10051db6
add dword [ebp - 0x18], 2
cmp esi, ebx
je 0x10051dbb
inc esi
inc esi
lea ecx, [ebp - 0x1d8]
mov dword [ebp - 0x34], esi
call fcn.10041150
lea ecx, [ebp - 0x2b4]
mov esi, eax
call fcn.10041150
add eax, dword [ebp - 0x14]
lea ecx, [ebp - 0xfc]
add eax, esi
mov dword [ebp - 0x14], eax
call fcn.10041150
mov eax, dword [ebp + 0x18]
xor ecx, ecx
cmp eax, ebx
sete cl
cmp eax, ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x28], ecx
je 0x10051e16
mov al, byte [eax]
cmp al, 0x2d
jne 0x10051e0b
mov dword [ebp - 0x20], 0x100c78c2
cmp al, 0x30
jne 0x10051e16
mov dword [ebp - 0x20], 0x100c78c2
mov eax, dword [ebp + 0xc]
cmp byte [eax], bl
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
je 0x10051e3a
push dword [ebp - 0x1c]
lea eax, [ebp - 0x2b4]
push eax
push 7
push ebx
push str.IPAddress
push dword [ebp - 0x10]
call esi
mov eax, dword [ebp + 0x10]
cmp byte [eax], bl
je 0x10051e58
push dword [ebp - 0x18]
lea eax, [ebp - 0x1d8]
push eax
push 7
push ebx
push str.SubnetMask
push dword [ebp - 0x10]
call esi
mov eax, dword [ebp + 0x14]
cmp byte [eax], bl
je 0x10051e76
push dword [ebp - 0x34]
lea eax, [ebp - 0xfc]
push eax
push 7
push ebx
push str.DefaultGateway
push dword [ebp - 0x10]
call esi
mov eax, dword [ebp + 0x18]
cmp byte [eax], bl
je 0x10051e93
push dword [ebp - 0x20]
call edi
push eax
push dword [ebp - 0x20]
push 1
push ebx
push str.NameServer
push dword [ebp - 0x10]
call esi
push 4
lea eax, [ebp - 0x28]
push eax
push 4
push ebx
push str.EnableDHCP
push dword [ebp - 0x10]
call esi
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [ebp + 0x10]
cmp byte [esi], bl
jne 0x10051ee9
cmp byte [ebp - 0x390], bl
je 0x10051ee9
mov edi, dword [ebp - 0x2c]
push edi
lea eax, [ebp - 0x390]
push eax
push esi
call fcn.100144ff
lea ecx, [edi - 2]
add esp, 0xc
xor eax, eax
cmp ecx, ebx
jle 0x10051ee9
cmp byte [eax + esi], bl
jne 0x10051ee4
mov byte [eax + esi], 0x3b
inc eax
cmp eax, ecx
jl 0x10051edb
mov edi, dword [ebp + 0xc]
cmp byte [edi], bl
jne 0x10051f23
cmp byte [ebp - 0x46c], bl
je 0x10051f23
mov esi, dword [ebp - 0x30]
push esi
lea eax, [ebp - 0x46c]
push eax
push edi
call fcn.100144ff
lea ecx, [esi - 2]
add esp, 0xc
xor eax, eax
cmp ecx, ebx
jle 0x10051f23
cmp byte [eax + edi], bl
jne 0x10051f1e
mov byte [eax + edi], 0x3b
inc eax
cmp eax, ecx
jl 0x10051f15
lea ecx, [ebp - 0x24]
call fcn.1003f96c
mov eax, dword [ebp - 0x14]
inc eax
pop edi
pop esi
pop ebx
leave
ret