Function at 0x4107f0
Capabilities:
Query environment variable

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov eax, dword [esp + 0x50]
mov esi, dword [eax]
movzx eax, byte [esi]
test al, al
je 0x41096f
xor ebp, ebp
jmp 0x41081f
add ebp, 1
movzx eax, byte [esi + ebp]
test al, al
je 0x41096f
cmp al, 0x24
jne 0x410810
lea eax, [ebp + 1]
add esi, eax
mov dword [esp + 0x24], eax
cmp byte [esi], 0x24
je 0x410a32
xor ebx, ebx
mov esi, esi
lea edi, [edi]
movzx edx, byte [esi + ebx]
mov eax, edx
and eax, 0xffffffdf
sub eax, 0x41
cmp al, 0x19
jbe 0x410980
lea eax, [edx - 0x30]
cmp al, 9
jbe 0x410980
cmp dl, 0x5f
je 0x410980
lea eax, [ebx + 1]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [esp + 8], ebx
mov edi, eax
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [esp + 0x1c], eax
call sub.msvcrt.dll_memcpy
mov byte [edi + ebx], 0
mov ebx, dword [esp + 0x1c]
mov dword [esp], ebx
call sub.msvcrt.dll_getenv
mov edi, eax
mov eax, dword [esp + 0x50]
mov esi, dword [eax]
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov dword [esp + 0x20], eax
mov edx, dword [ebx]
add ebx, 4
lea eax, [edx - 0x1010101]
not edx
and eax, edx
and eax, 0x80808080
je 0x4108ad
mov edx, eax
shr edx, 0x10
test eax, 0x8080
cmove eax, edx
lea edx, [ebx + 2]
mov ecx, eax
cmove ebx, edx
add cl, al
sbb ebx, 3
sub ebx, dword [esp + 0x1c]
add ebx, 1
test edi, edi
je 0x410a2b
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov edx, eax
cmp ebx, edx
jl 0x410990
add esi, ebp
cmp ebx, edx
jle 0x41092f
mov eax, 1
mov dword [esp], esi
sub eax, ebp
add eax, dword [esp + 0x20]
mov dword [esp + 0x20], edx
sub eax, ebx
sub ebx, edx
add eax, edx
add ebx, esi
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
call sub.msvcrt.dll_memmove
mov edx, dword [esp + 0x20]
test edi, edi
je 0x410a10
mov dword [esp + 8], edx
mov dword [esp], esi
mov dword [esp + 4], edi
call sub.msvcrt.dll_memcpy
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], edi
call sub.msvcrt.dll_strlen
add ebp, eax
mov eax, dword [esp + 0x50]
mov esi, dword [eax]
movzx eax, byte [esi + ebp]
test al, al
jne 0x41081f
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
add ebx, 1
jmp 0x410840
mov eax, dword [esp + 0x20]
mov dword [esp + 0x2c], edx
sub eax, ebx
mov dword [esp + 0x28], eax
lea eax, [edx + eax + 1]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov ecx, eax
mov eax, dword [esp + 0x20]
mov dword [esp + 4], esi
mov dword [esp], ecx
mov dword [esp + 0x20], ecx
add eax, 1
mov dword [esp + 8], eax
call sub.msvcrt.dll_memcpy
mov dword [esp], esi
call sub.msvcrt.dll_free
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x50]
mov eax, 1
sub eax, ebp
add eax, dword [esp + 0x28]
mov dword [edx], ecx
mov edx, dword [esp + 0x2c]
lea esi, [ecx + ebp]
mov dword [esp + 8], eax
add ebx, esi
lea eax, [esi + edx]
mov dword [esp + 4], ebx
mov dword [esp + 0x20], edx
mov dword [esp], eax
call sub.msvcrt.dll_memmove
test edi, edi
mov edx, dword [esp + 0x20]
jne 0x410937
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [esp + 0x50]
mov ebp, dword [esp + 0x24]
mov esi, dword [eax]
jmp 0x410813
xor edx, edx
jmp 0x4108f6
mov dword [esp], 2
call sub.msvcrt.dll_malloc
mov dword [esp + 0x1c], eax
mov byte [eax], 0x24
mov byte [eax + 1], 0
jmp 0x41088d