Function at 0x5d8320
Capabilities:
Query environment variable

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x81d16b
push eax
mov dword fs:[0], esp
sub esp, 0x114
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov eax, dword [esi]
call dword [eax + 8]
test al, al
jne 0x5d8647
mov eax, dword [esi + 0x38]
test eax, eax
je 0x5d836c
push 0x146
push str.C:ReposBvSrcNoCrtLibdatavect.h
push 0x8fcf74
call fcn.006d2b10
add esp, 0xc
mov eax, dword [esi + 0x40]
test al, 1
je 0x5d8374
dec eax
test eax, eax
jne 0x5d83dc
mov esi, dword [esp + 0x134]
or edi, 0xffffffff
mov ecx, esi
call fcn.00404e60
mov eax, dword [esi + 8]
cmp eax, 0xffffffff
jae 0x5d839b
mov edi, eax
test edi, edi
jbe 0x5d8647
mov ecx, esi
call fcn.00404cb0
mov eax, dword [esi + 4]
mov ecx, dword [esi + 8]
sub ecx, edi
lea edx, [eax + edi*2]
push ecx
push edx
push eax
call fcn.00403320
mov ebp, dword [esi + 8]
add esp, 0xc
sub ebp, edi
mov ecx, esi
push 0
push ebp
call fcn.00404d30
test al, al
je 0x5d8647
push ebp
mov ecx, esi
call fcn.00404c90
jmp 0x5d8647
shr eax, 1
mov ebx, eax
mov eax, dword [esi + 0x38]
test eax, eax
je 0x5d83fe
push 0x141
push str.C:ReposBvSrcNoCrtLibdatavect.h
push 0x8fcf74
call fcn.006d2b10
add esp, 0xc
mov edi, dword [esi + 0x3c]
mov dword [esp + 0x20], edi
cmp word [edi + ebx*2 - 2], 0
je 0x5d8468
lea eax, [esi + 4]
mov dword [esi + 0x18], 0xd
test eax, eax
je 0x5d8420
lea ebx, [eax + 4]
jmp 0x5d8422
xor ebx, ebx
push str.RegQueryValueExW__
call fcn.007ac4d2
add esp, 4
mov ecx, ebx
push eax
push str.RegQueryValueExW__
call fcn.00403980
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
test al, al
je 0x5d8468
push esi
lea ecx, [esp + 0x38]
call fcn.00537590
lea ecx, [esp + 0x34]
push 0x8c1574
push ecx
mov dword [esp + 0x3c], 0x869e24
call fcn.007ac5c6
cmp dword [esi + 0x4c], 2
jne 0x5d8630
mov al, byte [esp + 0x138]
test al, al
je 0x5d8630
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x18], ebp
jne 0x5d84f3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x18], eax
lea eax, [esi + 4]
test eax, eax
je 0x5d84ab
lea edi, [eax + 4]
jmp 0x5d84ad
xor edi, edi
push str.ExpandEnvironmentStringsW__
call fcn.007ac4d2
add esp, 4
mov ecx, edi
push eax
push str.ExpandEnvironmentStringsW__
call fcn.00403980
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 8]
test al, al
je 0x5d84f3
push esi
lea ecx, [esp + 0x38]
call fcn.00537590
lea eax, [esp + 0x34]
push 0x8c1574
push eax
mov dword [esp + 0x3c], 0x869e24
call fcn.007ac5c6
mov cl, byte [esp + 0x13]
add ebp, 2
test ebp, ebp
mov dword [esp + 0x1c], 0
mov byte [esp + 0x24], cl
mov eax, ebp
jge 0x5d850e
xor eax, eax
lea edx, [eax + eax]
push edx
call fcn.007d7320
add esp, 4
mov edi, eax
test ebp, ebp
mov dword [esp + 0x28], edi
mov ebx, edi
jbe 0x5d8546
mov dword [esp + 0x14], ebp
lea eax, [esp + 0x1c]
push eax
push ebx
call fcn.00577050
mov eax, dword [esp + 0x1c]
add esp, 8
add ebx, 2
dec eax
mov dword [esp + 0x14], eax
jne 0x5d852a
lea ebp, [edi + ebp*2]
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
inc ecx
mov dword [esp + 0x12c], 0
push ecx
push edi
push edx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x5d85d8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x18], eax
lea eax, [esi + 4]
test eax, eax
je 0x5d8587
lea ebx, [eax + 4]
jmp 0x5d8589
xor ebx, ebx
push str.ExpandEnvironmentStringsW__
call fcn.007ac4d2
add esp, 4
mov ecx, ebx
push eax
push str.ExpandEnvironmentStringsW__
call fcn.00403980
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
test al, al
je 0x5d85d8
push esi
lea ecx, [esp + 0xb0]
call fcn.00537590
lea ecx, [esp + 0xac]
push 0x8c1574
push ecx
mov dword [esp + 0xb4], 0x869e24
call fcn.007ac5c6
test edi, edi
jne 0x5d85e0
xor ebp, ebp
jmp 0x5d85e4
sub ebp, edi
sar ebp, 1
push edi
mov word [edi + ebp*2 - 2], 0
call fcn.007ac4d2
mov ebp, dword [esp + 0x138]
add esp, 4
mov esi, eax
mov ecx, ebp
push 1
push esi
call fcn.00404d30
test al, al
je 0x5d8625
mov edx, dword [ebp + 4]
push esi
push edi
push edx
call fcn.004069b0
mov eax, dword [ebp + 4]
mov dword [ebp + 8], esi
add esp, 0xc
mov word [eax + esi*2], 0
push edi
call fcn.007d7349
add esp, 4
jmp 0x5d8647
push edi
call fcn.007ac4d2
mov ecx, dword [esp + 0x138]
add esp, 4
push eax
push edi
call fcn.00403980
mov ecx, dword [esp + 0x124]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x120
ret 8