Function at 0x41d821
Capabilities:
Query environment variable
Read file on windows
Write file on windows

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
lea rbp, [rsp + 0x80]
mov dword [rbp + 0x50], ecx
mov qword [rbp + 0x58], rdx
call fcn.004fb7e0
call fcn.004f6df0
mov dword [rbp + 0x1c], eax
lea rdx, [0x0052fe66]
mov ecx, 2
call sub.msvcrt.dll_setlocale
mov rax, qword [rbp + 0x58]
mov rdx, qword [rax]
lea rax, [0x005a3b70]
mov qword [rax], rdx
lea rax, [0x005a3b70]
mov rax, qword [rax]
mov rcx, rax
call fcn.004fb380
lea rax, [rbp + 0x58]
mov rdx, rax
lea rcx, [rbp + 0x50]
call fcn.004f1f8d
call fcn.0043f670
cmp eax, 0x118
je 0x41d8a4
lea rcx, str._F_P:_fatal_error:_libbfd_ABI_mismatch_n
call fcn.00426ada
lea rax, [0x005a3b70]
mov rax, qword [rax]
mov rcx, rax
call fcn.00439835
lea rcx, [0x0041d791]
call fcn.00439887
mov qword [0x0059e648], rax
lea rcx, [0x0041d7dd]
call fcn.00439809
mov qword [0x0059e650], rax
lea rcx, [0x0041d750]
call fcn.004fb270
mov rdx, qword [rbp + 0x58]
mov eax, dword [rbp + 0x50]
mov ecx, eax
call fcn.0041e572
mov rdx, rax
lea rax, [0x005a3b48]
mov qword [rax], rdx
lea rax, [0x005a3b48]
mov rax, qword [rax]
movzx eax, byte [rax]
test al, al
je 0x41d933
lea rax, [0x005a3b48]
mov rax, qword [rax]
mov rcx, rax
call fcn.004f8570
mov rdx, rax
lea rax, [0x005a3b60]
mov qword [rax], rdx
lea rax, [0x005a3b60]
mov rax, qword [rax]
test rax, rax
je 0x41d9ec
lea rax, [0x005a3b60]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov edx, eax
lea rax, [0x005a3b78]
mov dword [rax], edx
lea rax, [0x005a3b78]
mov eax, dword [rax]
test eax, eax
jle 0x41d9f9
lea rax, [0x005a3b60]
mov rdx, qword [rax]
lea rax, [0x005a3b78]
mov eax, dword [rax]
cdqe
sub rax, 1
add rax, rdx
movzx eax, byte [rax]
cmp al, 0x2f
je 0x41d9ba
lea rax, [0x005a3b60]
mov rdx, qword [rax]
lea rax, [0x005a3b78]
mov eax, dword [rax]
cdqe
sub rax, 1
add rax, rdx
movzx eax, byte [rax]
cmp al, 0x5c
jne 0x41d9f9
lea rax, [0x005a3b60]
mov rdx, qword [rax]
lea rax, [0x005a3b78]
mov eax, dword [rax]
lea ecx, [rax - 1]
lea rax, [0x005a3b78]
mov dword [rax], ecx
lea rax, [0x005a3b78]
mov eax, dword [rax]
cdqe
add rax, rdx
mov byte [rax], 0
jmp 0x41d9f9
lea rax, [0x005a3b78]
mov dword [rax], 0xffffffff
lea rcx, str.xtensa_lx106_elf
call fcn.0044c79b
test eax, eax
jne 0x41da26
lea rdx, str.xtensa_lx106_elf
lea rcx, str._X_P:_cant_set_BFD_default_target_to___s:__E_n
call fcn.00426ada
mov ecx, 1
call fcn.004fb350
lea rax, [0x005a3d20]
mov dword [rax + 0xc], 1
lea rax, [0x005a3d20]
mov byte [rax + 0x48], 0x3a
lea rax, [0x005a3d20]
mov dword [rax + 0x60], 0xffffffff
lea rax, [0x005a3d20]
mov qword [rax + 0x68], 0xffffffffffffffff
lea rax, [0x005a3d20]
mov dword [rax + 4], 1
lea rax, [0x005a3d20]
mov dword [rax], 1
lea rax, [0x005a3d20]
mov dword [rax + 0x30], 1
lea rax, [0x005a3c20]
mov dword [rax + 0x18], 0xffffffff
lea rax, [0x005a3b80]
mov dword [rax + 0x10], 1
lea rax, [0x005a3b80]
mov dword [rax + 0x14], 1
lea rax, [0x005a3b80]
mov byte [rax + 0x18], 0xff
lea rcx, str.COLLECT_NO_DEMANGLE
call sub.msvcrt.dll_getenv
test rax, rax
sete al
movzx edx, al
lea rax, [0x005a3b68]
mov dword [rax], edx
lea rax, [0x005a3c20]
movzx edx, byte [rax + 5]
or edx, 0x20
mov byte [rax + 5], dl
lea rax, [0x005a3c20]
movzx edx, byte [rax + 3]
or edx, 4
mov byte [rax + 3], dl
lea rax, [0x005a3c20]
movzx edx, byte [rax + 4]
or edx, 0x40
mov byte [rax + 4], dl
lea rax, [0x005a3c20]
movzx edx, byte [rax + 1]
or edx, 4
mov byte [rax + 1], dl
lea rax, [0x005a3c20]
movzx edx, byte [rax + 5]
and edx, 0xffffffef
mov byte [rax + 5], dl
lea rax, [0x005a3c20]
movzx edx, byte [rax + 4]
or edx, 4
mov byte [rax + 4], dl
lea rax, [0x005a3c20]
movzx edx, byte [rax + 4]
and edx, 0xfffffff7
mov byte [rax + 4], dl
lea rax, [0x005a3c20]
lea rdx, [0x004fe080]
mov qword [rax + 0x20], rdx
lea rax, [0x005a3c20]
lea rdx, [0x005a3c20]
lea rdx, [rdx + 0x60]
mov qword [rax + 0x68], rdx
lea rax, [0x005a3c20]
lea rdx, str._init
mov qword [rax + 0x88], rdx
lea rax, [0x005a3c20]
lea rdx, str._fini
mov qword [rax + 0x90], rdx
lea rax, [0x005a3c20]
mov dword [rax + 0x98], 1
lea rax, [0x005a3c20]
mov dword [rax + 0xa0], 0xffffffff
lea rax, [0x005a3c20]
mov dword [rax + 0xa4], 0xffffffff
lea rax, [0x005a3c20]
mov dword [rax + 0xa8], 0xffffffff
lea rax, [0x005a3c20]
mov dword [rax + 0xb0], 5
lea rax, [0x005a3c20]
mov byte [rax + 0xa], 0x3a
lea rax, [0x005a3c20]
movzx edx, byte [rax + 5]
and edx, 0xfffffffe
mov byte [rax + 5], dl
lea rcx, [0x0052fe66]
call fcn.00427e1f
mov rdx, qword [rbp + 0x58]
mov eax, dword [rbp + 0x50]
mov ecx, eax
call fcn.0041e667
mov qword [rbp + 0x10], rax
mov rax, qword [rbp + 0x10]
mov rcx, rax
call fcn.00425172
mov rdx, qword [rbp + 0x58]
mov eax, dword [rbp + 0x50]
mov ecx, eax
call fcn.00424e8b
mov rdx, rax
lea rax, [0x005a3b50]
mov qword [rax], rdx
call fcn.0040e04c
call fcn.0042498c
call fcn.00424b44
mov rax, qword [0x00586700]
mov dword [rax], 0
mov rax, qword [rbp + 0x58]
mov edx, dword [rbp + 0x50]
mov ecx, edx
mov rdx, rax
call fcn.004089a0
lea rax, [0x005a3d20]
mov eax, dword [rax + 0x70]
test eax, eax
je 0x41dca3
lea rax, [0x005a3d20]
mov eax, dword [rax + 0x70]
mov ecx, eax
call fcn.0043f1ed
call fcn.0042aa01
call fcn.00424c07
mov rax, qword [0x0059e630]
test rax, rax
jne 0x41dcee
lea rax, [0x005a3b80]
mov rax, qword [rax + 0x78]
test rax, rax
je 0x41dcee
lea rax, [0x005a3b80]
mov rax, qword [rax + 0x78]
mov rcx, rax
call fcn.00427ddd
mov rax, qword [0x005868c0]
mov dword [rax], 1
call fcn.00401869
mov rax, qword [0x0059e630]
test rax, rax
jne 0x41dd66
lea rax, [rbp - 0x40]
mov rcx, rax
call fcn.00424c65
mov qword [rbp + 8], rax
mov eax, dword [rbp - 0x40]
test eax, eax
je 0x41dd1f
mov rax, qword [rbp + 8]
mov rcx, rax
call fcn.00427dfe
jmp 0x41dd46
mov rax, qword [0x005867b0]
mov rdx, qword [rbp + 8]
mov qword [rax], rdx
mov rax, qword [rbp + 8]
mov r8d, 1
lea rdx, str.built_in_linker_script
mov rcx, rax
call fcn.004084ef
mov rax, qword [0x005868c0]
mov dword [rax], 1
call fcn.00401869
mov rax, qword [0x005867b0]
mov qword [rax], 0
lea rax, [0x005a3b5c]
mov eax, dword [rax]
test eax, eax
je 0x41de71
mov rax, qword [0x0059e630]
test rax, rax
je 0x41dd91
lea rcx, str.using_external_linker_script:
call fcn.00426a86
jmp 0x41dd9d
lea rcx, str.using_internal_linker_script:
call fcn.00426a86
lea rcx, str._n_n
call fcn.00426a86
mov rax, qword [0x0059e630]
test rax, rax
je 0x41de51
mov eax, dword [0x00530bc4]
cdqe
mov rcx, rax
call fcn.004fb406
mov qword [rbp], rax
mov rax, qword [0x0059e630]
mov rcx, rax
call sub.msvcrt.dll_rewind
jmp 0x41ddff
mov rdx, qword [rbp]
mov rax, qword [rbp - 8]
add rax, rdx
mov byte [rax], 0
mov rax, qword [rbp]
mov rdx, rax
lea rcx, [0x0052ff85]
call fcn.00426a86
mov rcx, qword [0x0059e630]
mov eax, dword [0x00530bc4]
sub eax, 1
movsxd rdx, eax
mov rax, qword [rbp]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fread
mov qword [rbp - 8], rax
cmp qword [rbp - 8], 0
jne 0x41ddde
mov rax, qword [0x0059e630]
mov rcx, rax
call sub.msvcrt.dll_rewind
mov rax, qword [rbp]
mov rcx, rax
call sub.msvcrt.dll_free
jmp 0x41de65
lea rax, [rbp - 0x44]
mov rcx, rax
call fcn.00424c65
mov rcx, rax
call fcn.00426a86
lea rcx, str._n_n
call fcn.00426a86
lea rax, [0x005a3b80]
mov eax, dword [rax + 0x30]
test eax, eax
jne 0x41de90
lea rax, [0x005a3c20]
movzx eax, byte [rax]
and eax, 3
cmp al, 2
je 0x41dea3
lea rax, [0x005a3c20]
movzx edx, byte [rax + 1]
or edx, 0x10
mov byte [rax + 1], dl
jmp 0x41deb4
lea rax, [0x005a3c20]
movzx edx, byte [rax + 1]
and edx, 0xffffffef
mov byte [rax + 1], dl
lea rax, [0x005a3b80]
mov eax, dword [rax + 0x28]
test eax, eax
je 0x41ded6
call fcn.00411e28
mov rdx, rax
lea rcx, [0x0052ff88]
call fcn.00426a86
call fcn.00418ca2
mov eax, dword [rbp + 0x50]
cmp eax, 2
jne 0x41defa
lea rax, [0x005a3b40]
mov eax, dword [rax]
test eax, eax
je 0x41defa
mov ecx, 0
call fcn.004fb350
lea rax, [0x005a3c20]
movzx eax, byte [rax + 7]
and eax, 0x40
test al, al
je 0x41df29
lea rax, [0x005a3c20]
movzx eax, byte [rax]
and eax, 3
cmp al, 3
je 0x41df29
lea rcx, str._F_P:___no_define_common_may_not_be_used_without__shared_n
call fcn.00426ada
mov rax, qword [0x00586700]
mov eax, dword [rax]
test eax, eax
jne 0x41df67
lea rax, [0x005a3b40]
mov eax, dword [rax]
test eax, eax
jne 0x41df51
lea rax, [0x005a3b80]
mov eax, dword [rax + 0x28]
test eax, eax
je 0x41df5b
mov ecx, 0
call fcn.004fb350
lea rcx, str._F_P:_no_input_files_n
call fcn.00426ada
lea rax, [0x005a3b5c]
mov eax, dword [rax]
test eax, eax
je 0x41df87
mov rax, qword [rbp + 0x10]
mov rdx, rax
lea rcx, str._P:_mode__s_n
call fcn.00426a86
call fcn.00424b28
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x50]
test rax, rax
je 0x41e045
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x50]
lea rdx, [0x0052ffed]
mov rcx, rax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x41dfd8
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
lea rdx, [rax + 0x30]
lea rax, [0x005a3d20]
mov qword [rax + 0x58], rdx
jmp 0x41e034
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x50]
lea rdx, [0x0052ffef]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov rdx, rax
lea rax, [0x005a3d20]
mov qword [rax + 0x58], rdx
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x58]
test rax, rax
jne 0x41e034
mov ecx, 1
call fcn.0043833d
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x50]
mov rdx, rax
lea rcx, str._F_P:_cannot_open_map_file__s:__E_n
call fcn.00426ada
lea rax, [0x005a3c20]
movzx edx, byte [rax + 7]
or edx, 0xffffff80
mov byte [rax + 7], dl
call fcn.00419680
lea rax, [0x005a3c20]
movzx eax, byte [rax]
and eax, 3
cmp al, 2
jne 0x41e09a
lea rax, [0x005a3c20]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x40]
shr eax, 5
and eax, 0xfffff
lea rdx, [0x005a3c20]
mov rdx, qword [rdx + 0x50]
and eax, 0xffffd
and eax, 0xfffff
shl eax, 5
mov ecx, eax
mov eax, dword [rdx + 0x40]
and eax, 0xfe00001f
or eax, ecx
mov dword [rdx + 0x40], eax
jmp 0x41e0d5
lea rax, [0x005a3c20]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x40]
shr eax, 5
and eax, 0xfffff
lea rdx, [0x005a3c20]
mov rdx, qword [rdx + 0x50]
or eax, 2
and eax, 0xfffff
shl eax, 5
mov ecx, eax
mov eax, dword [rdx + 0x40]
and eax, 0xfe00001f
or eax, ecx
mov dword [rdx + 0x40], eax
lea rax, [0x005a3c20]
mov eax, dword [rax + 0xc]
and eax, 1
test eax, eax
je 0x41e171
lea rax, [0x005a3c20]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x40]
shr eax, 5
and eax, 0xfffff
lea rdx, [0x005a3c20]
mov rdx, qword [rdx + 0x50]
or ah, 0x40
and eax, 0xfffff
shl eax, 5
mov ecx, eax
mov eax, dword [rdx + 0x40]
and eax, 0xfe00001f
or eax, ecx
mov dword [rdx + 0x40], eax
lea rax, [0x005a3c20]
mov eax, dword [rax + 0xc]
cmp eax, 5
jne 0x41e171
lea rax, [0x005a3c20]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x40]
shr eax, 5
and eax, 0xfffff
lea rdx, [0x005a3c20]
mov rdx, qword [rdx + 0x50]
or eax, 0x20000
and eax, 0xfffff
shl eax, 5
mov ecx, eax
mov eax, dword [rdx + 0x40]
and eax, 0xfe00001f
or eax, ecx
mov dword [rdx + 0x40], eax
call fcn.0042114f
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x58]
test rax, rax
je 0x41e18b
call fcn.0040ff66
lea rax, [0x005a3b80]
mov eax, dword [rax + 0xc]
test eax, eax
je 0x41e1cb
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x58]
test rax, rax
je 0x41e1b6
lea rax, [0x005a3d20]
mov rax, qword [rax + 0x58]
jmp 0x41e1c3
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x30
mov rcx, rax
call fcn.004286ae
mov rax, qword [0x00586850]
mov rax, qword [rax]
test rax, rax
je 0x41e1df
call fcn.00428b24
lea rax, [0x005a3b80]
mov eax, dword [rax + 0x2c]
test eax, eax
je 0x41e1f2
call fcn.0041c386
call fcn.00424ac4
call fcn.0040e149
lea rax, [0x005a3d20]
mov eax, dword [rax + 4]
test eax, eax
jne 0x41e241
mov eax, dword [0x0059e640]
test eax, eax
jne 0x41e241
lea rax, [0x005a3b5c]
mov eax, dword [rax]
test eax, eax
je 0x41e237
mov rax, qword [0x004fe060]
mov rdx, rax
lea rcx, str._P:_link_errors_found__deleting_executable___s_n
call fcn.00426ada
mov ecx, 1
call fcn.004fb350
lea rax, [0x005a3c20]
mov rax, qword [rax + 0x50]
mov rcx, rax
call fcn.00446583
test eax, eax
jne 0x41e272
lea rax, [0x005a3c20]
mov rax, qword [rax + 0x50]
mov rdx, rax
lea rcx, str._F_P:__pB:_final_close_failed:__E_n
call fcn.00426ada
lea rax, [0x005a3c20]
movzx eax, byte [rax]
and eax, 3
cmp al, 2
je 0x41e49c
lea rax, [0x005a3b80]
mov eax, dword [rax + 8]
test eax, eax
je 0x41e49c
mov rax, qword [0x004fe060]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 3
jle 0x41e30f
mov rax, qword [0x004fe060]
mov edx, dword [rbp - 0xc]
movsxd rdx, edx
sub rdx, 4
add rax, rdx
lea rdx, str..exe
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll__stricmp]
call rax
test eax, eax
je 0x41e49c
mov rax, qword [0x004fe060]
mov edx, dword [rbp - 0xc]
movsxd rdx, edx
sub rdx, 4
add rax, rdx
lea rdx, str..dll
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll__stricmp]
call rax
test eax, eax
je 0x41e49c
mov dword [rbp - 0x10], 0x1000
mov eax, dword [rbp - 0x10]
cdqe
mov rcx, rax
call fcn.004fb406
mov qword [rbp - 0x18], rax
mov eax, dword [rbp - 0xc]
add eax, 5
cdqe
mov rcx, rax
call fcn.004fb406
mov qword [rbp - 0x20], rax
mov rdx, qword [0x004fe060]
mov rax, qword [rbp - 0x20]
mov rcx, rax
call sub.msvcrt.dll_strcpy
mov rax, qword [rbp - 0x20]
mov rcx, 0xffffffffffffffff
mov rdx, rax
mov eax, 0
mov rdi, rdx
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea rdx, [rax - 1]
mov rax, qword [rbp - 0x20]
add rax, rdx
mov dword [rax], 0x6578652e
mov byte [rax + 4], 0
mov rax, qword [0x004fe060]
lea rdx, [0x00530085]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov qword [rbp - 0x28], rax
mov rax, qword [rbp - 0x20]
lea rdx, [0x00530088]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov qword [rbp - 0x30], rax
cmp qword [rbp - 0x28], 0
jne 0x41e3cf
mov rax, qword [0x004fe060]
mov rdx, rax
lea rcx, str._F_P:_unable_to_open_for_source_of_copy___s_n
call fcn.00426ada
cmp qword [rbp - 0x30], 0
jne 0x41e42a
mov rax, qword [rbp - 0x20]
mov rdx, rax
lea rcx, str._F_P:_unable_to_open_for_destination_of_copy___s_n
call fcn.00426ada
jmp 0x41e42a
mov eax, dword [rbp - 0x34]
movsxd rdx, eax
mov rcx, qword [rbp - 0x30]
mov rax, qword [rbp - 0x18]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fwrite
mov dword [rbp - 0x38], eax
mov eax, dword [rbp - 0x38]
cmp eax, dword [rbp - 0x34]
je 0x41e42a
mov rax, qword [rbp - 0x20]
mov rdx, rax
lea rcx, str._P:_error_writing_file___s_n
call fcn.00426ada
mov eax, dword [rbp - 0x10]
movsxd rdx, eax
mov rcx, qword [rbp - 0x28]
mov rax, qword [rbp - 0x18]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fread
mov dword [rbp - 0x34], eax
cmp dword [rbp - 0x34], 0
jg 0x41e3eb
mov rax, qword [rbp - 0x28]
mov rcx, rax
call sub.msvcrt.dll_fclose
mov rax, qword [rbp - 0x30]
mov rcx, rax
call sub.msvcrt.dll_fclose
cmp eax, 0xffffffff
jne 0x41e484
mov rax, qword [rbp - 0x20]
mov rdx, rax
lea rcx, str._P:_error_closing_file___s_n
call fcn.00426ada
mov rax, qword [rbp - 0x20]
mov rcx, rax
call sub.msvcrt.dll_free
mov rax, qword [rbp - 0x18]
mov rcx, rax
call sub.msvcrt.dll_free
lea rax, [0x005a3d20]
mov eax, dword [rax + 0x34]
test eax, eax
je 0x41e54d
call fcn.004f6df0
sub eax, dword [rbp + 0x1c]
mov dword [rbp - 0x3c], eax
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x30
mov rcx, rax
call sub.msvcrt.dll_fflush
mov ecx, dword [rbp - 0x3c]
mov edx, 0x431bde83
mov eax, ecx
imul edx
sar edx, 0x12
mov eax, ecx
sar eax, 0x1f
mov ebx, edx
sub ebx, eax
imul eax, ebx, 0xf4240
mov ebx, ecx
sub ebx, eax
mov ecx, dword [rbp - 0x3c]
mov edx, 0x431bde83
mov eax, ecx
imul edx
sar edx, 0x12
mov eax, ecx
sar eax, 0x1f
mov edi, edx
sub edi, eax
lea rax, [0x005a3b70]
mov rsi, qword [rax]
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x60
mov dword [rsp + 0x20], ebx
mov r9d, edi
mov r8, rsi
lea rdx, str._s:_total_time_in_link:__ld._06ld_n
mov rcx, rax
call sub.msvcrt.dll_fprintf
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x60
mov rcx, rax
call sub.msvcrt.dll_fflush
mov qword [0x004fe060], 0
mov ecx, 0
call fcn.004fb350
nop