Function at 0x503c87
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x20270
call fcn.00506f00
mov eax, dword [0x67e2d4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
push 0x2001c
mov dword [ebp - 0x20270], eax
lea eax, [ebp - 0x2003c]
push ebx
push eax
mov dword [ebp - 0x2026c], 1
mov dword [ebp - 0x20264], ebx
mov dword [ebp - 0x20260], ebx
call fcn.0056b050
push 0x1d8
lea eax, [ebp - 0x2025c]
push ebx
push eax
call fcn.0056b050
push 6
pop ecx
xor eax, eax
mov byte [ebp - 0x20], bl
lea edi, [ebp - 0x1f]
rep stosd dword es:[edi], eax
push 0x48
push ebx
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x20084]
push eax
call fcn.0056b050
push 0x2001c
lea eax, [ebp - 0x2003c]
push ebx
push eax
call fcn.0056b050
push 0x1d8
lea eax, [ebp - 0x2025c]
push ebx
push eax
call fcn.0056b050
push 0x1c
lea eax, [ebp - 0x20]
push ebx
push eax
call fcn.0056b050
add esp, 0x48
lea eax, [ebp - 0x20084]
push 0x48
push ebx
push eax
call fcn.0056b050
add esp, 0xc
mov dword [ebp - 0x2003c], esi
push esi
push ebx
push 0x410
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
cmp edi, 0xffffffff
jne 0x503d6e
xor eax, eax
jmp 0x504013
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x18
mov ebx, eax
push 8
push ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x503d90
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x503d67
lea eax, [ebp - 0x20264]
push eax
push 0x18
push esi
push 0
push edi
call dword [0x686078]
test eax, eax
js 0x503fe2
cmp dword [ebp - 0x20264], 0x18
jbe 0x503dea
push esi
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0x20264]
push 8
push ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x503d87
lea eax, [ebp - 0x20264]
push eax
push dword [ebp - 0x20264]
push esi
push 0
push edi
call dword [0x686078]
test eax, eax
js 0x503fe2
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x20038], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x20028], eax
mov eax, dword [esi]
mov dword [ebp - 0x20024], eax
mov eax, dword [esi + 4]
mov dword [ebp - 0x20030], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0x2002c], eax
mov eax, 0xfffe
cmp dword [esi + 4], 0
je 0x503fc6
lea eax, [ebp - 0x20260]
push eax
push 0x1d8
lea eax, [ebp - 0x2025c]
push eax
push dword [esi + 4]
push edi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x503fc1
mov eax, dword [ebp - 0x20088]
and dword [ebp - 0x20260], 0
mov dword [ebp - 0x20034], eax
mov al, byte [ebp - 0x2025a]
mov byte [ebp - 0x20020], al
lea eax, [ebp - 0x20260]
push eax
push 0x48
lea eax, [ebp - 0x20084]
push eax
push dword [ebp - 0x2024c]
push edi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x503fc1
mov ax, word [ebp - 0x20044]
test ax, ax
je 0x503f2c
movzx eax, ax
push eax
push 8
push ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, eax
mov dword [ebp - 0x20268], ecx
test ecx, ecx
je 0x503f2c
lea eax, [ebp - 0x20260]
push eax
movzx eax, word [ebp - 0x20044]
push eax
push ecx
push dword [ebp - 0x20040]
push edi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x503f0d
mov ax, word [ebp - 0x20044]
mov ecx, 0xfffe
cmp ax, cx
jb 0x503ef6
lea eax, [ecx - 2]
jmp 0x503ef9
movzx eax, ax
push eax
push dword [ebp - 0x20268]
lea eax, [ebp - 0x10020]
push ecx
push eax
call fcn.00503b68
push dword [ebp - 0x20268]
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
jne 0x503f2c
and dword [ebp - 0x2026c], 0
jmp 0x503fe2
mov ax, word [ebp - 0x2004c]
test ax, ax
je 0x503fc1
and dword [ebp - 0x20260], 0
movzx eax, ax
push eax
push 8
push ebx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, eax
mov dword [ebp - 0x20268], ecx
test ecx, ecx
je 0x503fc1
lea eax, [ebp - 0x20260]
push eax
movzx eax, word [ebp - 0x2004c]
push eax
push ecx
push dword [ebp - 0x20048]
push edi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x503faa
mov ax, word [ebp - 0x2004c]
mov ecx, 0xfffe
cmp ax, cx
jb 0x503f93
lea eax, [ecx - 2]
jmp 0x503f96
movzx eax, ax
push eax
push dword [ebp - 0x20268]
lea eax, [ebp - 0x2001e]
push ecx
push eax
call fcn.00503b68
push dword [ebp - 0x20268]
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
je 0x503f20
mov eax, 0xfffe
cmp dword [ebp - 0x2003c], 4
jne 0x503fe2
push eax
lea eax, [ebp - 0x2001e]
push eax
push str._SystemRoot_System32_ntoskrnl.exe
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push esi
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_HeapFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x2001c
lea eax, [ebp - 0x2003c]
push eax
push dword [ebp - 0x20270]
call fcn.0056a550
mov eax, dword [ebp - 0x2026c]
add esp, 0xc
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00506d7f
mov esp, ebp
pop ebp
ret