Function at 0x10016640
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x12c
mov eax, dword [0x1003300c]
xor eax, esp
mov dword [esp + 0x128], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov esi, edx
mov dword [esp + 0x14], ebx
push eax
mov dword [esp + 0x14], esi
mov edi, ecx
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
add esp, 4
test eax, eax
jne 0x100166d3
test ebx, ebx
jne 0x10016690
mov eax, dword [edi + 8]
mov dword [eax + 8], ebx
add dword [edi + 8], 0x10
jmp 0x10016731
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x10016693
sub ebx, ecx
mov ecx, dword [edi + 0x10]
mov eax, dword [ecx + 0x44]
cmp eax, dword [ecx + 0x40]
jb 0x100166ae
mov ecx, edi
call fcn.10010350
mov edx, dword [esp + 0x14]
mov ecx, edi
mov esi, dword [edi + 8]
push ebx
call fcn.1001c5c0
mov dword [esi], eax
add esp, 4
mov dword [esi + 8], 4
add dword [edi + 8], 0x10
mov esi, dword [esp + 0x10]
jmp 0x10016731
push 0x1002fed4
push 0x1002fed8
mov edx, eax
mov ecx, edi
call fcn.10005430
push ebx
push 0x1002fedc
mov edx, eax
mov ecx, edi
call fcn.10005430
add esp, 0x10
mov edx, 0xfffffffe
mov ecx, edi
call fcn.10003bf0
lea edx, [eax + 0x10]
mov eax, dword [edi + 8]
cmp edx, eax
jae 0x1001672b
nop
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [edx - 0x10], eax
mov dword [edx - 0xc], ecx
mov eax, dword [edx + 8]
mov dword [edx - 8], eax
add edx, 0x10
mov eax, dword [edi + 8]
cmp edx, eax
jb 0x10016710
add eax, 0xfffffff0
mov dword [edi + 8], eax
push 0x105
lea eax, [esp + 0x2c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x10016803
cmp eax, 0x105
je 0x10016803
lea eax, [esp + 0x28]
push 0x5c
push eax
call dword [sym.imp.VCRUNTIME140.dll_strrchr]
add esp, 8
test eax, eax
je 0x10016803
or edx, 0xffffffff
mov byte [eax], 0
mov ecx, edi
call fcn.10003bf0
cmp dword [eax + 8], 4
je 0x100167ae
mov edx, eax
mov ecx, edi
call fcn.10022960
test eax, eax
jne 0x10016792
xor edx, edx
jmp 0x100167b3
mov ecx, dword [edi + 0x10]
mov eax, dword [ecx + 0x44]
cmp eax, dword [ecx + 0x40]
jb 0x100167a4
mov ecx, edi
call fcn.10010350
or edx, 0xffffffff
mov ecx, edi
call fcn.10003bf0
mov edx, dword [eax]
add edx, 0x10
lea eax, [esp + 0x28]
mov ecx, edi
push eax
push 0x1002fcec
call fcn.10005430
add esp, 8
mov edx, 0xfffffffe
mov ecx, edi
call fcn.10003bf0
mov ecx, dword [edi + 8]
add eax, 0x10
cmp eax, ecx
jae 0x100167fb
nop dword [eax]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [eax - 0x10], ecx
mov dword [eax - 0xc], edx
mov ecx, dword [eax + 8]
mov dword [eax - 8], ecx
add eax, 0x10
mov ecx, dword [edi + 8]
cmp eax, ecx
jb 0x100167e0
lea eax, [ecx - 0x10]
mov dword [edi + 8], eax
jmp 0x10016811
push str.unable_to_get_ModuleFileName
push edi
call fcn.100048e0
add esp, 8
mov edx, 0xfffffffe
mov ecx, edi
call fcn.10003bf0
mov ebx, eax
lea eax, [esi + 1]
mov cl, byte [esi]
inc esi
test cl, cl
jne 0x10016822
mov edx, dword [esp + 0x10]
sub esi, eax
push esi
mov ecx, edi
call fcn.1001c5c0
mov dword [esp + 0x1c], eax
add esp, 4
mov eax, dword [edi + 8]
mov edx, ebx
sub eax, 0x10
mov dword [esp + 0x20], 4
mov ecx, edi
push eax
lea eax, [esp + 0x1c]
push eax
call fcn.10022ca0
add dword [edi + 8], 0xfffffff0
add esp, 8
mov ecx, dword [esp + 0x134]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.10025431
mov esp, ebp
pop ebp
ret