Function at 0x65ce36
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 4], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 8], 0
mov byte [ebp - 0x10], 0
xor eax, eax
mov byte [ebp - 0xf], al
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
cmp dword [ebp + 0xc], 0
je 0x65ce9c
mov ecx, 0x76f680
test ecx, ecx
je 0x65ce9c
push 0x76f690
mov edx, dword [ebp + 0xc]
push edx
call sub.MSVCR80.dll_strcmp
add esp, 8
test eax, eax
jne 0x65ce9c
mov dword [ebp - 0xc], 1
jmp 0x65cf02
mov eax, dword [ebp + 0xc]
push eax
call sub.MSVCR80.dll_strlen
add esp, 4
cmp eax, 0xe
jb 0x65cefb
mov ecx, dword [ebp + 0xc]
push ecx
call sub.MSVCR80.dll_strlen
add esp, 4
mov edx, dword [ebp + 0xc]
lea eax, [edx + eax - 0xd]
test eax, eax
je 0x65cefb
mov ecx, 0x76f6a0
test ecx, ecx
je 0x65cefb
push 0x76f6b0
mov edx, dword [ebp + 0xc]
push edx
call sub.MSVCR80.dll_strlen
add esp, 4
mov ecx, dword [ebp + 0xc]
lea edx, [ecx + eax - 0xd]
push edx
call sub.MSVCR80.dll_strcmp
add esp, 8
test eax, eax
jne 0x65cefb
mov dword [ebp - 0xc], 2
jmp 0x65cf02
mov dword [ebp - 0xc], 3
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 1
je 0x65cfd3
cmp dword [ebp - 0x20], 2
je 0x65d146
cmp dword [ebp - 0x20], 3
je 0x65cf27
jmp 0x65d2d9
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.0065bd05
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x65cf48
mov eax, dword [ebp - 4]
jmp 0x65d2db
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.MSVCR80.dll_getenv]
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x65cf66
mov eax, dword [ebp - 4]
jmp 0x65d2db
push 0x76f6c0
mov ecx, dword [ebp + 0xc]
push ecx
call sub.MSVCR80.dll_strcmp
add esp, 8
test eax, eax
jne 0x65cfb3
push 0
push 0
lea edx, [ebp - 4]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0065c2f2
add esp, 0x14
cmp dword [ebp - 4], 0
jne 0x65cfb1
push 1
push 0
lea edx, [ebp - 4]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0065c2f2
add esp, 0x14
jmp 0x65cfcb
push 0
push 0
lea edx, [ebp - 4]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0065c2f2
add esp, 0x14
mov eax, dword [ebp - 4]
jmp 0x65d2db
mov edx, dword [ebp + 8]
cmp dword [edx + 0x184], 0
je 0x65cffe
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x184]
push ecx
call fcn.006511ab
add esp, 4
mov edx, dword [ebp + 8]
mov dword [edx + 0x184], 0
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.MSVCR80.dll_getenv]
add esp, 4
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x65d028
mov ecx, dword [ebp - 0x1c]
push ecx
call sub.MSVCR80.dll_strlen
add esp, 4
add eax, 1
mov dword [ebp - 0x14], eax
jmp 0x65d036
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 0x79f4f0
push 0
push 0
lea edx, [ebp - 8]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0065c2f2
add esp, 0x14
cmp dword [ebp - 8], 0
je 0x65d068
mov edx, dword [ebp - 8]
push edx
call sub.MSVCR80.dll_strlen
add esp, 4
add eax, 1
mov dword [ebp - 0x18], eax
jmp 0x65d076
mov dword [ebp - 0x18], 0
mov dword [ebp - 8], 0x79f4f4
cmp dword [ebp - 0x18], 0
jne 0x65d089
cmp dword [ebp - 0x14], 0
jne 0x65d089
xor eax, eax
jmp 0x65d2db
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
lea edx, [ecx + eax + 1]
push edx
push 1
call dword [sym.imp.MSVCR80.dll_calloc]
add esp, 8
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x184], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0x184], 0
jne 0x65d0bb
xor eax, eax
jmp 0x65d2db
push 0x3b
push 0x76f6cc
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0xc
cmp dword [ebp - 8], 0
je 0x65d0dd
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x24], ecx
jmp 0x65d0e4
mov dword [ebp - 0x24], 0x79f4f8
cmp dword [ebp - 8], 0
je 0x65d0f8
cmp dword [ebp - 0x1c], 0
je 0x65d0f8
lea edx, [ebp - 0x10]
mov dword [ebp - 0x28], edx
jmp 0x65d0ff
mov dword [ebp - 0x28], 0x79f4fc
cmp dword [ebp - 0x1c], 0
je 0x65d10d
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x2c], eax
jmp 0x65d114
mov dword [ebp - 0x2c], 0x79f500
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [ebp - 0x28]
push edx
mov eax, dword [ebp - 0x2c]
push eax
push 0x76f6d0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x184]
push edx
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0x14
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x184]
jmp 0x65d2db
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.006623e0
add esp, 4
mov edx, dword [ebp + 8]
cmp dword [edx + 0x188], 0
je 0x65d17d
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x188]
push ecx
call fcn.006511ab
add esp, 4
mov edx, dword [ebp + 8]
mov dword [edx + 0x188], 0
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.MSVCR80.dll_getenv]
add esp, 4
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x65d1a7
mov ecx, dword [ebp - 0x1c]
push ecx
call sub.MSVCR80.dll_strlen
add esp, 4
add eax, 1
mov dword [ebp - 0x14], eax
jmp 0x65d1b5
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 0x79f504
mov dword [ebp - 8], 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x138]
and eax, 4
test eax, eax
jne 0x65d1e4
push 0
push 0
lea ecx, [ebp - 8]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0065c2f2
add esp, 0x14
cmp dword [ebp - 8], 0
je 0x65d1fe
mov ecx, dword [ebp - 8]
push ecx
call sub.MSVCR80.dll_strlen
add esp, 4
add eax, 1
mov dword [ebp - 0x18], eax
jmp 0x65d20c
mov dword [ebp - 0x18], 0
mov dword [ebp - 8], 0x79f508
cmp dword [ebp - 0x18], 0
jne 0x65d21f
cmp dword [ebp - 0x14], 0
jne 0x65d21f
xor eax, eax
jmp 0x65d2db
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
lea ecx, [eax + edx + 3]
push ecx
push 1
call dword [sym.imp.MSVCR80.dll_calloc]
add esp, 8
mov edx, dword [ebp + 8]
mov dword [edx + 0x188], eax
mov eax, dword [ebp + 8]
cmp dword [eax + 0x188], 0
jne 0x65d251
xor eax, eax
jmp 0x65d2db
push 0x3b
push 0x76f6d8
lea ecx, [ebp - 0x10]
push ecx
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0xc
cmp dword [ebp - 8], 0
je 0x65d273
mov edx, dword [ebp - 8]
mov dword [ebp - 0x30], edx
jmp 0x65d27a
mov dword [ebp - 0x30], 0x79f50c
cmp dword [ebp - 8], 0
je 0x65d28e
cmp dword [ebp - 0x1c], 0
je 0x65d28e
lea eax, [ebp - 0x10]
mov dword [ebp - 0x34], eax
jmp 0x65d295
mov dword [ebp - 0x34], 0x79f510
cmp dword [ebp - 0x1c], 0
je 0x65d2a3
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x38], ecx
jmp 0x65d2aa
mov dword [ebp - 0x38], 0x79f514
mov edx, dword [ebp - 0x30]
push edx
mov eax, dword [ebp - 0x34]
push eax
mov ecx, dword [ebp - 0x38]
push ecx
push 0x76f6dc
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x188]
push eax
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0x14
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x188]
jmp 0x65d2db
xor eax, eax
mov esp, ebp
pop ebp
ret