Function at 0x479790
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x4c
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x49ec60
mov esi, ecx
lea eax, [ebp - 0x18]
mov ecx, dword fs:[0]
test edi, edi
mov dword [ebp - 0x18], ecx
mov dword fs:[0], eax
je 0x4797de
push edx
call dword [sym.imp.kernel32.dll_GetStdHandle]
test eax, eax
je 0x4797ea
cmp eax, 0xffffffff
jne 0x479806
call dword [sym.imp.kernel32.dll_GetLastError]
jmp 0x4797ef
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x4797f5
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x4c
pop esi
pop edi
pop ebx
pop ebp
ret
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x40], 0
push ecx
push eax
mov ebx, eax
call dword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x47987e
mov dword [ebp - 0x28], ebx
mov ebx, dword [ebp + 0x10]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x4798ce
mov ecx, dword [ebp + 8]
cmp al, 4
jae 0x479a3e
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x479929
mov byte [ebx + eax], cl
mov edi, ebx
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx ebx, byte [eax + 0x4e0474]
cmp cl, bl
mov dword [ebp - 0x58], ebx
jae 0x479945
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x4797f5
lea eax, [ebp - 0x24]
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0x103
push 0
push 0
push edi
push dword [ebp + 8]
push eax
push 0
push 0
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtWriteFile]
cmp eax, 0x103
jne 0x4798c3
push 0xffffffffffffffff
push ebx
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x24]
cmp eax, 0x103
je 0x479a6e
test eax, eax
js 0x47992f
mov eax, dword [ebp - 0x20]
mov bl, 4
jmp 0x479938
mov edx, dword [ebp + 8]
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [ebp - 0x4c]
cmovb eax, edi
push eax
call fcn.0040e120
add esp, 4
cmp dword [ebp - 0x4c], 0
je 0x479978
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x479992
mov edx, dword [ebp + 8]
cmp eax, edi
ja 0x479ade
lea ecx, [ebp - 0x40]
push eax
call fcn.0040e120
add esp, 4
cmp dword [ebp - 0x40], 0
jne 0x479aec
mov eax, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x38]
jmp 0x47997e
mov byte [ebx + 4], 0
jmp 0x479969
xor ebx, ebx
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x4797f5
movzx eax, cl
cmp cl, 5
jae 0x479acd
lea ecx, [ebp - 0x4c]
mov edx, edi
push eax
call fcn.0040e120
add esp, 4
cmp dword [ebp - 0x4c], 0
mov byte [edi + 4], 0
je 0x4799be
mov byte [esi], 2
mov dword [esi + 4], 0x4e05c4
jmp 0x4797f5
mov eax, dword [ebp - 0x48]
mov edi, dword [ebp - 0x44]
mov edx, dword [ebp - 0x28]
mov ecx, esi
push edi
push eax
call fcn.00479b50
add esp, 8
jmp 0x4797f5
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x4e0474]
cmp ecx, 2
jb 0x479a12
cmp ecx, edi
jbe 0x479a12
mov cl, 4
mov byte [ebx], al
mov dword [esi + 4], 1
mov byte [ebx + 4], 1
mov byte [esi], cl
jmp 0x4797f5
mov ecx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x48]
cmp ecx, ebx
mov dword [ebp - 0x24], ecx
jne 0x479b13
mov edx, dword [ebp - 0x28]
lea edi, [ebp - 0x40]
mov ecx, edi
push ebx
push eax
call fcn.00479b50
add esp, 8
movzx eax, byte [ebp - 0x40]
cmp al, 4
jne 0x479a22
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x24], ebx
cmp eax, ebx
mov dword [ebp - 0x54], eax
je 0x47986f
mov dword [ebp - 0x40], 0
lea ecx, [ebp - 0x54]
lea edx, [ebp - 0x24]
push 0x4e0664
push edi
call fcn.004a3590
mov al, 2
mov dword [esi + 4], 0x4e05c4
mov byte [esi], al
jmp 0x4797f5
movzx ecx, byte [ebp - 0x3d]
movzx edi, word [ebp - 0x3f]
mov edx, dword [ebp - 0x3c]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x4797f5
lea ecx, [ebp - 0x40]
mov edx, 0x4e0634
mov dword [ebp - 0x40], 0x4e062c
mov dword [ebp - 0x3c], 1
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x38], str._rustc_aedd173a2c086e558c2b66d3743b344f977621a7librarycore_srccharmethods.rs8
mov dword [ebp - 0x34], 0
call fcn.004a0200
lea edx, [ebp - 0x40]
lea eax, [ebp - 0x58]
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x40], 0x4e01d8
mov dword [ebp - 0x3c], 1
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x28], ebx
mov byte [ebp - 0x50], 0
mov dword [ebp - 0x10], 0
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], 0
lea eax, [ebp - 0x54]
push edx
push eax
push ecx
call fcn.00478470
add esp, 0xc
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x48]
call fcn.004785a0
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x4e0644
call fcn.004a02f0
mov ecx, eax
mov edx, edi
push 0x4e05d0
call fcn.004a02f0
movsd xmm0, qword [ebp - 0x3c]
lea eax, [ebp - 0x24]
mov ecx, str.called__Result::unwrap____on_an__Err__value
mov edx, 0x2b
movsd qword [ebp - 0x24], xmm0
push 0x4e05e0
push 0x4dec80
push eax
call fcn.004a05e0
mov dword [ebp - 0x40], 0
lea ecx, [ebp - 0x58]
lea edx, [ebp - 0x24]
push 0x4e0654
lea eax, [ebp - 0x40]
push eax
call fcn.004a3590
nop
push ebp
sub esp, 0x24
add ebp, 0xc
push dword [ebp - 0x28]
call dword [sym.imp.kernel32.dll_CloseHandle]
add esp, 0x24
pop ebp
ret