Function at 0x4a7818
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edx, dword [ebp + 0xc]
test edx, edx
je 0x4a7ecd
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [ebp - 0x44], eax
mov dword [esp], 0x4bf4c0
call fcn.004a8334
test eax, eax
jne 0x4a7ee5
mov eax, dword [ebp + 8]
test eax, eax
je 0x4a7e19
mov eax, dword [0x50d818]
test eax, eax
je 0x4a79a5
mov eax, dword [0x50e610]
mov ebx, eax
mov dword [ebp - 0x30], eax
test eax, eax
je 0x4a7bbf
mov esi, dword [ebp + 8]
jmp 0x4a788c
js 0x4a7bb8
mov ebx, dword [ebx]
test ebx, ebx
je 0x4a7bda
lea eax, [ebx + 0xc]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4a787c
mov dword [ebp - 0x30], ebx
mov eax, dword [ebx + 4]
mov dword [ebp - 0x38], eax
mov al, byte [eax]
cmp al, 0x2f
je 0x4a7977
cmp al, 0x5c
je 0x4a7977
and eax, 0xffffffdf
sub eax, 0x41
cmp al, 0x19
ja 0x4a78d1
mov eax, dword [ebp - 0x38]
cmp byte [eax + 1], 0x3a
je 0x4a7977
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp - 0x38]
repne scasb al, byte es:[edi]
mov dword [ebp - 0x2c], ecx
not dword [ebp - 0x2c]
mov ebx, 0x106
mov edi, 0x10
jmp 0x4a7906
call sub.msvcrt.dll__errno
cmp dword [eax], 0x22
jne 0x4a7b55
mov eax, ebx
shr eax, 1
lea ebx, [ebx + eax + 0x20]
mov eax, dword [ebp - 0x2c]
lea eax, [ebx + eax + 0x1e]
xor edx, edx
div edi
shl eax, 4
call fcn.004b3a40
sub esp, eax
lea esi, [esp + 0x23]
and esi, 0xfffffff0
call sub.msvcrt.dll__errno
mov dword [eax], 0
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.msvcrt.dll__getcwd
test eax, eax
je 0x4a78f0
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.msvcrt.dll_strchr
mov ecx, 0x4eb4bc
nop
inc eax
inc ecx
mov dl, byte [ecx - 1]
mov byte [eax - 1], dl
test dl, dl
jne 0x4a7954
mov edx, dword [ebp - 0x38]
jmp 0x4a7969
inc eax
inc edx
mov cl, byte [edx - 1]
mov byte [eax - 1], cl
test cl, cl
jne 0x4a7968
mov dword [ebp - 0x38], esi
cmp dword [ebp + 0x1c], 3
je 0x4a7bd0
jg 0x4a79b4
cmp dword [ebp + 0x1c], 1
je 0x4a7e26
jg 0x4a7be9
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x4a7e3a
mov ebx, 0x4eb4fd
jmp 0x4a79d6
mov dword [0x50d818], 0xffffffff
jmp 0x4a7862
cmp dword [ebp + 0x1c], 5
je 0x4a7e30
jl 0x4a7bf3
cmp dword [ebp + 0x1c], 0x6c1
jne 0x4a7e3a
mov ebx, 0x4eb4f1
mov dword [esp + 4], ebx
mov eax, dword [ebp + 0x1c]
mov dword [esp], eax
call fcn.004aa400
mov edx, eax
mov dword [ebp - 0x2c], 0
test eax, eax
je 0x4a7eba
mov ecx, 2
mov esi, edx
mov edi, 0x4eb50f
repe cmpsb byte [esi], byte es:[edi]
jne 0x4a7ce7
mov esi, 0xffffffff
xor eax, eax
mov ecx, esi
mov edi, dword [ebp + 8]
repne scasb al, byte es:[edi]
not ecx
lea edi, [ecx - 1]
mov dword [ebp - 0x3c], edi
mov ecx, esi
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
mov edi, dword [ebp - 0x3c]
lea eax, [edi + ecx + 0x22]
and eax, 0xfffffff0
call fcn.004b3a40
sub esp, eax
lea eax, [esp + 0x23]
mov dword [ebp - 0x34], eax
and dword [ebp - 0x34], 0xfffffff0
mov eax, dword [ebp - 0x34]
jmp 0x4a7a4e
mov eax, esi
lea esi, [eax + 1]
inc ebx
mov cl, byte [ebx - 1]
mov byte [esi - 1], cl
test cl, cl
jne 0x4a7a4c
mov ebx, 0x4eb4bc
jmp 0x4a7a67
mov eax, esi
inc esi
inc ebx
mov cl, byte [ebx - 1]
mov byte [esi - 1], cl
test cl, cl
jne 0x4a7a64
mov edi, eax
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x3c]
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x4eb50b
lea esi, [esi]
inc edi
inc ecx
mov al, byte [ecx - 1]
mov byte [edi - 1], al
test al, al
jne 0x4a7a84
mov ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
lea eax, [ecx + 0x1e]
and eax, 0xfffffff0
call fcn.004b3a40
sub esp, eax
lea eax, [esp + 0x23]
mov dword [ebp - 0x2c], eax
and dword [ebp - 0x2c], 0xfffffff0
mov ebx, edx
lea esi, [esi]
mov al, byte [ebx]
cmp al, 0x3a
je 0x4a7c84
test al, al
jne 0x4a7c00
mov eax, dword [ebp - 0x2c]
mov byte [eax], 0x43
mov byte [eax + 1], 0
mov esi, dword [ebp - 0x2c]
mov edi, 0x4eb50f
mov ecx, 2
repe cmpsb byte [esi], byte es:[edi]
je 0x4a7b55
mov edi, str.POSIX
mov ecx, 6
mov esi, dword [ebp - 0x2c]
repe cmpsb byte [esi], byte es:[edi]
je 0x4a7b55
mov esi, dword [ebp - 0x30]
mov dword [esp + 0xc], esi
mov eax, dword [ebp - 0x34]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call fcn.004b12b8
mov edi, eax
test eax, eax
je 0x4a7ab8
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 1
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov dword [esp], edi
call fcn.004a6fdc
test eax, eax
je 0x4a7c8c
mov ebx, edi
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0xffffffff
jne 0x4a7d27
mov dword [esp], 0x4bf4c0
call fcn.004a85ac
test eax, eax
jne 0x4a7ee5
cmp dword [0x50d818], 1
je 0x4a7b8b
mov dword [esp], str.GETTEXT_LOG_UNTRANSLATED
call sub.msvcrt.dll_getenv
test eax, eax
je 0x4a7b8b
cmp byte [eax], 0
jne 0x4a7e44
call sub.msvcrt.dll__errno
mov edi, dword [ebp - 0x44]
mov dword [eax], edi
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4a7bad
cmp dword [ebp + 0x18], 1
je 0x4a7bad
mov eax, dword [ebp + 0x10]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp + 0xc]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x38], 0x4eb539
cmp dword [ebp + 0x1c], 3
jne 0x4a7981
mov ebx, 0x4eb4d2
jmp 0x4a79d6
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x38], 0x4eb539
jmp 0x4a7977
mov ebx, 0x4eb4c9
jmp 0x4a79d6
mov ebx, 0x4eb4de
jmp 0x4a79d6
mov edx, dword [ebp - 0x2c]
jmp 0x4a7c0c
cmp al, 0x3a
je 0x4a7c17
inc edx
inc ebx
mov byte [edx - 1], al
mov al, byte [ebx]
test al, al
jne 0x4a7c08
mov byte [edx], 0
cmp dword [0x50d818], 1
jne 0x4a7ad4
mov dword [esp + 4], 0x2f
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
test eax, eax
jne 0x4a7ab8
mov dword [esp + 4], 0x5c
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
test eax, eax
jne 0x4a7ab8
mov eax, dword [ebp - 0x2c]
mov al, byte [eax]
and eax, 0xffffffdf
sub eax, 0x41
cmp al, 0x19
ja 0x4a7ad4
mov eax, dword [ebp - 0x2c]
cmp byte [eax + 1], 0x3a
jne 0x4a7ad4
jmp 0x4a7ab8
inc ebx
jmp 0x4a7ab8
mov eax, dword [edi + 0x10]
test eax, eax
je 0x4a7ab8
xor esi, esi
mov dword [ebp - 0x40], ebx
mov ebx, dword [ebp - 0x30]
jmp 0x4a7cad
inc esi
mov eax, dword [edi + esi*4 + 0x10]
test eax, eax
je 0x4a7cdf
lea ecx, [ebp - 0x1c]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], 1
mov ecx, dword [ebp + 0xc]
mov dword [esp + 8], ecx
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.004a6fdc
test eax, eax
je 0x4a7ca4
mov dword [ebp - 0x2c], eax
mov ebx, dword [edi + esi*4 + 0x10]
jmp 0x4a7b4b
mov ebx, dword [ebp - 0x40]
jmp 0x4a7ab8
mov dword [ebp - 0x34], edx
mov dword [esp], str.LANGUAGE
call sub.msvcrt.dll_getenv
test eax, eax
mov edx, dword [ebp - 0x34]
je 0x4a7d02
cmp byte [eax], 0
jne 0x4a7d20
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x4a7a0a
mov dword [ebp - 0x2c], edx
call fcn.004a8948
test eax, eax
mov edx, dword [ebp - 0x2c]
je 0x4a7a0a
mov edx, eax
jmp 0x4a7a0a
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
mov eax, dword [ebp - 0x3c]
lea eax, [eax + ecx + 0x19]
mov dword [ebp - 0x30], ecx
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, eax
test eax, eax
je 0x4a7de9
lea eax, [eax + 0x18]
mov edi, eax
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x30]
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp - 0x3c]
inc eax
mov ecx, eax
mov dword [ebp - 0x30], edi
mov esi, dword [ebp + 8]
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x30]
mov dword [edx], edi
mov eax, dword [ebp + 0x1c]
mov dword [edx + 4], eax
mov eax, dword [0x50e60c]
mov dword [edx + 8], eax
mov dword [edx + 0xc], ebx
mov eax, dword [ebp - 0x2c]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 0x1c]
mov dword [edx + 0x14], eax
mov dword [ebp - 0x30], edx
mov dword [esp], 0x4bf520
call fcn.004a8474
test eax, eax
jne 0x4a7ee5
mov dword [esp + 8], 0x4a6f78
mov dword [esp + 4], 0x50d81c
mov edx, dword [ebp - 0x30]
mov dword [esp], edx
call fcn.004b5bf0
mov esi, eax
mov dword [esp], 0x4bf520
call fcn.004a85ac
test eax, eax
jne 0x4a7ee5
test esi, esi
mov edx, dword [ebp - 0x30]
je 0x4a7ed8
cmp edx, dword [esi]
jne 0x4a7ed8
call sub.msvcrt.dll__errno
mov edi, dword [ebp - 0x44]
mov dword [eax], edi
mov eax, dword [ebp + 0x14]
test eax, eax
jne 0x4a7e6d
mov dword [esp], 0x4bf4c0
call fcn.004a85ac
test eax, eax
jne 0x4a7ee5
mov eax, dword [ebp - 0x2c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [str.messages]
mov dword [ebp + 8], eax
jmp 0x4a7855
mov ebx, 0x4eb4be
jmp 0x4a79d6
mov ebx, 0x4eb4e9
jmp 0x4a79d6
mov ebx, 0x4eb504
jmp 0x4a79d6
mov edi, dword [ebp + 0x14]
mov dword [esp + 0x10], edi
mov edi, dword [ebp + 0x10]
mov dword [esp + 0xc], edi
mov edi, dword [ebp + 0xc]
mov dword [esp + 8], edi
mov edi, dword [ebp + 8]
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.004aa5b8
jmp 0x4a7b8b
mov esi, dword [ebp - 0x1c]
mov edi, dword [ebx + 8]
mov eax, dword [edi + 0x84]
mov edx, dword [ebp + 0x18]
call fcn.004a6e2c
cmp eax, dword [edi + 0x88]
jae 0x4a7ed4
mov edi, eax
mov ecx, dword [ebp - 0x2c]
mov eax, ecx
add esi, ecx
jmp 0x4a7eae
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_strchr
inc eax
dec edi
cmp eax, esi
jae 0x4a7dfa
test edi, edi
jne 0x4a7e94
mov dword [ebp - 0x2c], eax
jmp 0x4a7dfa
call fcn.004aa404
mov edx, eax
mov dword [ebp - 0x2c], 1
jmp 0x4a79f6
xor eax, eax
jmp 0x4a7ba5
xor eax, eax
jmp 0x4a7e89
mov dword [esp], edx
call sub.msvcrt.dll_free
jmp 0x4a7de9
call sub.msvcrt.dll_abort
nop
nop