Function at 0x4107c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x54
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x417cf0
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 0x410810
push edx
call dword [sym.imp.kernel32.dll_GetStdHandle]
test eax, eax
je 0x41081c
mov ebx, eax
cmp eax, 0xffffffff
jne 0x410838
call dword [sym.imp.kernel32.dll_GetLastError]
jmp 0x410821
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x410827
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x54
pop esi
pop edi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x38]
mov dword [ebp - 0x38], 0
push eax
push ebx
call dword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x4108ac
mov dword [ebp - 0x20], ebx
mov ebx, dword [ebp + 0x10]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x4108fc
mov ecx, dword [ebp + 8]
cmp al, 4
jae 0x410a68
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x41095a
mov byte [ebx + eax], cl
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx eax, byte [eax + 0x42af00]
cmp cl, al
mov dword [ebp - 0x5c], eax
jae 0x410976
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x410827
lea eax, [ebp - 0x40]
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x40], 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 0x4108f1
push 0xffffffffffffffff
push ebx
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x40]
cmp eax, 0x103
je 0x410a98
test eax, eax
js 0x410960
mov eax, dword [ebp - 0x3c]
mov bl, 4
jmp 0x410969
mov edx, dword [ebp + 8]
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [ebp - 0x4c]
cmovb eax, edi
push eax
call fcn.00406670
add esp, 4
cmp dword [ebp - 0x4c], 0
je 0x4109ab
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x4109c5
mov edx, dword [ebp + 8]
cmp eax, edi
ja 0x410b06
lea ecx, [ebp - 0x38]
push eax
call fcn.00406670
add esp, 4
cmp dword [ebp - 0x38], 0
mov edx, dword [ebp - 0x20]
jne 0x410b14
mov eax, dword [ebp - 0x34]
mov edi, dword [ebp - 0x30]
jmp 0x4109b4
mov byte [ebx + 4], 0
jmp 0x41099c
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 0x410827
mov edi, eax
movzx eax, cl
cmp cl, 5
jae 0x410af5
lea ecx, [ebp - 0x4c]
mov edx, ebx
push eax
call fcn.00406670
add esp, 4
cmp dword [ebp - 0x4c], 0
mov byte [ebx + 4], 0
je 0x4109e5
mov byte [esi], 2
mov dword [esi + 4], 0x42b050
jmp 0x410827
mov eax, dword [ebp - 0x48]
mov edi, dword [ebp - 0x44]
mov edx, dword [ebp - 0x20]
mov ecx, esi
push edi
push eax
call fcn.00410b80
add esp, 8
jmp 0x410827
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x42af00]
cmp ecx, edi
jbe 0x410a3b
mov byte [ebx], al
mov byte [ebx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x410a42
mov ecx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x48]
cmp ecx, edi
mov dword [ebp - 0x60], ecx
jne 0x410b3b
mov edx, dword [ebp - 0x20]
mov ebx, edi
lea edi, [ebp - 0x38]
mov ecx, edi
push ebx
push eax
call fcn.00410b80
add esp, 8
movzx eax, byte [ebp - 0x38]
cmp al, 4
jne 0x410a4c
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x40], ebx
cmp eax, ebx
mov dword [ebp - 0x54], eax
je 0x41089d
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x54]
lea edx, [ebp - 0x40]
push 0x42b0f0
push edi
call fcn.00419640
mov al, 2
mov ecx, 0x42b050
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x410827
movzx ecx, byte [ebp - 0x35]
movzx edi, word [ebp - 0x37]
mov edx, dword [ebp - 0x34]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x410827
lea ecx, [ebp - 0x38]
mov edx, 0x42b0c0
mov dword [ebp - 0x38], 0x42b0b8
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x30], 4
mov dword [ebp - 0x2c], 0
call fcn.00418bf0
lea eax, [ebp - 0x58]
mov dword [ebp - 0x38], 0x42aed0
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x20], ebx
mov byte [ebp - 0x50], 0
mov dword [ebp - 0x10], 0
lea ecx, [ebp - 0x4c]
lea edx, [ebp - 0x54]
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x38]
mov dword [ebp - 0x2c], 0
push eax
call fcn.0040f7e0
add esp, 4
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x48]
call fcn.0040f970
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x42b0d0
call fcn.00418ce0
mov ecx, eax
mov edx, edi
push 0x42b05c
call fcn.00418ce0
movsd xmm0, qword [ebp - 0x34]
lea eax, [ebp - 0x40]
mov ecx, str.called__Result::unwrap____on_an__Err__value
mov edx, 0x2b
movsd qword [ebp - 0x40], xmm0
push 0x42b06c
push 0x42a318
push eax
call fcn.00418ec0
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x5c]
lea edx, [ebp - 0x60]
push 0x42b0e0
lea eax, [ebp - 0x38]
push eax
call fcn.00419640
nop word cs:[eax + eax]
push ebp
sub esp, 0x24
add ebp, 0xc
push dword [ebp - 0x20]
call dword [sym.imp.kernel32.dll_CloseHandle]
add esp, 0x24
pop ebp
ret