Function at 0x41c900
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
mov ebx, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 8], edi
mov dword [ebp + 0x10], 0
test ebx, ebx
je 0x41cb15
test edi, edi
je 0x41cb15
mov ecx, dword [ebp + 8]
push esi
cmp dword [ecx + 0x24], 0
je 0x41c966
mov dword [ebp + 0xc], edi
mov esi, 0x7fff
lea eax, [ebp + 0x10]
push 0
cmp edi, esi
push eax
cmovb esi, edi
push esi
push ebx
push dword [ecx + 0x20]
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
mov ecx, dword [ebp + 8]
lea ebx, [ebx + esi*2]
sub edi, esi
jne 0x41c935
mov eax, dword [ebp + 0xc]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ecx + 0x28]
cmp eax, 2
je 0x41ca91
cmp eax, 3
je 0x41ca91
cmp eax, 4
je 0x41c9a2
cmp eax, 1
je 0x41c9a2
push 0
lea eax, [ebp + 0x10]
push eax
push edi
push ebx
push dword [ecx + 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 8]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov esi, dword [ecx + 0x2c]
cmp esi, 0xffffffff
jne 0x41c9b2
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov esi, eax
lea eax, [edi + edi*4]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, eax
mov dword [ebp - 4], ecx
test ecx, ecx
jne 0x41c9e1
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push 0
push 0
lea eax, [edi + edi*4]
push eax
push ecx
push edi
push ebx
push 0
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
mov eax, dword [ebp - 4]
mov ecx, eax
mov dword [ebp + 0xc], ecx
test edi, edi
je 0x41ca75
mov ebx, dword [ebp + 8]
mov esi, ecx
cmp byte [esi], 0xa
je 0x41ca13
inc esi
sub edi, 1
jne 0x41ca08
push 0
lea edx, [ebp + 0x10]
mov eax, esi
push edx
sub eax, ecx
push eax
push ecx
push dword [ebx + 0x20]
mov dword [ebp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test edi, edi
je 0x41ca69
cmp byte [esi], 0xa
jne 0x41ca69
cmp esi, dword [ebp + 0xc]
je 0x41ca50
jbe 0x41ca41
cmp byte [esi - 1], 0xd
jne 0x41ca50
push 0
lea eax, [ebp + 0x10]
push eax
push 1
push 0x437dc0
jmp 0x41ca5d
push 0
lea eax, [ebp + 0x10]
push eax
push 2
push 0x437dbc
push dword [ebx + 0x20]
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
inc esi
dec edi
mov dword [ebp + 0xc], esi
mov ecx, esi
test edi, edi
jne 0x41ca06
mov eax, dword [ebp - 4]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp - 8]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov esi, ebx
cmp word [esi], 0xa
je 0x41caa1
add esi, 2
sub edi, 1
jne 0x41ca93
push 0
mov eax, esi
lea edx, [ebp + 0x10]
sub eax, ebx
push edx
and eax, 0xfffffffe
push eax
push ebx
push dword [ecx + 0x20]
mov dword [ebp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test edi, edi
je 0x41cb00
cmp word [esi], 0xa
jne 0x41cb00
cmp esi, ebx
je 0x41cae2
jbe 0x41cad3
cmp word [esi - 2], 0xd
jne 0x41cae2
push 0
lea eax, [ebp + 0x10]
push eax
push 2
push 0x436bec
jmp 0x41caef
push 0
lea eax, [ebp + 0x10]
push eax
push 4
push 0x437db4
mov ebx, dword [ebp + 8]
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebx + 0x20]
call eax
add esi, 2
dec edi
mov ecx, dword [ebp + 8]
mov ebx, esi
test edi, edi
jne 0x41ca91
mov eax, dword [ebp - 8]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc