Function at 0x40fe57
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov ebx, dword [ebp + 8]
push esi
test ebx, ebx
jne 0x40fe7b
call fcn.0040b7c8
mov dword [eax], 0x16
or eax, 0xffffffff
jmp 0x4100c7
push edi
push 0x3d
push ebx
mov edi, ebx
call fcn.0041875b
mov dword [ebp - 0xc], eax
pop ecx
pop ecx
test eax, eax
je 0x4100b1
cmp eax, ebx
je 0x4100b1
movzx ecx, word [eax + 2]
mov eax, ecx
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], eax
call fcn.0041025e
mov esi, dword [0x421068]
xor ebx, ebx
test esi, esi
jne 0x40ff4f
mov eax, dword [0x421064]
cmp dword [ebp + 0xc], ebx
je 0x40fef3
test eax, eax
je 0x40fef3
call fcn.0040a736
test eax, eax
jne 0x40fee6
call fcn.0040b7c8
mov dword [eax], 0x16
or ebx, 0xffffffff
jmp 0x410096
call fcn.0041025e
mov esi, dword [0x421068]
jmp 0x40ff4b
cmp word [ebp - 8], bx
je 0x410096
test eax, eax
jne 0x40ff2a
push 4
push 1
call fcn.0040c5bd
push ebx
mov dword [0x421064], eax
call fcn.0040b7db
add esp, 0xc
cmp dword [0x421064], ebx
je 0x40fede
mov esi, dword [0x421068]
test esi, esi
jne 0x40ff4f
push 4
push 1
call fcn.0040c5bd
push ebx
mov dword [0x421068], eax
call fcn.0040b7db
mov esi, dword [0x421068]
add esp, 0xc
test esi, esi
je 0x40fede
test esi, esi
je 0x40fede
mov ecx, dword [ebp - 0xc]
mov eax, edi
sub ecx, eax
sar ecx, 1
push ecx
push eax
mov dword [ebp - 0xc], ecx
call fcn.004102cd
mov dword [ebp - 4], eax
pop ecx
pop ecx
test eax, eax
js 0x40ffb7
cmp dword [esi], ebx
je 0x40ffb7
push dword [esi + eax*4]
call fcn.0040b7db
pop ecx
mov ecx, dword [ebp - 4]
cmp word [ebp - 8], bx
je 0x40ff96
mov eax, dword [ebp + 8]
mov edi, ebx
mov dword [esi + ecx*4], eax
jmp 0x41000e
mov eax, dword [esi + ecx*4 + 4]
mov dword [esi + ecx*4], eax
inc ecx
cmp dword [esi + ecx*4], ebx
jne 0x40ff8e
push 4
push ecx
push esi
call fcn.0041033b
push ebx
mov esi, eax
call fcn.0040b7db
add esp, 0x10
mov eax, edi
test esi, esi
je 0x41000e
jmp 0x410008
cmp word [ebp - 8], bx
je 0x410096
neg eax
mov dword [ebp - 4], eax
lea ecx, [eax + 2]
cmp ecx, eax
jb 0x40fede
cmp ecx, 0x3fffffff
jae 0x40fede
push 4
push ecx
push esi
call fcn.0041033b
push ebx
mov esi, eax
call fcn.0040b7db
add esp, 0x10
test esi, esi
je 0x40fede
mov ecx, dword [ebp - 4]
mov edi, ebx
mov eax, dword [ebp + 8]
mov dword [esi + ecx*4], eax
mov dword [esi + ecx*4 + 4], ebx
mov dword [0x421068], esi
cmp dword [ebp + 0xc], ebx
je 0x4100a7
mov ecx, eax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x41001c
sub ecx, edx
sar ecx, 1
push 2
lea eax, [ecx + 2]
push eax
mov dword [ebp - 8], eax
call fcn.0040c5bd
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x410049
push ebx
call fcn.0040b7db
jmp 0x410095
push dword [ebp + 8]
push dword [ebp - 8]
push esi
call fcn.0040f9f4
add esp, 0xc
test eax, eax
jne 0x4100cb
mov eax, dword [ebp - 0xc]
inc eax
lea ecx, [esi + eax*2]
xor eax, eax
mov word [ecx - 2], ax
mov eax, dword [ebp - 0x10]
movzx eax, ax
neg eax
sbb eax, eax
and eax, ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x4100a0
call fcn.0040b7c8
push esi
mov dword [eax], 0x2a
call fcn.0040b7db
or ebx, 0xffffffff
pop ecx
push edi
call fcn.0040b7db
mov eax, ebx
jmp 0x4100c5
push esi
call fcn.0040b7db
pop ecx
push edi
call fcn.0040b7db
xor eax, eax
jmp 0x4100c5
call fcn.0040b7c8
push ebx
mov dword [eax], 0x16
call fcn.0040b7db
or eax, 0xffffffff
pop ecx
pop edi
pop esi
pop ebx
leave
ret
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.004057d9
int3