Function at 0x10016870
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x38
mov edx, dword [0x100182a0]
cmp edx, 0xffffffff
je 0x10016930
sub edx, 1
js 0x100168e2
mov eax, dword [0x100278c8]
xor edi, edi
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp - 0x18], eax
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov dword [ebp - 0x1c], eax
nop
lea esi, [esi]
lea ebx, [edx + edi]
mov dword [ebp - 0x10], edx
sar ebx, 1
mov esi, ebx
shl esi, 4
add esi, dword [ebp - 0x14]
lea eax, [esi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x1c]
call eax
mov edx, dword [ebp - 0x10]
test eax, eax
je 0x10016920
js 0x10016900
lea edi, [ebx + 1]
cmp edi, edx
jle 0x100168b0
mov ecx, dword [ebp + 8]
movzx eax, byte [0x100182a4]
cmp byte [ecx], 0
js 0x10016910
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [ebx - 1]
cmp edx, edi
jge 0x100168b0
jmp 0x100168e2
mov byte [ecx], al
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [esi]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.WINEDEBUG
call dword [sym.imp.ucrtbase.dll_getenv]
mov dword [0x100182a0], 0
test eax, eax
je 0x100168e2
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__strdup]
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x10016a4d
mov ebx, eax
jmp 0x100169a6
cmp ecx, ebx
jbe 0x10016a78
cmp eax, 5
jne 0x10016b80
cmp dword [ebx], 0x6d786966
je 0x10016bc8
cmp dword [ebx], 0x63617274
je 0x10016be8
lea esi, [esi]
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x10016a41
mov ebx, dword [ebp - 0x10]
mov dword [esp + 4], 0x2c
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strchr]
mov dword [ebp - 0x10], 0
test eax, eax
je 0x100169cb
lea ecx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x10], ecx
mov dword [esp + 4], 0x1002178a
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strcspn]
lea ecx, [ebx + eax]
movzx edx, byte [ecx]
test dl, dl
jne 0x10016968
movzx edx, byte [ebx]
cmp dl, 0x2d
je 0x10016a60
lea eax, [edx - 0x2b]
and eax, 0xfd
mov byte [ebp - 0x14], al
je 0x10016b70
mov byte [ebp - 0x1c], 0xff
mov byte [ebp - 0x14], 0
test dl, dl
je 0x10016998
mov edi, 0x1002179d
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x10016a80
movzx eax, byte [ebp - 0x14]
not eax
and al, byte [0x100182a4]
or al, byte [ebp - 0x1c]
mov byte [0x100182a4], al
mov eax, dword [ebp - 0x10]
test eax, eax
jne 0x100169a3
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_free]
mov edx, dword [0x100182a0]
jmp 0x10016888
mov byte [ebp - 0x14], 0xff
mov byte [ebp - 0x1c], 0
mov ecx, ebx
movzx edx, byte [ecx + 1]
lea ebx, [ecx + 1]
jmp 0x10016a07
mov ebx, ecx
jmp 0x100169e9
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
mov dword [ebp - 0x34], eax
cmp eax, 0xe
ja 0x10016998
mov eax, dword [0x100182a0]
mov ecx, dword [0x100278c8]
mov dword [ebp - 0x30], eax
sub eax, 1
mov dword [ebp - 0x20], ecx
mov ecx, eax
js 0x10016cd9
mov eax, dword [sym.imp.ucrtbase.dll_strcmp]
mov dword [ebp - 0x24], ebx
xor edi, edi
mov dword [ebp - 0x28], eax
nop
lea esi, [ecx + edi]
mov dword [ebp - 0x18], ecx
sar esi, 1
mov ebx, esi
shl ebx, 4
add ebx, dword [ebp - 0x20]
lea eax, [ebx + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
mov eax, dword [ebp - 0x28]
call eax
mov ecx, dword [ebp - 0x18]
test eax, eax
je 0x10016c01
js 0x10016b60
lea edi, [esi + 1]
cmp ecx, edi
jge 0x10016ac0
mov esi, edi
mov ebx, dword [ebp - 0x24]
mov ecx, edi
shl esi, 4
mov eax, dword [0x100278cc]
cmp dword [ebp - 0x30], eax
jge 0x10016c76
add esi, dword [ebp - 0x20]
cmp edi, dword [ebp - 0x30]
jl 0x10016c4f
mov eax, dword [ebp - 0x34]
lea edx, [esi + 1]
add eax, 1
cmp eax, 4
jae 0x10016c13
test eax, eax
je 0x10016b3e
movzx ecx, byte [ebx]
mov byte [esi + 1], cl
test al, 2
jne 0x10016d37
movzx eax, byte [ebp - 0x14]
not eax
and al, byte [0x100182a4]
or al, byte [ebp - 0x1c]
mov byte [esi], al
mov eax, dword [ebp - 0x30]
add eax, 1
mov dword [0x100182a0], eax
jmp 0x10016998
lea ecx, [esi - 1]
cmp ecx, edi
jge 0x10016ac0
jmp 0x10016af6
mov byte [ebp - 0x1c], 0xff
mov ecx, ebx
jmp 0x10016a6a
cmp eax, 3
jne 0x10016d46
cmp word [ebx], 0x7265
jne 0x10016998
cmp byte [ebx + 2], 0x72
jne 0x10016998
cmp dl, 0x2b
je 0x10016d28
mov byte [ebp - 0x14], 2
sub edx, 0x2b
and edx, 0xfd
mov byte [ebp - 0x1c], dl
je 0x10016a6a
mov byte [ebp - 0x1c], 0
mov ebx, ecx
jmp 0x10016a0b
cmp byte [ebx + 4], 0x65
jne 0x10016985
cmp dl, 0x2b
je 0x10016d19
mov byte [ebp - 0x14], 1
jmp 0x10016bab
cmp byte [ebx + 4], 0x65
jne 0x10016998
cmp dl, 0x2b
je 0x10016d0a
mov byte [ebp - 0x14], 8
jmp 0x10016bab
movzx eax, byte [ebp - 0x14]
not eax
and al, byte [ebx]
or al, byte [ebp - 0x1c]
mov byte [ebx], al
jmp 0x10016998
mov ecx, dword [ebx]
mov dword [esi + 1], ecx
mov ecx, dword [ebx + eax - 4]
mov dword [edx + eax - 4], ecx
lea ecx, [esi + 5]
and ecx, 0xfffffffc
sub edx, ecx
add eax, edx
sub ebx, edx
and eax, 0xfffffffc
cmp eax, 4
jb 0x10016b3e
and eax, 0xfffffffc
xor edx, edx
mov edi, dword [ebx + edx]
mov dword [ecx + edx], edi
add edx, 4
cmp edx, eax
jb 0x10016c3d
jmp 0x10016b3e
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], esi
sub eax, edi
shl eax, 4
mov dword [esp + 8], eax
lea eax, [ecx + 1]
shl eax, 4
add eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_memmove]
jmp 0x10016b1a
add eax, eax
mov edx, 0x10
mov dword [ebp - 0x18], ecx
cmp eax, 0x10
cmovl eax, edx
mov dword [0x100278cc], eax
shl eax, 4
mov edx, eax
mov eax, dword fs:[0x18]
cmp dword [ebp - 0x20], 0
je 0x10016ce4
mov ecx, dword [ebp - 0x20]
mov dword [esp + 0xc], edx
mov dword [esp + 4], 0
mov dword [esp + 8], ecx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x20], eax
sub esp, 0x10
mov dword [0x100278c8], eax
mov eax, dword [0x100182a0]
mov dword [ebp - 0x30], eax
jmp 0x10016b0e
xor esi, esi
xor ecx, ecx
xor edi, edi
jmp 0x10016b00
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x20], eax
sub esp, 0xc
jmp 0x10016cc7
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 8
jmp 0x10016a68
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 1
jmp 0x10016a68
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 2
jmp 0x10016a68
movzx ecx, word [ebx + eax - 2]
mov word [edx + eax - 2], cx
jmp 0x10016b3e
cmp eax, 4
jne 0x10016998
cmp dword [ebx], 0x6e726177
jne 0x10016998
cmp dl, 0x2b
je 0x10016d69
mov byte [ebp - 0x14], 4
jmp 0x10016bab
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 4
jmp 0x10016a68