Function at 0x404700
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x528
xor eax, eax
push esi
push edi
mov byte [esp + 0x18], 0
mov ecx, 0x81
lea edi, [esp + 0x19]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov ecx, 0x42
lea edi, [esp + 0x428]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0xc]
test eax, eax
mov dword [esp + 0x14], 0
je 0x40475f
cmp byte [eax], 0
je 0x40475f
push 0x107
push eax
lea eax, [esp + 0x430]
push eax
call fcn.00412010
add esp, 0xc
jmp 0x4047ab
push 0x107
lea ecx, [esp + 0x42c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x428]
push 0x5c
push edx
call fcn.004121a0
add esp, 8
test eax, eax
je 0x404790
mov byte [eax + 1], 0
jmp 0x4047ab
mov ax, word [0x41f5b4]
mov cl, byte [0x41f5b6]
mov word [esp + 0x428], ax
mov byte [esp + 0x42a], cl
xor eax, eax
lea ecx, [ecx]
mov cl, byte [esp + eax + 0x428]
mov byte [eax + 0x428c70], cl
inc eax
test cl, cl
jne 0x4047b0
mov edi, 0x428c70
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4047c8
mov edx, dword [str.rserv30.exe]
mov eax, dword [0x41f7f4]
mov ecx, dword [0x41f7f8]
mov dword [edi], edx
mov dword [edi + 4], eax
push str.r_server.exe
mov dword [edi + 8], ecx
call fcn.004059a0
add esp, 4
test eax, eax
je 0x404a65
mov ecx, 0x13
mov esi, str.SoftwareMicrosoftWindowsCurrentVersionUninstallRemote_Administrator_v2.2
lea edi, [esp + 0x220]
rep movsd dword es:[edi], dword [esi]
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x18]
push ecx
push str.UninstallString
lea edx, [esp + 0x230]
push edx
push reloc.WS2_32.dll_bind
movsw word es:[edi], word [esi]
mov dword [esp + 0x24], 0x208
call fcn.0040a3c0
add esp, 0x18
test eax, eax
jne 0x404872
mov esi, dword [esp + 0x10]
cmp esi, 1
je 0x404856
cmp esi, 2
jne 0x404872
lea eax, [esp + 0x18]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404860
sub eax, edx
cmp eax, 1
jge 0x40494d
xor eax, eax
mov ecx, 0x82
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
mov ecx, 0x13
mov esi, str.SoftwareMicrosoftWindowsCurrentVersionUninstallRemote_Administrator_v2.1
lea edi, [esp + 0x220]
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0xc]
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x18]
push edx
push str.UninstallString
lea eax, [esp + 0x230]
push eax
push reloc.WS2_32.dll_bind
movsw word es:[edi], word [esi]
mov dword [esp + 0x24], 0x208
call fcn.0040a3c0
add esp, 0x18
test eax, eax
jne 0x4048ee
mov esi, dword [esp + 0x10]
cmp esi, 1
je 0x4048d7
cmp esi, 2
jne 0x4048ee
lea eax, [esp + 0x18]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4048e0
sub eax, edx
cmp eax, 1
jge 0x40494d
xor eax, eax
mov ecx, 0x82
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
mov ecx, 0x13
mov esi, str.SoftwareMicrosoftWindowsCurrentVersionUninstallRemote_Administrator_v2.0
lea edi, [esp + 0x220]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x18]
push eax
push str.UninstallString
lea ecx, [esp + 0x230]
push ecx
push reloc.WS2_32.dll_bind
movsw word es:[edi], word [esi]
mov dword [esp + 0x24], 0x208
call fcn.0040a3c0
add esp, 0x18
test eax, eax
jne 0x4049c0
mov esi, dword [esp + 0x10]
cmp esi, 1
je 0x404957
cmp esi, 2
jne 0x4049c0
lea eax, [esp + 0x18]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404960
sub eax, edx
test eax, eax
jle 0x4049c0
lea edx, [esp + 0x18]
push 0x25
push edx
call fcn.004129d0
add esp, 8
test eax, eax
je 0x4049c0
push 0x208
lea eax, [esp + 0x224]
push eax
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
jle 0x4049c0
cmp eax, 0x208
ja 0x4049c0
xor eax, eax
jmp 0x4049b0
mov cl, byte [esp + eax + 0x220]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x4049b0
lea edx, [esp + 0x18]
push 0x3a
push edx
call fcn.004121a0
mov esi, eax
lea eax, [esp + 0x20]
push 0x5c
push eax
call fcn.004121a0
add esp, 0x10
test esi, esi
je 0x404a65
test eax, eax
je 0x404a65
mov ecx, eax
sub ecx, esi
add ecx, 2
mov edx, ecx
shr ecx, 2
dec esi
lea edi, [esp + 0x220]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x220]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404a12
mov eax, dword [str.r_server.exe]
mov ecx, dword [0x41f7e4]
mov edx, dword [0x41f7e8]
mov dword [edi], eax
mov al, byte [0x41f7ec]
mov dword [edi + 4], ecx
lea ecx, [esp + 0x220]
push ecx
mov dword [edi + 8], edx
lea edx, [esp + 0x1c]
push str.__s___stop
push edx
mov byte [edi + 0xc], al
call fcn.00412696
push 0xf
push 1
lea eax, [esp + 0x2c]
push eax
push 0
call fcn.00409e80
add esp, 0x1c
push str.rserver3.exe
call fcn.004059a0
add esp, 4
test eax, eax
jne 0x404b66
mov ecx, 0x82
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x18]
push eax
push str.UninstallString
push str.SoftwareMicrosoftWindowsCurrentVersionUninstallAAD51583_6D43_4444_A1FF_0C8345345526
mov esi, 0x208
push reloc.WS2_32.dll_bind
mov dword [esp + 0x24], esi
call fcn.0040a3c0
add esp, 0x18
test eax, eax
jne 0x404b75
lea eax, [esp + 0x18]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404ac3
sub eax, edx
test eax, eax
jle 0x404b75
xor eax, eax
mov ecx, 0x82
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x18]
push eax
push str.InstallLocation
push str.SoftwareMicrosoftWindowsCurrentVersionUninstallAAD51583_6D43_4444_A1FF_0C8345345526
push reloc.WS2_32.dll_bind
mov dword [esp + 0x24], esi
call fcn.0040a3c0
add esp, 0x18
test eax, eax
jne 0x404b66
mov eax, dword [esp + 0x10]
cmp eax, 1
je 0x404b1d
cmp eax, 2
jne 0x404b66
lea eax, [esp + 0x18]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404b24
sub eax, edx
test eax, eax
jle 0x404b66
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x224]
push str.__srserver3.exe___start
push edx
call fcn.00412696
push 0xf
push 1
lea eax, [esp + 0x234]
push eax
push 0
call fcn.00409e80
add esp, 0x1c
test eax, eax
mov dword [esp + 0x14], eax
jne 0x404b6b
call fcn.004044c0
mov eax, dword [esp + 0x14]
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push 0x428c70
lea ecx, [esp + 0x224]
push str.__s___S__v_qn
push ecx
call fcn.00412696
push 0x2d
push 1
lea edx, [esp + 0x234]
push edx
push 0
call fcn.00409e80
add esp, 0x1c
mov dword [0x428c6c], 1
call fcn.004044c0
mov eax, dword [esp + 0x14]
pop edi
pop esi
mov esp, ebp
pop ebp
ret