Function at 0x10040ace0
Capabilities:
Query environment variable
Terminate process

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x148
mov r13, r8
mov edi, ecx
mov esi, ecx
mov rcx, rdx
mov r14, rdx
and edi, 1
call sub.msys_2.0.dll_strlen
mov rbp, qword [r13]
lea r12, [rax + 1]
test rbp, rbp
je 0x10040ad4a
mov rcx, rbp
mov ebx, 8
nop dword [rax]
call sub.msys_2.0.dll_strlen
lea r12, [r12 + rax + 1]
cmp rbx, 0x100
je 0x10040af20
mov rcx, qword [r13 + rbx]
mov qword [rsp + rbx + 0x40], rcx
add rbx, 8
test rcx, rcx
jne 0x10040ad20
add r12, 1
cmp byte [r14], 0x7e
je 0x10040ae58
xor r15d, r15d
xor r13d, r13d
mov ebx, 1
mov rcx, r12
test edi, edi
je 0x10040aef4
call sub.msys_gcrypt_20.dll_gcry_xmalloc
mov r12, rax
test r15, r15
je 0x10040af0e
mov rdx, r15
mov rcx, r12
call sub.msys_2.0.dll_stpcpy
movsxd rdx, ebx
mov rcx, rax
add rdx, r14
call sub.msys_2.0.dll_stpcpy
mov rcx, r13
mov qword [rsp + 0x38], rax
xor r14d, r14d
lea r13, [rsp + 0x40]
call sub.msys_gcrypt_20.dll_gcry_free
test rbp, rbp
mov rax, qword [rsp + 0x38]
jne 0x10040addd
jmp 0x10040ae10
mov byte [rax], 0x2f
mov rdx, rbp
lea rcx, [rax + 1]
add r14, 1
call sub.msys_2.0.dll_stpcpy
mov rbp, qword [r13 + r14*8]
test rbp, rbp
je 0x10040ae10
test r14, r14
jne 0x10040adc0
cmp byte [r12], 0x2f
jne 0x10040adc0
cmp byte [r12 + 1], 0
jne 0x10040adc0
mov rdx, rbp
mov rcx, rax
add r14, 1
call sub.msys_2.0.dll_stpcpy
mov rbp, qword [r13 + r14*8]
test rbp, rbp
jne 0x10040addd
nop word [rax + rax]
and esi, 2
je 0x10040ae3c
mov edx, 0x3a
mov rcx, r12
call sub.msys_2.0.dll_strchr
lea rbx, [rax + 1]
test rax, rax
cmove rbx, r12
movzx eax, byte [rbx]
cmp al, 0x2f
je 0x10040ae3c
cmp al, 0x5c
jne 0x10040af40
mov rax, r12
add rsp, 0x148
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
movzx eax, byte [r14 + 1]
cmp al, 0x2f
je 0x10040aff6
test al, al
je 0x10040aff6
lea rcx, [r14 + 1]
test edi, edi
je 0x10040b034
call sub.msys_gcrypt_20.dll_gcry_xstrdup
mov r15, rax
mov edx, 0x2f
mov rcx, r15
call sub.msys_2.0.dll_strchr
test rax, rax
je 0x10040b09d
mov byte [rax], 0
mov rcx, r15
call sub.msys_2.0.dll_strlen
lea ebx, [rax + 1]
mov rcx, r15
call sub.msys_2.0.dll_getpwnam
test rax, rax
je 0x10040b0e3
mov rcx, qword [rax + 0x28]
test edi, edi
je 0x10040b050
call sub.msys_gcrypt_20.dll_gcry_xstrdup
mov rcx, r15
mov r13, rax
call sub.msys_gcrypt_20.dll_gcry_free
test r13, r13
je 0x10040b1c7
mov rcx, r13
mov r15, r13
call sub.msys_2.0.dll_strlen
add r12, rax
mov rcx, r12
test edi, edi
jne 0x10040ad6e
call sub.msys_gcrypt_20.dll_gcry_malloc
mov r12, rax
test rax, rax
je 0x10040b080
test r15, r15
jne 0x10040ad7f
mov rdx, r14
mov rcx, r12
call sub.msys_2.0.dll_stpcpy
jmp 0x10040ad98
test edi, edi
jne 0x10040b18b
mov ecx, 0x16
call sub.msys_gpg_error_0.dll_gpg_err_set_errno
xor r12d, r12d
jmp 0x10040ae3c
call fcn.10040ed10
mov rsi, rax
test rax, rax
je 0x10040b0ce
mov rcx, rax
call sub.msys_2.0.dll_strlen
mov rcx, r12
mov rbp, rax
call sub.msys_2.0.dll_strlen
lea rcx, [rbp + rax + 2]
test edi, edi
jne 0x10040b090
call sub.msys_gcrypt_20.dll_gcry_malloc
mov rdi, rax
test rax, rax
je 0x10040b1ba
mov rcx, rdi
cmp r12, rbx
je 0x10040afa6
mov rcx, rbx
mov rdx, rbx
sub rcx, r12
lea rbp, [rcx + 1]
mov rcx, rdi
mov r8, rbp
call sub.msys_2.0.dll_memcpy
lea rcx, [rdi + rbp]
cmp byte [rsi], 0x2f
jne 0x10040afb5
cmp byte [rsi + 1], 0
je 0x10040b0f0
mov rdx, rsi
call sub.msys_2.0.dll_stpcpy
mov rdx, r12
mov byte [rax], 0x2f
lea rcx, [rax + 1]
call sub.msys_2.0.dll_strcpy
mov rcx, rsi
call sub.msys_gcrypt_20.dll_gcry_free
mov rcx, r12
call sub.msys_gcrypt_20.dll_gcry_free
mov rcx, rdi
call sub.msys_2.0.dll_strlen
cmp rax, 2
ja 0x10040b0ad
mov r12, rdi
jmp 0x10040ae3c
lea rcx, [0x100420c8e]
call sub.msys_2.0.dll_getenv
mov r15, rax
test rax, rax
je 0x10040b104
xor r13d, r13d
cmp byte [rax], 0
mov ebx, 1
je 0x10040ad63
mov rcx, r15
mov ebx, 1
call sub.msys_2.0.dll_strlen
add r12, rax
jmp 0x10040ad63
call sub.msys_gcrypt_20.dll_gcry_strdup
mov r15, rax
test rax, rax
jne 0x10040ae81
jmp 0x10040af32
call sub.msys_gcrypt_20.dll_gcry_strdup
mov rcx, r15
mov r13, rax
call sub.msys_gcrypt_20.dll_gcry_free
test r13, r13
jne 0x10040aedb
mov rcx, r12
call sub.msys_gcrypt_20.dll_gcry_malloc
mov r12, rax
test rax, rax
jne 0x10040af0e
xor r13d, r13d
mov rcx, r13
call sub.msys_gcrypt_20.dll_gcry_free
jmp 0x10040af32
call sub.msys_gcrypt_20.dll_gcry_xmalloc
mov rdi, rax
jmp 0x10040af82
mov rcx, r15
call sub.msys_2.0.dll_strlen
lea ebx, [rax + 1]
jmp 0x10040aea5
lea rdx, [rdi + rax - 2]
cmp byte [rdx], 0x2f
jne 0x10040afee
cmp byte [rdi + rax - 1], 0x2e
jne 0x10040afee
mov byte [rdx], 0
jmp 0x10040afee
test edi, edi
jne 0x10040b1d7
mov rcx, r12
call sub.msys_gcrypt_20.dll_gcry_free
jmp 0x10040af32
mov rcx, r15
call sub.msys_gcrypt_20.dll_gcry_free
jmp 0x10040ad58
mov byte [rcx], 0x2f
mov rdx, r12
add rcx, 1
call sub.msys_2.0.dll_strcpy
jmp 0x10040afcc
call sub.msys_2.0.dll_getuid
mov ecx, eax
call sub.msys_2.0.dll_getpwuid
test rax, rax
je 0x10040ad58
mov rcx, qword [rax + 0x28]
test edi, edi
je 0x10040b14c
call sub.msys_gcrypt_20.dll_gcry_xstrdup
mov r13, rax
test rax, rax
je 0x10040b1c7
cmp byte [rax], 0
jne 0x10040b183
mov rcx, r12
mov r15, r13
mov ebx, edi
call sub.msys_gcrypt_20.dll_gcry_xmalloc
mov r12, rax
jmp 0x10040ad7f
call sub.msys_gcrypt_20.dll_gcry_strdup
mov r13, rax
test rax, rax
je 0x10040b069
cmp byte [rax], 0
jne 0x10040b183
mov rcx, r12
call sub.msys_gcrypt_20.dll_gcry_malloc
mov r12, rax
test rax, rax
je 0x10040b080
mov r15, r13
mov ebx, 1
jmp 0x10040ad7f
mov r15, r13
jmp 0x10040b01f
lea rax, str.do_make_filename
mov r9d, 0x1ed
lea r8, str.stringhelp.c
mov ecx, 6
mov qword [rsp + 0x20], rax
lea rdx, [0x100420c72]
call sub.msys_gpg_error_0.dll_gpgrt_log
call sub.msys_2.0.dll_abort
mov rcx, rsi
call sub.msys_gcrypt_20.dll_gcry_free
jmp 0x10040b0d6
mov rcx, r12
call sub.msys_gcrypt_20.dll_gcry_xmalloc
mov r12, rax
jmp 0x10040af0e
call sub.msys_2.0.dll___errno
mov ecx, dword [rax]
call sub.msys_2.0.dll_strerror
mov rbx, rax
call sub.msys_2.0.dll___getreent
mov r8, rbx
lea rdx, str._nfatal:_getcwd_failed:__s_n
mov rcx, qword [rax + 0x18]
call sub.msys_2.0.dll_fprintf
mov ecx, 2
call sub.msys_2.0.dll_exit
nop
nop dword [rax]
push rdi
push rsi
push rbx
sub rsp, 0x20
mov rdi, rcx
mov rcx, rdx
mov rbx, rdx
call sub.msys_2.0.dll_strlen
mov rdx, rbx
mov rcx, rdi
mov r8, rax
mov rsi, rax
call sub.msys_2.0.dll_strncmp
mov edx, eax
xor eax, eax
test edx, edx
jne 0x10040b25c
lea rax, [rdi + rsi]
movzx edx, byte [rax]
cmp dl, 0x20
ja 0x10040b25a
movabs rcx, 0x100000201
bt rcx, rdx
jb 0x10040b270
xor eax, eax
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
movzx edx, byte [rax + 1]
add rax, 1
cmp dl, 0x20
je 0x10040b268
cmp dl, 9
je 0x10040b268
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret