Function at 0x40ff34
Capabilities:
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
lea ebp, [esp - 0x1bc]
sub esp, 0x23c
mov eax, dword [0x414050]
push ebx
push esi
push edi
push 0x408018
xor ebx, ebx
push 0xa
mov dword [ebp + 0x1b8], eax
mov dword [ebp - 0x7c], 0x104
mov dword [ebp - 0x5c], ebx
call fcn.0040eaa1
mov eax, dword [ebp + 0x1cc]
push dword [eax]
push 0x407fdc
push ebx
call fcn.0040eaa1
mov esi, dword [ebp + 0x1d4]
push esi
push 0x407f9c
push 0xa
call fcn.0040eaa1
add esp, 0x20
lea eax, [ebp - 0x70]
push eax
push 0x20019
push ebx
push esi
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov edi, eax
cmp edi, ebx
je 0x40ffdd
push edi
push esi
push 0x407f40
push 0x14
call fcn.0040eaa1
add esp, 0x10
push edi
push esi
push 0x80001393
call fcn.0040e844
push 0x407f14
push 0xa
call fcn.0040eaa1
pop ecx
pop ecx
jmp 0x410497
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp + 0xb0]
push eax
lea eax, [ebp - 0x80]
push eax
push ebx
push 0x406218
push dword [ebp - 0x70]
mov byte [ebp + 0x1b4], 0
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
cmp eax, ebx
je 0x410019
push eax
push esi
push 0x407eb8
push 0x14
call fcn.0040eaa1
add esp, 0x10
jmp 0x410095
lea eax, [ebp + 0xb0]
push eax
push 0x407e7c
push 0xa
call fcn.0040eaa1
add esp, 0xc
mov esi, 0x105
push esi
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp + 0xb0]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
mov edi, eax
cmp edi, ebx
je 0x41006c
cmp edi, esi
ja 0x41006c
lea eax, [ebp - 0x58]
push eax
push 0x407e44
push 0xa
call fcn.0040eaa1
add esp, 0xc
mov dword [ebp - 0x68], 1
jmp 0x410098
push edi
lea eax, [ebp + 0xb0]
push eax
push 0x407de8
push 0x14
call fcn.0040eaa1
add esp, 0x10
push edi
lea eax, [ebp + 0xb0]
push eax
push 0x40001397
call fcn.0040e844
mov dword [ebp - 0x68], ebx
push 0x407da8
push 0xa
call fcn.0040eaa1
pop ecx
pop ecx
push dword [ebp - 0x70]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 0x1c8], ebx
mov dword [ebp - 0x64], ebx
jbe 0x410475
mov edi, dword [ebp + 0x1c4]
mov dword [ebp + 0x1d4], edi
push dword [edi]
push dword [ebp - 0x64]
push 0x407d74
push ebx
call fcn.0040eaa1
mov ecx, dword [edi]
mov eax, ecx
add esp, 0x10
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4100e4
sub eax, esi
mov dword [ebp - 0x60], ecx
jmp 0x41043b
push 0x407d70
push dword [ebp - 0x60]
call dword [sym.imp.msvcrt.dll_strstr]
mov esi, eax
cmp esi, ebx
pop ecx
pop ecx
je 0x410446
sub eax, dword [edi]
inc esi
inc esi
mov dword [ebp - 0x78], eax
mov eax, esi
mov dword [ebp - 0x74], esi
mov dword [ebp - 0x60], esi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x410121
sub eax, ecx
mov dword [ebp + 0x1c4], eax
je 0x41044d
push esi
call dword [sym.imp.msvcrt.dll_atol]
cmp eax, ebx
pop ecx
mov dword [ebp + 0x1c4], eax
jne 0x410172
cmp byte [esi], 0x30
je 0x410172
push 0x407d28
push 0xa
call fcn.0040eaa1
pop ecx
lea eax, [esi - 1]
pop ecx
mov dword [ebp - 0x60], eax
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x410164
sub eax, ecx
jmp 0x41043b
cmp dword [ebp - 0x68], ebx
mov dword [ebp - 0x6c], ebx
je 0x410216
lea esi, [ebp - 0x58]
push 0x3b
push esi
call dword [sym.imp.msvcrt.dll_strchr]
mov ebx, eax
xor edi, edi
cmp ebx, edi
pop ecx
pop ecx
je 0x410197
mov byte [ebx], 0
push esi
push dword [ebp + 0x1c4]
push 0x407cc8
push 0xa
call fcn.0040eaa1
add esp, 0x10
push esi
call fcn.0040fede
cmp eax, edi
jne 0x4101bd
push esi
call fcn.0040fe25
cmp ebx, edi
je 0x4101c4
mov byte [ebx], 0x3b
cmp eax, edi
mov dword [ebp - 0x5c], edi
je 0x4101f8
push edi
push 0x50
lea ecx, [ebp - 0x5c]
push ecx
push edi
push dword [ebp + 0x1c4]
push eax
push 0xb00
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
test edi, edi
mov dword [ebp - 0x6c], eax
jne 0x41029b
push dword [ebp - 0x5c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [ebp - 0x5c], 0
mov esi, ebx
inc ebx
neg esi
sbb esi, esi
and esi, ebx
jne 0x410181
xor ebx, ebx
push dword [ebp - 0x6c]
push 0x407c78
push 0xa
call fcn.0040eaa1
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 0xc
push dword [ebp - 0x5c]
call esi
push 0x407c3c
push 0xa
mov dword [ebp - 0x5c], ebx
call fcn.0040eaa1
pop ecx
pop ecx
push ebx
push 0x50
lea eax, [ebp - 0x5c]
push eax
push ebx
push dword [ebp + 0x1c4]
push dword [ebp + 0x1d8]
push 0xb00
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edi, eax
cmp edi, ebx
jne 0x41029b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push ebx
push 0x407bf8
push 0xa
call fcn.0040eaa1
add esp, 0xc
push ebx
push dword [ebp + 0x1c4]
push 0x400013a0
call fcn.0040e710
push dword [ebp - 0x5c]
call esi
and dword [ebp - 0x5c], 0
mov eax, dword [ebp - 0x74]
push 2
pop ebx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4102a4
sub eax, esi
jmp 0x4102e4
mov esi, dword [ebp - 0x60]
movsx eax, byte [esi]
push eax
call dword [sym.imp.msvcrt.dll_isdigit]
test eax, eax
pop ecx
je 0x4102ec
xor eax, eax
mov al, byte [esi]
inc ebx
push eax
call dword [sym.imp.KERNEL32.dll_IsDBCSLeadByte]
test eax, eax
je 0x4102d2
inc esi
inc esi
mov eax, esi
mov dword [ebp - 0x60], esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4102db
sub eax, edx
mov dword [ebp + 0x1c4], eax
jne 0x4102af
mov eax, dword [ebp + 0x1d4]
mov ecx, dword [eax]
mov eax, ecx
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4102f9
sub eax, esi
sub eax, ebx
lea esi, [eax + edi + 1]
mov eax, ecx
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x41030d
sub eax, ecx
inc eax
push esi
push eax
push 0x407ba8
push 0
mov dword [ebp + 0x1c4], eax
call fcn.0040eaa1
add esp, 0x10
cmp esi, dword [ebp + 0x1c4]
jbe 0x4103c1
mov eax, dword [ebp + 0x1d4]
push esi
push dword [eax]
call sub.snmpapi.dll_SnmpUtilMemReAlloc
mov esi, eax
test esi, esi
je 0x4104af
push esi
push 0x407b6c
push 0xa
call fcn.0040eaa1
mov eax, dword [ebp + 0x1d4]
mov dword [eax], esi
mov eax, dword [ebp - 0x78]
add esi, eax
lea eax, [edi + esi]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp + 0x1cc]
mov ecx, edi
sub ecx, ebx
add dword [eax], ecx
mov eax, dword [eax]
push eax
sub eax, edi
add eax, ebx
push eax
push 0x407b20
push 0
call fcn.0040eaa1
mov eax, esi
add esp, 0x1c
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x41039a
sub eax, ecx
inc eax
push eax
mov eax, edi
sub eax, ebx
mov ebx, dword [sym.imp.msvcrt.dll_memmove]
add eax, esi
push esi
push eax
call ebx
push edi
push dword [ebp - 0x5c]
push esi
call ebx
add esp, 0x18
jmp 0x4103fc
push 0x407ae0
push 0xa
call fcn.0040eaa1
mov esi, dword [ebp - 0x74]
mov eax, dword [ebp + 0x1cc]
sub dword [eax], ebx
dec esi
dec esi
add ebx, esi
pop ecx
mov eax, ebx
pop ecx
mov dword [ebp - 0x60], esi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4103e6
sub eax, ecx
inc eax
push eax
push ebx
push esi
call dword [sym.imp.msvcrt.dll_memmove]
add esp, 0xc
test edi, edi
je 0x41040d
push dword [ebp - 0x5c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [ebp - 0x5c], 0
mov eax, dword [ebp + 0x1d4]
push dword [eax]
push 0x407ab4
push 0
call fcn.0040eaa1
mov eax, dword [ebp - 0x60]
add esp, 0xc
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x41042a
mov edi, dword [ebp + 0x1d4]
sub eax, ecx
xor ebx, ebx
cmp eax, 2
ja 0x4100f5
jmp 0x41045a
push 0x407a78
jmp 0x410452
push 0x407a3c
push ebx
call fcn.0040eaa1
pop ecx
pop ecx
inc dword [ebp - 0x64]
mov eax, dword [ebp - 0x64]
add edi, 4
cmp eax, dword [ebp + 0x1c8]
mov dword [ebp + 0x1d4], edi
jb 0x4100ca
mov eax, dword [ebp + 0x1cc]
push dword [eax]
push 0x407a04
push ebx
call fcn.0040eaa1
push 0x4079d4
push 0xa
call fcn.0040eaa1
add esp, 0x14
mov ecx, dword [ebp + 0x1b8]
pop edi
pop esi
pop ebx
call fcn.00412b09
add ebp, 0x1bc
leave
ret 0x18
push 0x407978
push 0x14
call fcn.0040eaa1
pop ecx
pop ecx
push 0xc0000bc6
call fcn.0040e5bb
mov eax, dword [ebp + 0x1cc]
push dword [eax]
push 0x407a04
push 0
call fcn.0040eaa1
add esp, 0xc
push dword [ebp - 0x5c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x410497