Function at 0x40d160
Capabilities:
Query environment variable

Disassembly:
push ebp
mov eax, 0x103c
mov ebp, esp
push edi
push esi
push ebx
call fcn.0049fe20
test byte [0x4ec099], 4
jne 0x40d420
mov eax, 0x4d7380
mov dword [0x4d7380], 0x4d7380
mov dword [0x4d7384], 0x4d7380
call fcn.0040c5a0
test eax, eax
jne 0x40d223
test byte [0x4ec099], 4
jne 0x40d1b4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.msvcrt.dll__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4ec0a8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add ebx, 0x40
push str.adb_auth_init
push str.system_core_adb_adb_auth_host.c
push 0x4acd74
push ebx
call fcn.0040c0e0
call sub.msvcrt.dll__errno
mov dword [eax], esi
pop edi
pop eax
push str.Failed_to_get_user_key_n
push ebx
call fcn.0040c0e0
mov dword [esp], ebx
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ec0a8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.msvcrt.dll__errno
mov dword [eax], esi
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
push str.ADB_VENDOR_KEYS
call sub.msvcrt.dll_getenv
add esp, 0x10
test eax, eax
je 0x40d1ac
push ebx
lea ebx, [ebp - 0x1034]
push 0x1000
push eax
push ebx
call sub.msvcrt.dll_strncpy
add esp, 0xc
lea eax, [ebp - 0x10]
push eax
push 0x4acf40
push ebx
call fcn.00413950
add esp, 0x10
mov edi, eax
test eax, eax
je 0x40d1ac
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [ebp - 0x1040], eax
jmp 0x40d2c2
push eax
push eax
lea eax, [ebp - 0x34]
push eax
push edi
call sub.msvcrt.dll__stat
add esp, 0x10
test eax, eax
je 0x40d341
test byte [0x4ec099], 4
jne 0x40d3b0
push eax
lea eax, [ebp - 0x10]
push eax
push 0x4acf40
push 0
call fcn.00413950
add esp, 0x10
mov edi, eax
test eax, eax
je 0x40d1ac
test byte [0x4ec099], 4
je 0x40d280
call sub.msvcrt.dll__errno
sub esp, 0xc
mov ebx, dword [eax]
push 0x4ec0a8
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
push str.get_vendor_keys
push str.system_core_adb_adb_auth_host.c
push 0x4acd74
mov ecx, dword [ebp - 0x1040]
push ecx
call fcn.0040c0e0
call sub.msvcrt.dll__errno
add esp, 0xc
mov dword [eax], ebx
push edi
push str.Reading:__s_n
mov edx, dword [ebp - 0x1040]
push edx
call fcn.0040c0e0
pop eax
mov eax, dword [ebp - 0x1040]
push eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ec0a8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.msvcrt.dll__errno
mov dword [eax], ebx
jmp 0x40d280
mov edx, 0x4d7380
mov eax, edi
call fcn.0040c2d0
test eax, eax
jne 0x40d2a4
test byte [0x4ec099], 4
je 0x40d2a4
call sub.msvcrt.dll__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4ec0a8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add ebx, 0x40
push str.get_vendor_keys
push str.system_core_adb_adb_auth_host.c
push 0x4acd74
push ebx
call fcn.0040c0e0
call sub.msvcrt.dll__errno
add esp, 0xc
mov dword [eax], esi
push edi
push str.Failed_to_read__s_n
jmp 0x40d3f5
call sub.msvcrt.dll__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4ec0a8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add ebx, 0x40
push str.get_vendor_keys
push str.system_core_adb_adb_auth_host.c
push 0x4acd74
push ebx
call fcn.0040c0e0
call sub.msvcrt.dll__errno
add esp, 0xc
mov dword [eax], esi
push edi
push str.Cant_read__s_n
push ebx
call fcn.0040c0e0
mov dword [esp], ebx
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ec0a8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.msvcrt.dll__errno
mov dword [eax], esi
jmp 0x40d2a4
call sub.msvcrt.dll__errno
sub esp, 0xc
mov esi, dword [eax]
push 0x4ec0a8
call sub.KERNEL32.dll_EnterCriticalSection
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0xc
add ebx, 0x40
push str.adb_auth_init
push str.system_core_adb_adb_auth_host.c
push 0x4acd74
push ebx
call fcn.0040c0e0
call sub.msvcrt.dll__errno
mov dword [eax], esi
pop eax
pop edx
push str.adb_auth_init_n
push ebx
call fcn.0040c0e0
mov dword [esp], ebx
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ec0a8
call sub.KERNEL32.dll_LeaveCriticalSection
add esp, 0xc
call sub.msvcrt.dll__errno
mov dword [eax], esi
jmp 0x40d17d