Function at 0x401160
Capabilities:
Query environment variable
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [ebp - 0x1c], eax
push 0x41607f
mov eax, dword [ebp - 0x1c]
push eax
call fcn.004010b0
add esp, 8
push 9
lea ecx, [ebp - 0x18]
push ecx
push 0x416078
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x401249
mov dword [ebp - 4], 0
lea edx, [ebp - 0x18]
mov dword [ebp - 0x20], edx
jmp 0x4011b1
mov eax, dword [ebp - 0x20]
add eax, 1
mov dword [ebp - 0x20], eax
lea ecx, [ebp - 0x11]
cmp dword [ebp - 0x20], ecx
ja 0x4011f2
mov edx, dword [ebp - 4]
shl edx, 4
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x20]
movsx ecx, byte [eax]
cmp ecx, 0x39
jg 0x4011db
mov edx, dword [ebp - 0x20]
movsx eax, byte [edx]
sub eax, 0x30
mov dword [ebp - 0x38], eax
jmp 0x4011e7
mov ecx, dword [ebp - 0x20]
movsx edx, byte [ecx]
sub edx, 0x57
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 4]
or eax, dword [ebp - 0x38]
mov dword [ebp - 4], eax
jmp 0x4011a8
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
mov edx, 1
test edx, edx
je 0x401225
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 4]
cmp ecx, dword [ebp + 8]
jne 0x401211
jmp 0x401411
mov edx, dword [ebp - 8]
cmp dword [edx], 0
jne 0x40121b
jmp 0x401225
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
mov dword [ebp - 8], ecx
jmp 0x4011f8
push 0x1c
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edx, dword [ebp - 8]
mov dword [edx], eax
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
mov dword [0x4177e4], ecx
mov edx, dword [ebp - 8]
mov eax, dword [edx]
mov dword [ebp - 8], eax
jmp 0x40127e
push 0x1c
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 8]
mov dword [0x4177e4], ecx
lea edx, [ebp - 0x18]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.004010b0
add esp, 8
lea ecx, [ebp - 0x18]
push ecx
push 0x416078
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
movsx edx, byte [0x416a74]
test edx, edx
jne 0x40129f
push 1
lea eax, [ebp - 9]
push eax
push str.ADA_FATAL_HW_EXC
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov byte [0x416a74], al
cmp dword [0x417270], 0
jne 0x4012c7
push 9
lea ecx, [ebp - 0x18]
push ecx
push str.ADA_HEAP_PROTECT
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x4012c7
mov dword [0x417270], 1
cmp dword [0x417274], 0
jne 0x4012ef
push 9
lea edx, [ebp - 0x18]
push edx
push str.ADA_HEAP_TRACE
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x4012ef
mov dword [0x417274], 1
cmp dword [0x416890], 0
jne 0x40134d
push 9
lea eax, [ebp - 0x18]
push eax
push str.ADA_EM_HISTORY
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x40134d
push str.none
lea ecx, [ebp - 0x18]
push ecx
call fcn.00401420
add esp, 8
test eax, eax
jne 0x40132e
mov dword [0x416890], 1
jmp 0x40134d
push 0x4160d8
lea edx, [ebp - 0x18]
push edx
call fcn.00401420
add esp, 8
test eax, eax
jne 0x40134d
mov dword [0x416890], 2
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 8]
mov dword [eax + 4], ecx
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0xc]
mov dword [edx + 8], eax
mov ecx, dword [ebp + 0x10]
add ecx, 4
mov edx, dword [ebp - 8]
mov dword [edx + 0xc], ecx
mov eax, dword [ebp + 0x10]
add eax, 4
mov ecx, dword [ebp + 0x14]
sub ecx, eax
mov eax, ecx
cdq
mov ecx, 0xc
idiv ecx
sub eax, 1
mov edx, dword [ebp - 8]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 8]
mov dword [eax + 0x14], 0
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x18]
mov dword [ecx + 0x18], edx
mov eax, dword [ebp - 8]
mov dword [eax], 0
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 0xc]
mov dword [ebp - 0x24], edx
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x10]
add ecx, 1
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
jmp 0x4013d3
mov edx, dword [ebp - 0x28]
add edx, 1
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x34]
jge 0x401411
mov ecx, dword [ebp - 0x28]
imul ecx, ecx, 0xc
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + ecx]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x30]
cmp ecx, dword [ebp - 0x2c]
jae 0x401409
mov edx, dword [ebp - 0x34]
sub edx, 1
push edx
push 0
mov eax, dword [ebp - 0x24]
push eax
call fcn.004014d0
add esp, 0xc
jmp 0x401411
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x2c], ecx
jmp 0x4013ca
mov esp, ebp
pop ebp
ret