Function at 0x459160
Capabilities:
Query environment variable

Disassembly:
push ebx
push ebp
mov ebp, dword [esp + 0x10]
shl ebp, 4
add ebp, dword [ecx + 8]
mov ecx, dword [esp + 0x14]
push esi
push edi
test ecx, ecx
je 0x45918a
mov esi, dword [esp + 0x14]
push esi
call fcn.00475d50
inc eax
add eax, esi
pop edi
pop esi
pop ebp
pop ebx
ret 0xc
mov edi, dword [ebp + 4]
mov ebp, dword [ebp + 8]
mov dword [esp + 0x1c], ebp
test ebp, ebp
je 0x45937c
mov eax, dword [ebp]
test eax, eax
je 0x45937c
mov esi, dword [esp + 0x14]
jmp 0x4591b0
mov edx, eax
xor ebx, ebx
sub edx, edi
xor ecx, ecx
cmp edi, eax
cmova edx, ebx
test edx, edx
je 0x4591cc
mov al, byte [edi]
inc ecx
mov byte [esi], al
inc edi
inc esi
cmp ecx, edx
jb 0x4591c1
mov ebp, dword [ebp + 4]
mov ebx, esi
movzx eax, byte [ebp + 0x17]
cmp eax, 3
ja case.default.0x4591de
jmp dword [eax*4 + 0x4593a0]
mov ecx, ebp
call fcn.004023f0
cmp dword [0x4af994], 0
jne 0x4592a4
cmp dword [ebp + 0xc], 0
jne 0x4592a4
cmp dword [0x4b2498], ebp
jne 0x45920f
test esi, esi
jne 0x45926a
push 0
lea eax, [esp + 0x18]
push eax
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x459266
mov dword [0x4b2498], 0
test esi, esi
je 0x45925e
mov eax, dword [0x4af9a4]
test eax, eax
je 0x45924f
push 0
push dword [ebp + 0x18]
mov ecx, 0x4b09a0
push str.An_environment_variable_is_being_accessed__see_NoEnv.
push eax
call fcn.0042e850
mov ecx, dword [ebp + 0x18]
mov edx, esi
call fcn.00473f10
jmp 0x45935a
lea ecx, [eax - 1]
jmp 0x45935c
test esi, esi
je 0x459297
cmp byte [ebp + 0x17], 0
jne 0x459275
mov eax, dword [ebp + 0xc]
jmp 0x459277
mov eax, ebp
test byte [eax + 0x15], 4
je 0x459283
push ebp
call fcn.0042e980
mov byte [esi], 0
xor ecx, ecx
mov dword [0x4b2498], 0
jmp 0x45935c
mov dword [0x4b2498], ebp
xor ecx, ecx
jmp 0x45935c
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x18], ecx
test esi, esi
je 0x45935c
test ecx, ecx
jne 0x4592d5
cmp byte [ebp + 0x17], cl
mov eax, ebp
cmove eax, ecx
test byte [eax + 0x15], 4
je 0x4592cb
push ebp
call fcn.0042e980
mov byte [esi], 0
xor ecx, ecx
jmp 0x45935c
mov eax, dword [ebp + 8]
cmp esi, eax
je 0x45935c
cmp ecx, 0x186a0
jae 0x459305
mov cl, byte [eax]
test cl, cl
je 0x4592fc
mov edi, edi
mov byte [ebx], cl
lea eax, [eax + 1]
mov cl, byte [eax]
inc ebx
test cl, cl
jne 0x4592f0
mov ecx, dword [esp + 0x18]
mov byte [ebx], 0
jmp 0x45935c
push ecx
push eax
push esi
call fcn.0048e4b0
mov ecx, dword [esp + 0x24]
add esp, 0xc
mov byte [ecx + esi], 0
jmp 0x45935c
mov ecx, dword [ebp + 0xc]
push esi
call fcn.00475d50
jmp 0x45935a
push esi
mov ecx, 0x4b1010
call fcn.00405720
mov ecx, eax
xor eax, eax
cmp ecx, 0xffffffff
cmove ecx, eax
test esi, esi
je 0x45935c
mov byte [ecx + esi], al
jmp 0x45935c
test esi, esi
je 0x4592ce
mov byte [esi], 0
xor ecx, ecx
jmp 0x45935c
push dword [ebp + 0x18]
mov eax, dword [ebp + 0x10]
push esi
call eax
add esp, 8
mov ecx, eax
mov ebp, dword [esp + 0x1c]
add esi, ecx
movzx eax, word [ebp + 0xa]
add ebp, 0xc
add edi, eax
mov dword [esp + 0x1c], ebp
mov eax, dword [ebp]
test eax, eax
jne 0x4591b0
jmp 0x459380
mov esi, dword [esp + 0x14]
mov al, byte [edi]
test al, al
je 0x459392
sub edi, esi
mov byte [esi], al
inc esi
mov al, byte [edi + esi]
test al, al
jne 0x459388
pop edi
mov byte [esi], 0
lea eax, [esi + 1]
pop esi
pop ebp
pop ebx
ret 0xc