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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
sub esp, 0x40
call fcn.004ba980
call fcn.004a8df0
mov dword [esp + 4], 0x4d28ae
mov dword [esp], 2
mov dword [esp + 0x18], eax
call sub.msvcrt.dll_setlocale
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov dword [esp], eax
mov dword [0x51478c], eax
call fcn.004a0590
lea eax, [ebp + 0xc]
mov dword [esp + 4], eax
lea eax, [ebp + 8]
mov dword [esp], eax
call fcn.004a91d0
call fcn.00459a00
mov eax, dword [0x51478c]
mov dword [esp], eax
call fcn.0044b9e0
mov dword [esp], 0x412c80
call fcn.0044ba00
mov dword [esp], 0x4131d0
mov dword [0x50f41c], eax
call fcn.004a9520
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
cmp eax, 1
mov dword [esp + 0x28], eax
jle 0x4bc841
mov eax, 1
mov dword [esp + 0x2c], ebx
jmp 0x4bc819
add eax, 1
cmp eax, dword [esp + 0x28]
je 0x4bc841
mov edi, dword [esp + 0x2c]
mov ecx, 0xa
mov edx, dword [edi + eax*4]
mov edi, str.__sysroot
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
seta cl
mov esi, ecx
setb cl
mov ebx, esi
cmp bl, cl
jne 0x4bc810
add edx, 0xa
jmp 0x4bc846
mov edx, 0x4d28ae
mov dword [0x514804], edx
cmp byte [edx], 0
jne 0x4bcd36
mov eax, dword [0x5147fc]
test eax, eax
je 0x4bd0e3
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [0x514790], eax
mov dword [esp], str.avr_unknown_none
call fcn.0044cea0
test eax, eax
jne 0x4bc89f
mov dword [esp + 4], str.avr_unknown_none
mov dword [esp], str._X_P:_cant_set_BFD_default_target_to___s:__E_n
call fcn.00418450
mov dword [esp], 1
call fcn.004a7250
mov dword [esp], str.COLLECT_NO_DEMANGLE
mov dword [0x51472c], 1
mov byte [0x514768], 0x3a
mov dword [0x514774], 0xffffffff
mov dword [0x514778], 0xffffffff
mov dword [0x514724], 1
mov dword [0x514720], 1
mov dword [0x514750], 1
mov dword [0x514834], 0xffffffff
mov dword [0x5147b4], 1
mov dword [0x5147b8], 1
mov byte [0x5147bc], 0xff
call sub.msvcrt.dll_getenv
mov dword [esp], 0x4d28ae
mov dword [0x514838], 0x4be060
mov dword [0x514858], 0x514854
mov dword [0x514868], 0x4d2914
mov dword [0x51486c], 0x4d291a
test eax, eax
sete al
movzx eax, al
mov dword [0x514794], eax
movzx eax, byte [0x514824]
or byte [0x514822], 0x40
or byte [0x514821], 2
or byte [0x514823], 0x20
or eax, 0xffffff82
mov byte [0x514824], al
mov dword [0x514870], 1
mov dword [0x514878], 0xffffffff
mov dword [0x51487c], 0xffffffff
mov dword [0x514884], 5
mov byte [0x514829], 0x3a
call fcn.00419120
mov eax, dword [ebp + 0xc]
mov dword [esp], str.LDEMULATION
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 8]
mov edi, eax
mov dword [esp + 0x24], eax
call sub.msvcrt.dll_getenv
test eax, eax
mov edx, eax
mov eax, 0x4d28af
cmovne eax, edx
cmp edi, 1
mov dword [esp + 0x20], eax
jle 0x4bcba0
mov eax, edi
mov edx, 1
sub eax, 1
mov ebx, edx
mov dword [esp + 0x1c], eax
jmp 0x4bca1d
cmp dword [esp + 0x1c], ebx
jle 0x4bcd25
mov eax, dword [esp + 0x2c]
add ebx, 1
mov edx, dword [esp + 0x28]
mov eax, dword [eax + edx + 4]
mov dword [esp + 0x20], eax
lea esi, [esi]
add ebx, 1
cmp dword [esp + 0x24], ebx
jle 0x4bcba0
lea eax, [ebx*4]
mov ecx, 2
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov edi, 0x4d292c
mov edx, dword [eax + ebx*4]
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
seta cl
mov esi, ecx
setb cl
mov eax, esi
cmp al, cl
jne 0x4bca10
cmp byte [edx + 2], 0
je 0x4bc9f0
mov edi, str._mips1
mov ecx, 7
mov esi, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips2
mov dword [esp + 0x28], edx
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips3
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips4
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips5
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips32
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips32r2
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips32r6
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips64
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips64r2
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._mips64r6
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
test eax, eax
je 0x4bca10
mov dword [esp], edx
mov dword [esp + 4], str._m486
call sub.msvcrt.dll_strcmp
mov edx, dword [esp + 0x28]
add edx, 2
test eax, eax
cmove edx, dword [esp + 0x20]
mov dword [esp + 0x20], edx
jmp 0x4bca10
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00417870
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00417640
mov dword [esp], eax
mov dword [0x51479c], eax
call fcn.0044c4b0
mov dword [0x514784], eax
mov eax, dword [0x51479c]
mov dword [esp], eax
call fcn.0044c550
mov dword [0x514788], eax
call fcn.0040c1e0
call fcn.004173f0
call fcn.004174b0
mov eax, dword [ebp + 0xc]
mov dword [0x50f270], 0
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00405f20
mov eax, dword [0x514780]
test eax, eax
jne 0x4bce89
call fcn.0041b310
call fcn.00417510
cmp dword [0x50f40c], 0
je 0x4bd036
cmp dword [0x514798], 0
je 0x4bcce2
cmp dword [0x50f40c], 0
je 0x4bd1d1
mov dword [esp], str.using_external_linker_script:
call fcn.00418420
mov dword [esp], str._n_n
call fcn.00418420
cmp dword [0x50f40c], 0
je 0x4bd1e2
mov dword [esp], 0x2001
call fcn.004a05f0
mov ebx, eax
mov eax, dword [0x50f40c]
mov dword [esp], eax
call sub.msvcrt.dll_rewind
jmp 0x4bcc9c
mov byte [ebx + eax], 0
mov dword [esp], ebx
call fcn.00418420
mov eax, dword [0x50f40c]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
test eax, eax
jne 0x4bcc90
mov eax, dword [0x50f40c]
mov dword [esp], eax
call sub.msvcrt.dll_rewind
mov dword [esp], ebx
call sub.msvcrt.dll_free
mov dword [esp], str._n_n
call fcn.00418420
cmp dword [0x5147c4], 0
jne 0x4bce6f
call fcn.0040e9f0
cmp dword [ebp + 8], 2
je 0x4bce96
cmp dword [0x50f270], 0
jne 0x4bcd54
cmp dword [0x5148a0], 0
jne 0x4bcd19
cmp dword [0x5147c4], 0
je 0x4bcd48
mov dword [esp], 0
call fcn.004a7250
mov dword [esp], str._P_F:_missing_argument_to__m_n
call fcn.00418450
jmp 0x4bca10
mov dword [esp], edx
call fcn.004a95a0
mov dword [0x5147fc], eax
jmp 0x4bc855
mov dword [esp], str._P_F:_no_input_files_n
call fcn.00418450
cmp dword [0x514800], 0
jne 0x4bd01d
call fcn.004174a0
mov ebx, dword [0x51476c]
test ebx, ebx
je 0x4bcd95
mov dword [esp + 4], 0x4d2a60
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4bd0a0
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [0x514770], eax
call fcn.004105c0
movzx eax, byte [0x514820]
and eax, 3
cmp al, 2
mov eax, dword [0x514850]
je 0x4bd0f2
or dword [eax + 0x28], 0x40
mov eax, dword [0x51482c]
test al, 1
je 0x4bcdee
mov esi, dword [0x514850]
mov edx, dword [esi + 0x28]
mov ecx, edx
and edx, 0xff80001f
shr ecx, 5
and ecx, 0x3ffff
mov ebx, ecx
or bh, 0x40
shl ebx, 5
or edx, ebx
cmp eax, 5
mov dword [esi + 0x28], edx
je 0x4bd178
call fcn.00414680
cmp dword [0x514770], 0
je 0x4bce01
call fcn.0040c910
cmp dword [0x5147b0], 0
je 0x4bce1f
mov eax, dword [0x514770]
test eax, eax
je 0x4bd22e
mov dword [esp], eax
call fcn.00419bb0
cmp dword [0x5146f4], 0
je 0x4bce2d
call fcn.00419f20
cmp dword [0x5147c8], 0
jne 0x4bd013
call fcn.00417460
call fcn.0040b140
cmp dword [0x514724], 0
jne 0x4bcea8
cmp dword [0x50f404], 0
jne 0x4bcea8
cmp dword [0x514800], 0
jne 0x4bd214
mov dword [esp], 1
call fcn.004a7250
call fcn.0040d1f0
mov dword [esp], 0x4d2a39
mov dword [esp + 4], eax
call fcn.00418420
jmp 0x4bccef
mov dword [esp], eax
call fcn.0044e550
jmp 0x4bcc1a
cmp dword [0x5148a0], 0
je 0x4bccfe
jmp 0x4bcd19
mov eax, dword [0x514850]
mov dword [esp], eax
call fcn.004586f0
test eax, eax
je 0x4bd0fb
movzx eax, byte [0x514820]
and eax, 3
cmp al, 2
je 0x4bcff7
cmp dword [0x5147ac], 0
je 0x4bcff7
mov edx, dword [0x4be0a0]
xor eax, eax
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
lea esi, [ecx - 1]
cmp esi, 3
jg 0x4bd191
mov dword [esp], 0x1000
add esi, 5
call fcn.004a05f0
mov dword [esp], esi
mov ebx, eax
call fcn.004a05f0
mov esi, dword [0x4be0a0]
mov dword [esp + 4], esi
mov edi, eax
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
xor eax, eax
or ecx, 0xffffffff
mov dword [esp + 0x28], edi
mov edx, edi
repne scasb al, byte es:[edi]
mov edi, edx
not ecx
lea eax, [edx + ecx - 1]
mov dword [eax], 0x6578652e
mov byte [eax + 4], 0
mov dword [esp], esi
mov dword [esp + 4], 0x4d2ad7
call sub.msvcrt.dll_fopen
mov dword [esp + 4], 0x4d2ada
mov dword [esp], edi
mov esi, eax
call sub.msvcrt.dll_fopen
test esi, esi
mov dword [esp + 0x2c], eax
je 0x4bd28f
cmp dword [esp + 0x2c], 0
jne 0x4bcfa4
jmp 0x4bd276
mov eax, dword [esp + 0x2c]
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
cmp eax, edi
jne 0x4bd1fb
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x1000
mov dword [esp + 4], 1
mov dword [esp], ebx
call sub.msvcrt.dll_fread
test eax, eax
mov edi, eax
jg 0x4bcf80
mov dword [esp], esi
call fcn.004bc0f0
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call fcn.004bc0f0
add eax, 1
je 0x4bd25d
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], ebx
call sub.msvcrt.dll_free
cmp dword [0x514754], 0
jne 0x4bd115
mov dword [0x4be0a0], 0
jmp 0x4bcd19
call fcn.00411ee0
jmp 0x4bce3a
mov eax, dword [esp + 0x20]
mov dword [esp], str._P:_mode__s_n
mov dword [esp + 4], eax
call fcn.00418420
jmp 0x4bcd61
mov eax, dword [0x5147f4]
test eax, eax
je 0x4bd063
mov dword [esp], eax
call fcn.00419100
mov dword [0x5146d0], 1
call fcn.00401730
cmp dword [0x50f40c], 0
jne 0x4bcc31
lea eax, [esp + 0x3c]
mov dword [esp], eax
call fcn.00417550
cmp dword [esp + 0x3c], 0
je 0x4bd23b
mov dword [esp], eax
call fcn.00419110
mov dword [0x5146d0], 1
call fcn.00401730
mov dword [0x50f0a0], 0
jmp 0x4bcc31
mov dword [esp + 4], 0x4d2a62
mov dword [esp], ebx
call sub.msvcrt.dll_fopen
test eax, eax
mov dword [0x514770], eax
jne 0x4bcd95
mov dword [esp], 1
call fcn.0044baf0
mov eax, dword [0x51476c]
mov dword [esp], str._P_F:_cannot_open_map_file__s:__E_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bcd95
mov dword [0x514790], 0xffffffff
jmp 0x4bc86f
and dword [eax + 0x28], 0xffffffbf
jmp 0x4bcdb5
mov eax, dword [0x514850]
mov dword [esp], str._F_B:_final_close_failed:__E_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bcebd
call fcn.004a8df0
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
sub ebx, dword [esp + 0x18]
add eax, 0x20
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, ebx
mov ecx, 0xf4240
cdq
idiv ecx
mov dword [esp + 4], str._s:_total_time_in_link:__ld._06ld_n
mov dword [esp + 0xc], eax
mov eax, dword [0x51478c]
mov dword [esp + 0x10], edx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
jmp 0x4bd004
or ecx, 0x24000
and edx, 0xff80001f
shl ecx, 5
or edx, ecx
mov dword [esi + 0x28], edx
jmp 0x4bcdee
lea edi, [ecx - 5]
mov ebx, dword [sym.imp.msvcrt.dll__stricmp]
add edx, edi
mov dword [esp + 4], str..exe
mov dword [esp], edx
call ebx
test eax, eax
je 0x4bcff7
add edi, dword [0x4be0a0]
mov dword [esp + 4], str..dll
mov dword [esp], edi
call ebx
test eax, eax
jne 0x4bcef9
jmp 0x4bcff7
mov dword [esp], str.using_internal_linker_script:
call fcn.00418420
jmp 0x4bcc57
lea eax, [esp + 0x3c]
mov dword [esp], eax
call fcn.00417550
mov dword [esp], eax
call fcn.00418420
jmp 0x4bccd6
mov eax, dword [esp + 0x28]
mov dword [esp], str._P:_Error_writing_file___s_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bcfa4
mov eax, dword [0x4be0a0]
mov dword [esp], str._P:_link_errors_found__deleting_executable___s_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bce63
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
jmp 0x4bce17
mov dword [esp + 8], 1
mov dword [esp + 4], str.built_in_linker_script
mov dword [esp], eax
mov dword [0x50f0a0], eax
call fcn.00405b80
jmp 0x4bd082
mov eax, dword [esp + 0x28]
mov dword [esp], str._P:_Error_closing_file___s_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bcfe3
mov eax, dword [esp + 0x28]
mov dword [esp], str._P_F:_unable_to_open_for_destination_of_copy___s_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bcfa4
mov eax, dword [0x4be0a0]
mov dword [esp], str._P_F:_unable_to_open_for_source_of_copy___s_n
mov dword [esp + 4], eax
call fcn.00418450
jmp 0x4bcf73