Function at 0x486440
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, eax
push edi
push esi
push ebx
sub esp, 0x2c
mov dword [esp + 0x1c], ecx
mov esi, dword [esp + 0x48]
test ecx, ecx
je 0x4861aa
mov ebx, dword [0x491218]
mov eax, dword [0x491204]
mov edi, edx
test ebx, ebx
je 0x486020
cmp eax, 0xffffffff
je 0x486034
mov edx, dword [0x5298e0]
test edx, edx
jne 0x486034
mov eax, dword [esp + 0x1c]
movzx eax, byte [eax]
cmp al, 0x2d
je 0x486076
mov ecx, dword [0x491204]
test ecx, ecx
jne 0x486160
cmp al, 0x2b
je 0x486240
mov dword [0x5298dc], 0
test edx, edx
je 0x485f27
mov dword [0x491208], 0xffffffff
mov dword [0x49120c], 0xffffffff
mov ebx, dword [0x491218]
mov dword [0x5298e0], 0
cmp ebx, ebp
jge 0x486170
mov edx, dword [edi + ebx*4]
cmp byte [edx], 0x2d
je 0x486088
mov dword [0x491210], 0x4bf9a8
test esi, 2
jne 0x4861c0
test esi, 1
je 0x4861aa
mov eax, dword [0x49120c]
cmp eax, 0xffffffff
je 0x486150
mov edx, dword [0x491208]
cmp edx, 0xffffffff
je 0x485f1e
mov dword [esp], edi
mov ecx, ebx
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], eax
call fcn.00485940
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [0x491208], 0xffffffff
sub edx, eax
mov eax, ebx
sub eax, edx
mov dword [0x49120c], eax
add ebx, 1
mov dword [0x491218], ebx
mov ecx, dword [0x491210]
movsx eax, byte [ecx]
test al, al
je 0x485e90
mov edx, dword [esp + 0x40]
test edx, edx
je 0x485faa
mov edx, dword [0x491218]
cmp dword [edi + edx*4], ecx
je 0x485faa
cmp al, 0x2d
je 0x4862dd
and esi, 4
je 0x4861f8
cmp al, 0x3a
je 0x4862e6
mov dword [esp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
test eax, eax
setne al
movzx eax, al
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x44]
mov dword [esp], eax
mov eax, edi
call fcn.00485a90
mov esi, eax
cmp eax, 0xffffffff
jne 0x486398
mov ecx, dword [0x491210]
movzx eax, byte [ecx]
lea ebx, [ecx + 1]
movsx esi, al
mov dword [0x491210], ebx
cmp al, 0x3a
je 0x48620c
cmp esi, 0x2d
je 0x4860de
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], esi
mov dword [esp + 0x14], ecx
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov ecx, dword [esp + 0x14]
test eax, eax
mov edx, eax
je 0x48620c
cmp dword [esp + 0x40], 0
movzx eax, byte [eax + 1]
je 0x486001
cmp esi, 0x57
jne 0x486001
cmp al, 0x3b
je 0x4862ed
cmp al, 0x3a
je 0x486118
cmp byte [ecx + 1], 0
jne 0x4861af
add dword [0x491218], 1
jmp 0x4861af
mov dword [0x5298e0], 1
mov dword [0x491218], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], str.POSIXLY_CORRECT
call dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableW]
mov edx, dword [0x5298e0]
sub esp, 0xc
test eax, eax
setne al
movzx eax, al
mov dword [0x491204], eax
mov eax, dword [esp + 0x1c]
movzx eax, byte [eax]
cmp al, 0x2d
jne 0x485e54
or esi, 2
add dword [esp + 0x1c], 1
jmp 0x485e6a
movsx eax, byte [edx + 1]
test al, al
jne 0x486248
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], 0x2d
mov dword [esp + 0x14], edx
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov edx, dword [esp + 0x14]
test eax, eax
je 0x485eb4
cmp dword [0x49120c], 0xffffffff
je 0x4860ce
cmp dword [0x491208], 0xffffffff
je 0x48635a
lea ebx, [edx + 1]
mov ecx, edx
mov esi, 0x2d
mov dword [0x491210], ebx
cmp byte [ecx + 1], 0
mov dword [esp + 0x14], ecx
jne 0x486219
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], 0x2d
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov ecx, dword [esp + 0x14]
test eax, eax
mov edx, eax
je 0x4861aa
cmp byte [eax + 1], 0x3a
jne 0x486013
mov dword [0x5298dc], 0
cmp byte [ecx + 1], 0
mov eax, dword [0x491218]
je 0x4863a7
mov dword [0x5298dc], ebx
mov dword [0x491210], 0x4bf9a8
add eax, 1
mov dword [0x491218], eax
jmp 0x4861af
mov dword [0x49120c], ebx
jmp 0x485f1e
and esi, 0xfffffffe
cmp al, 0x2b
jne 0x485e6a
jmp 0x486079
mov esi, dword [0x491208]
mov ebp, dword [0x49120c]
mov dword [0x491210], 0x4bf9a8
cmp esi, 0xffffffff
jne 0x4861de
cmp ebp, 0xffffffff
je 0x486196
mov dword [0x491218], ebp
mov dword [0x491208], 0xffffffff
mov dword [0x49120c], 0xffffffff
mov esi, 0xffffffff
add esp, 0x2c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
add ebx, 1
mov esi, 1
mov dword [0x5298dc], edx
mov dword [0x491218], ebx
add esp, 0x2c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], edi
mov edx, esi
sub esi, ebp
mov ecx, ebx
mov eax, ebp
sub ebx, esi
call fcn.00485940
mov dword [0x491218], ebx
jmp 0x486196
lea ebx, [ecx + 1]
movsx esi, al
mov dword [0x491210], ebx
cmp al, 0x3a
jne 0x485fc7
cmp byte [ecx + 1], 0
jne 0x486219
add dword [0x491218], 1
mov eax, dword [0x49121c]
test eax, eax
je 0x48622f
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0x3a
jne 0x4862c8
mov dword [0x491214], esi
mov esi, 0x3f
jmp 0x4861af
and esi, 0xfffffffe
jmp 0x486079
mov ecx, dword [0x49120c]
mov dword [esp + 0x14], ecx
cmp ecx, 0xffffffff
je 0x486264
cmp dword [0x491208], 0xffffffff
je 0x486365
lea ecx, [edx + 1]
mov dword [0x491210], ecx
cmp al, 0x2d
jne 0x485f38
cmp byte [edx + 2], 0
jne 0x485f38
mov esi, dword [0x491208]
add ebx, 1
mov dword [0x491210], 0x4bf9a8
mov dword [0x491218], ebx
cmp esi, 0xffffffff
je 0x486196
mov dword [esp], edi
mov edi, dword [esp + 0x14]
mov edx, esi
mov ecx, ebx
sub esi, edi
mov eax, edi
call fcn.00485940
sub ebx, esi
mov dword [0x491218], ebx
jmp 0x486196
mov dword [esp + 4], esi
mov dword [esp], str.unknown_option_____c
call fcn.00485a10
jmp 0x48622f
add ecx, 1
mov dword [0x491210], ecx
xor eax, eax
jmp 0x485f7c
cmp byte [ecx + 1], 0
jne 0x486378
mov eax, dword [0x491218]
add eax, 1
mov dword [0x491218], eax
cmp eax, ebp
jl 0x486370
mov edx, dword [0x49121c]
mov dword [0x491210], 0x4bf9a8
test edx, edx
je 0x486339
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0x3a
je 0x486339
mov dword [esp + 4], 0x57
mov dword [esp], str.option_requires_an_argument_____c
call fcn.00485a10
mov dword [0x491214], 0x57
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0x3a
jne 0x486235
mov esi, 0x3a
jmp 0x4861af
mov dword [0x491208], ebx
jmp 0x4860ce
mov dword [0x491208], ebx
jmp 0x486264
mov eax, dword [edi + eax*4]
mov dword [0x491210], eax
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
mov dword [esp + 4], 0
mov edx, dword [esp + 0x1c]
mov dword [esp], eax
mov eax, edi
call fcn.00485a90
mov esi, eax
mov dword [0x491210], 0x4bf9a8
jmp 0x4861af
cmp byte [edx + 2], 0x3a
je 0x486137
add eax, 1
mov dword [0x491218], eax
cmp ebp, eax
jle 0x4863cb
mov edx, dword [edi + eax*4]
mov dword [0x5298dc], edx
jmp 0x486137
mov eax, dword [0x49121c]
mov dword [0x491210], 0x4bf9a8
test eax, eax
je 0x4863f7
mov eax, dword [esp + 0x1c]
cmp byte [eax], 0x3a
je 0x4863f7
mov dword [esp + 4], esi
mov dword [esp], str.option_requires_an_argument_____c
call fcn.00485a10
mov eax, dword [esp + 0x1c]
mov dword [0x491214], esi
cmp byte [eax], 0x3a
jne 0x486235
jmp 0x486350
push ebx
mov ebx, dword [esp + 0x18]
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x10], 1
mov dword [esp + 8], ebx
pop ebx
jmp 0x485e00