Function at 0x401560
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x38
mov edx, dword [0x403010]
cmp edx, 0xffffffff
je 0x401620
sub edx, 1
js 0x4015d2
mov eax, dword [0x407088]
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 0x401610
js 0x4015f0
lea edi, [ebx + 1]
cmp edi, edx
jle 0x4015a0
mov ecx, dword [ebp + 8]
movzx eax, byte [0x403014]
cmp byte [ecx], 0
js 0x401600
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [ebx - 1]
cmp edx, edi
jge 0x4015a0
jmp 0x4015d2
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 [0x403010], 0
test eax, eax
je 0x4015d2
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__strdup]
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x40173d
mov ebx, eax
jmp 0x401696
cmp ecx, ebx
jbe 0x401768
cmp eax, 5
jne 0x401870
cmp dword [ebx], 0x6d786966
je 0x4018b8
cmp dword [ebx], 0x63617274
je 0x4018d8
lea esi, [esi]
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x401731
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 0x4016bb
lea ecx, [eax + 1]
mov byte [eax], 0
mov dword [ebp - 0x10], ecx
mov dword [esp + 4], 0x405046
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strcspn]
lea ecx, [ebx + eax]
movzx edx, byte [ecx]
test dl, dl
jne 0x401658
movzx edx, byte [ebx]
cmp dl, 0x2d
je 0x401750
lea eax, [edx - 0x2b]
and eax, 0xfd
mov byte [ebp - 0x14], al
je 0x401860
mov byte [ebp - 0x1c], 0xff
mov byte [ebp - 0x14], 0
test dl, dl
je 0x401688
mov edi, 0x405059
mov ecx, 4
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
jne 0x401770
movzx eax, byte [ebp - 0x14]
not eax
and al, byte [0x403014]
or al, byte [ebp - 0x1c]
mov byte [0x403014], al
mov eax, dword [ebp - 0x10]
test eax, eax
jne 0x401693
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_free]
mov edx, dword [0x403010]
jmp 0x401578
mov byte [ebp - 0x14], 0xff
mov byte [ebp - 0x1c], 0
mov ecx, ebx
movzx edx, byte [ecx + 1]
lea ebx, [ecx + 1]
jmp 0x4016f7
mov ebx, ecx
jmp 0x4016d9
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
mov dword [ebp - 0x34], eax
cmp eax, 0xe
ja 0x401688
mov eax, dword [0x403010]
mov ecx, dword [0x407088]
mov dword [ebp - 0x30], eax
sub eax, 1
mov dword [ebp - 0x20], ecx
mov ecx, eax
js 0x4019c9
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 0x4018f1
js 0x401850
lea edi, [esi + 1]
cmp ecx, edi
jge 0x4017b0
mov esi, edi
mov ebx, dword [ebp - 0x24]
mov ecx, edi
shl esi, 4
mov eax, dword [0x40708c]
cmp dword [ebp - 0x30], eax
jge 0x401966
add esi, dword [ebp - 0x20]
cmp edi, dword [ebp - 0x30]
jl 0x40193f
mov eax, dword [ebp - 0x34]
lea edx, [esi + 1]
add eax, 1
cmp eax, 4
jae 0x401903
test eax, eax
je 0x40182e
movzx ecx, byte [ebx]
mov byte [esi + 1], cl
test al, 2
jne 0x401a27
movzx eax, byte [ebp - 0x14]
not eax
and al, byte [0x403014]
or al, byte [ebp - 0x1c]
mov byte [esi], al
mov eax, dword [ebp - 0x30]
add eax, 1
mov dword [0x403010], eax
jmp 0x401688
lea ecx, [esi - 1]
cmp ecx, edi
jge 0x4017b0
jmp 0x4017e6
mov byte [ebp - 0x1c], 0xff
mov ecx, ebx
jmp 0x40175a
cmp eax, 3
jne 0x401a36
cmp word [ebx], 0x7265
jne 0x401688
cmp byte [ebx + 2], 0x72
jne 0x401688
cmp dl, 0x2b
je 0x401a18
mov byte [ebp - 0x14], 2
sub edx, 0x2b
and edx, 0xfd
mov byte [ebp - 0x1c], dl
je 0x40175a
mov byte [ebp - 0x1c], 0
mov ebx, ecx
jmp 0x4016fb
cmp byte [ebx + 4], 0x65
jne 0x401675
cmp dl, 0x2b
je 0x401a09
mov byte [ebp - 0x14], 1
jmp 0x40189b
cmp byte [ebx + 4], 0x65
jne 0x401688
cmp dl, 0x2b
je 0x4019fa
mov byte [ebp - 0x14], 8
jmp 0x40189b
movzx eax, byte [ebp - 0x14]
not eax
and al, byte [ebx]
or al, byte [ebp - 0x1c]
mov byte [ebx], al
jmp 0x401688
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 0x40182e
and eax, 0xfffffffc
xor edx, edx
mov edi, dword [ebx + edx]
mov dword [ecx + edx], edi
add edx, 4
cmp edx, eax
jb 0x40192d
jmp 0x40182e
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 0x40180a
add eax, eax
mov edx, 0x10
mov dword [ebp - 0x18], ecx
cmp eax, 0x10
cmovl eax, edx
mov dword [0x40708c], eax
shl eax, 4
mov edx, eax
mov eax, dword fs:[0x18]
cmp dword [ebp - 0x20], 0
je 0x4019d4
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 [0x407088], eax
mov eax, dword [0x403010]
mov dword [ebp - 0x30], eax
jmp 0x4017fe
xor esi, esi
xor ecx, ecx
xor edi, edi
jmp 0x4017f0
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 0x4019b7
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 8
jmp 0x401758
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 1
jmp 0x401758
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 2
jmp 0x401758
movzx ecx, word [ebx + eax - 2]
mov word [edx + eax - 2], cx
jmp 0x40182e
cmp eax, 4
jne 0x401688
cmp dword [ebx], 0x6e726177
jne 0x401688
cmp dl, 0x2b
je 0x401a59
mov byte [ebp - 0x14], 4
jmp 0x40189b
mov byte [ebp - 0x14], 0
mov ebx, ecx
mov byte [ebp - 0x1c], 4
jmp 0x401758