Function at 0x4080cd
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x524
mov eax, dword [0x4d4664]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
lea eax, [ebp - 0x20c]
push edi
push 0x208
xor ebx, ebx
push ebx
push eax
call fcn.00481190
push 0x108
lea eax, [ebp - 0x51c]
push ebx
push eax
call fcn.00481190
add esp, 0x18
test esi, esi
je 0x40812e
cmp byte [esi], bl
je 0x40812e
push 0x107
lea eax, [ebp - 0x51c]
push esi
push eax
call fcn.00485910
add esp, 0xc
jmp 0x40816e
push 0x107
lea eax, [ebp - 0x51c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x51c]
push 0x5c
push eax
call fcn.004812f0
pop ecx
pop ecx
test eax, eax
je 0x40815a
mov byte [eax + 1], bl
jmp 0x40816e
mov ecx, ebx
mov al, byte [ecx + 0x4a34e4]
mov byte [ebp + ecx - 0x51c], al
inc ecx
test al, al
jne 0x40815c
mov ecx, ebx
mov al, byte [ebp + ecx - 0x51c]
mov byte [ecx + 0x4d6800], al
inc ecx
test al, al
jne 0x408170
mov edi, 0x4d6800
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x408188
mov esi, str.rserv30.exe
push str.r_server.exe
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00405c04
pop ecx
test eax, eax
je 0x4083fc
mov ecx, ebx
mov al, byte [ecx + str.SoftwareMicrosoftWindowsCurrentVersionUninstallRemote_Administrator_v2.2]
mov byte [ebp + ecx - 0x414], al
inc ecx
test al, al
jne 0x4081ad
lea eax, [ebp - 0x520]
mov edi, 0x208
push eax
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x520], edi
push eax
lea eax, [ebp - 0x524]
push eax
push str.UninstallString
lea eax, [ebp - 0x414]
push eax
push reloc.WS2_32.dll_bind
call fcn.00406493
add esp, 0x18
test eax, eax
jne 0x408227
mov ecx, dword [ebp - 0x524]
cmp ecx, 1
je 0x40820c
cmp ecx, 2
jne 0x408227
lea edx, [ebp - 0x20c]
lea esi, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x408215
sub edx, esi
cmp edx, 1
jge 0x40830e
push edi
lea eax, [ebp - 0x20c]
push ebx
push eax
call fcn.00481190
add esp, 0xc
mov ecx, ebx
mov al, byte [ecx + str.SoftwareMicrosoftWindowsCurrentVersionUninstallRemote_Administrator_v2.1]
mov byte [ebp + ecx - 0x414], al
inc ecx
test al, al
jne 0x40823a
lea eax, [ebp - 0x520]
mov dword [ebp - 0x520], edi
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x524]
push eax
push str.UninstallString
lea eax, [ebp - 0x414]
push eax
push reloc.WS2_32.dll_bind
call fcn.00406493
add esp, 0x18
test eax, eax
jne 0x4082ab
mov ecx, dword [ebp - 0x524]
cmp ecx, 1
je 0x408294
cmp ecx, 2
jne 0x4082ab
lea edx, [ebp - 0x20c]
lea esi, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x40829d
sub edx, esi
cmp edx, 1
jge 0x40830e
push edi
lea eax, [ebp - 0x20c]
push ebx
push eax
call fcn.00481190
add esp, 0xc
mov ecx, ebx
mov al, byte [ecx + str.SoftwareMicrosoftWindowsCurrentVersionUninstallRemote_Administrator_v2.0]
mov byte [ebp + ecx - 0x414], al
inc ecx
test al, al
jne 0x4082be
lea eax, [ebp - 0x520]
mov dword [ebp - 0x520], edi
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x524]
push eax
push str.UninstallString
lea eax, [ebp - 0x414]
push eax
push reloc.WS2_32.dll_bind
call fcn.00406493
add esp, 0x18
test eax, eax
jne 0x408374
mov ecx, dword [ebp - 0x524]
cmp ecx, 1
je 0x408318
cmp ecx, 2
jne 0x408374
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408321
sub ecx, edx
test ecx, ecx
jle 0x408374
lea eax, [ebp - 0x20c]
push 0x25
push eax
call fcn.00482bc0
pop ecx
pop ecx
test eax, eax
je 0x408374
push edi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
jle 0x408374
cmp eax, edi
ja 0x408374
mov ecx, ebx
mov al, byte [ebp + ecx - 0x414]
mov byte [ebp + ecx - 0x20c], al
inc ecx
test al, al
jne 0x408361
lea eax, [ebp - 0x20c]
push 0x3a
push eax
call fcn.004812f0
mov esi, eax
lea eax, [ebp - 0x20c]
push 0x5c
push eax
call fcn.004812f0
add esp, 0x10
test esi, esi
je 0x408401
test eax, eax
je 0x408401
sub eax, esi
add eax, 2
push eax
lea eax, [esi - 1]
push eax
lea eax, [ebp - 0x414]
push eax
call fcn.00480c10
lea edi, [ebp - 0x414]
add esp, 0xc
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4083bd
mov esi, str.r_server.exe
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push str.__s___stop
movsd dword es:[edi], dword [esi]
push eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
call fcn.004018a8
push ebx
push ebx
push 0xf
push 1
lea eax, [ebp - 0x20c]
push eax
push ebx
call fcn.004067a8
add esp, 0x24
mov edi, 0x208
push str.rserver3.exe
call fcn.00405c04
pop ecx
test eax, eax
jne 0x40854c
push edi
lea eax, [ebp - 0x20c]
push ebx
push eax
call fcn.00481190
lea eax, [ebp - 0x520]
mov dword [ebp - 0x520], edi
push eax
lea eax, [ebp - 0x20c]
mov esi, str.SoftwareMicrosoftWindowsCurrentVersionUninstallAAD51583_6D43_4444_A1FF_0C8345345526
push eax
lea eax, [ebp - 0x524]
push eax
push str.UninstallString
push esi
push reloc.WS2_32.dll_bind
call fcn.00406493
add esp, 0x24
test eax, eax
jne 0x408512
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408466
sub ecx, edx
test ecx, ecx
jle 0x408512
push edi
lea eax, [ebp - 0x20c]
push ebx
push eax
call fcn.00481190
lea eax, [ebp - 0x520]
mov dword [ebp - 0x520], edi
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x524]
push eax
push str.InstallLocation
push esi
push reloc.WS2_32.dll_bind
call fcn.00406493
add esp, 0x24
test eax, eax
jne 0x40854c
cmp dword [ebp - 0x524], 1
je 0x4084cd
cmp dword [ebp - 0x524], 2
jne 0x40854c
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4084d6
sub ecx, edx
test ecx, ecx
jle 0x40854c
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push str.__srserver3.exe___start
push eax
call fcn.004018a8
push ebx
push ebx
push 0xf
push 1
lea eax, [ebp - 0x414]
push eax
push ebx
call fcn.004067a8
mov ebx, eax
jmp 0x408545
push 0x4d6800
lea eax, [ebp - 0x414]
push str.__s___S__v_qn
push eax
call fcn.004018a8
push ebx
push ebx
push 0x2d
push 1
lea eax, [ebp - 0x414]
push eax
push ebx
call fcn.004067a8
mov dword [0x4d6a20], 1
add esp, 0x24
test ebx, ebx
jne 0x408551
call fcn.00407f2f
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0047f259
mov esp, ebp
pop ebp
ret