Function at 0x4912a0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x59e4cc
mov eax, dword fs:[0]
push eax
sub esp, 0x258
mov eax, dword [0x5e6468]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov ebx, edx
mov dword [ebp - 0x23c], ecx
mov ecx, esi
mov dword [ebp - 0x228], ebx
mov dword [ebp - 0x220], esi
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x234], 1
call fcn.00427dc0
mov eax, dword [ebx]
mov ecx, dword [eax - 0xc]
xor edi, edi
test ecx, ecx
jle 0x4916e2
test edi, edi
jl 0x491767
cmp edi, ecx
jg 0x491767
movzx edx, word [eax + edi*2]
movzx ebx, dx
cmp bx, 0x25
jne 0x491704
lea edx, [edi + 1]
mov dword [ebp - 0x21c], edx
test edx, edx
jl 0x491366
cmp edx, ecx
jge 0x491366
lea edx, [eax + edx*2]
push 0x25
push edx
call fcn.00563d0d
add esp, 8
test eax, eax
je 0x491360
mov ecx, dword [ebp - 0x228]
sub eax, dword [ecx]
sar eax, 1
test eax, eax
jge 0x4913da
mov edx, dword [ebp - 0x21c]
mov eax, dword [ebp - 0x228]
mov eax, dword [eax]
cmp edi, dword [eax - 0xc]
jg 0x491767
movzx ecx, word [eax + edi*2]
mov eax, dword [esi]
mov ebx, dword [eax - 0xc]
mov dword [ebp - 0x224], ecx
mov ecx, 1
sub ecx, dword [eax - 4]
mov eax, dword [eax - 8]
lea edi, [ebx + 1]
sub eax, edi
or ecx, eax
jge 0x4913a8
push edi
mov ecx, esi
call fcn.00427e70
mov edx, dword [ebp - 0x21c]
mov ecx, dword [esi]
mov ax, word [ebp - 0x224]
mov word [ecx + ebx*2], ax
test edi, edi
jl 0x491767
mov eax, dword [esi]
cmp edi, dword [eax - 8]
jg 0x491767
mov dword [eax - 0xc], edi
mov ecx, dword [esi]
xor eax, eax
mov word [ecx + edi*2], ax
mov edi, edx
jmp 0x4916cf
mov edx, dword [ebp - 0x21c]
sub eax, edi
mov dword [ebp - 0x224], eax
dec eax
push eax
push edx
lea eax, [ebp - 0x240]
push eax
call fcn.004468e0
mov ebx, eax
mov dword [ebp - 4], 0
mov ecx, dword [ebx]
mov esi, dword [ecx - 0xc]
mov eax, 1
sub eax, dword [ecx - 4]
mov ecx, dword [ecx - 8]
sub ecx, esi
or eax, ecx
jge 0x49141e
push esi
mov ecx, ebx
call fcn.00427e70
mov eax, dword [ebx]
lea ecx, [esi + 1]
push ecx
push eax
call fcn.00564615
add esp, 8
test esi, esi
jl 0x491767
mov eax, dword [ebx]
cmp esi, dword [eax - 8]
jg 0x491767
mov dword [eax - 0xc], esi
mov edx, dword [ebx]
xor eax, eax
mov word [edx + esi*2], ax
mov ebx, dword [ebx]
sub ebx, 0x10
push ebx
call fcn.00427bb0
add eax, 0x10
add esp, 4
mov dword [ebp - 0x21c], eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x240]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x491488
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [ebp - 0x23c]
lea ecx, [ebp - 0x21c]
push ecx
lea edx, [ebp - 0x264]
push edx
call fcn.004959c0
mov ebx, dword [eax]
mov ecx, dword [esi + 0x18]
mov eax, dword [eax + 4]
mov esi, dword [esi]
mov dword [ebp - 0x22c], eax
mov dword [ebp - 0x250], ecx
test ebx, ebx
je 0x4914bf
cmp ebx, esi
je 0x4914c4
call fcn.0055e4b6
mov edx, dword [ebp - 0x250]
cmp dword [ebp - 0x22c], edx
je 0x49151a
test ebx, ebx
jne 0x491516
call fcn.0055e4b6
mov eax, dword [ebp - 0x22c]
cmp eax, dword [ebx + 0x18]
jne 0x4914eb
call fcn.0055e4b6
mov ecx, dword [ebp - 0x22c]
mov eax, dword [ecx + 0x10]
mov ecx, dword [eax - 0xc]
push ecx
mov ecx, dword [ebp - 0x220]
push eax
call fcn.00427cf0
mov edx, dword [ebp - 0x21c]
mov eax, dword [edx - 0xc]
lea edi, [edi + eax + 2]
jmp 0x4916a0
mov ebx, dword [ebx]
jmp 0x4914db
mov esi, dword [ebp - 0x238]
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x25c]
push ecx
call fcn.004959c0
mov ebx, dword [eax]
mov edx, dword [eax + 4]
mov eax, dword [esi + 0x18]
mov esi, dword [esi]
mov dword [ebp - 0x22c], edx
mov dword [ebp - 0x248], eax
test ebx, ebx
je 0x491551
cmp ebx, esi
je 0x491556
call fcn.0055e4b6
mov ecx, dword [ebp - 0x248]
cmp dword [ebp - 0x22c], ecx
je 0x4915ac
test ebx, ebx
jne 0x4915a8
call fcn.0055e4b6
mov edx, dword [ebp - 0x22c]
cmp edx, dword [ebx + 0x18]
jne 0x49157d
call fcn.0055e4b6
mov eax, dword [ebp - 0x22c]
mov eax, dword [eax + 0x10]
mov ecx, dword [eax - 0xc]
push ecx
mov ecx, dword [ebp - 0x220]
push eax
call fcn.00427cf0
mov ecx, dword [ebp - 0x21c]
mov eax, dword [ecx - 0xc]
lea edi, [edi + eax + 2]
jmp 0x4916a0
mov ebx, dword [ebx]
jmp 0x49156d
mov edx, dword [ebp - 0x224]
mov ecx, dword [ebp - 0x228]
inc edx
push edx
push edi
lea eax, [ebp - 0x244]
push eax
call fcn.004468e0
mov ecx, eax
mov byte [ebp - 4], 3
call fcn.00446840
mov eax, dword [eax]
sub eax, 0x10
push eax
call fcn.00427bb0
lea esi, [eax + 0x10]
add esp, 4
mov dword [ebp - 0x224], esi
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x244]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x49160f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x104
lea ecx, [ebp - 0x218]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, 0x104
ja 0x491663
lea eax, [ebp - 0x218]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x491632
mov ecx, dword [ebp - 0x220]
sub eax, edx
sar eax, 1
push eax
lea edx, [ebp - 0x218]
push edx
call fcn.00427cf0
mov eax, dword [ebp - 0x21c]
mov eax, dword [eax - 0xc]
lea edi, [edi + eax + 2]
jmp 0x491680
mov eax, dword [esi - 0xc]
mov ecx, dword [ebp - 0x220]
push eax
push esi
mov dword [ebp - 0x234], 0
call fcn.00427cf0
add edi, dword [esi - 0xc]
add esi, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4916a0
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4916c9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [ebp - 0x220]
mov eax, dword [ebp - 0x228]
mov eax, dword [eax]
mov ecx, dword [eax - 0xc]
cmp edi, ecx
jl 0x49130e
mov eax, dword [ebp - 0x234]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0055e289
mov esp, ebp
pop ebp
ret
cmp edi, ecx
jg 0x491767
mov eax, dword [esi]
movzx ecx, dx
mov dword [ebp - 0x21c], ecx
mov ecx, dword [eax - 0xc]
mov edx, 1
sub edx, dword [eax - 4]
mov eax, dword [eax - 8]
lea ebx, [ecx + 1]
sub eax, ebx
or edx, eax
mov dword [ebp - 0x224], ecx
jge 0x49173e
push ebx
mov ecx, esi
call fcn.00427e70
mov ecx, dword [ebp - 0x224]
mov edx, dword [esi]
mov ax, word [ebp - 0x21c]
mov word [edx + ecx*2], ax
test ebx, ebx
jl 0x491767
mov eax, dword [esi]
cmp ebx, dword [eax - 8]
jg 0x491767
mov dword [eax - 0xc], ebx
mov ecx, dword [esi]
xor edx, edx
mov word [ecx + ebx*2], dx
inc edi
jmp 0x4916cf
push 0x80070057
call fcn.00425c60
int3