Function at 0x4046f6
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff0
push esi
push edi
push ebx
push 0x410
lea eax, [ebp - 0x10]
push eax
call fcn.00403940
lea esi, [0x47a190]
mov ebx, 0x14b
mov edi, dword [ebp - 0x10]
mov al, byte [esi + 2]
cmp al, 7
jne 0x404766
mov word [edi], 0x3b
add edi, 2
call fcn.004046c5
mov eax, dword [esi + 4]
or eax, eax
je 0x404741
push 1
push edi
push eax
call fcn.004059c0
add edi, eax
mov dword [edi], 0xa000d
add edi, 4
mov edx, edi
sub edx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 4]
push eax
push edx
push dword [ebp - 0x10]
push dword [ebp + 8]
call sub.KERNEL32.dll_WriteFile
jmp 0x4049ad
cmp al, 5
jne 0x4047db
push ebx
and dword [ebp - 8], 0
movzx ebx, word [esi]
add ebx, dword [ebp + 0xc]
mov ebx, dword [ebx]
or ebx, ebx
je 0x4047d5
lea eax, [ebp - 8]
push eax
push ebx
call fcn.00403d80
or eax, eax
je 0x4047d3
push eax
mov edi, dword [ebp - 0x10]
call fcn.004046c5
mov dword [edi], 0x22003d
add edi, 4
push edi
call sub.KERNEL32.dll_lstrcpyW
push edi
call sub.KERNEL32.dll_lstrlenW
add eax, eax
add edi, eax
mov word [edi], 0x22
mov dword [edi + 2], 0xa000d
add edi, 6
mov edx, edi
sub edx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 4]
push eax
push edx
push dword [ebp - 0x10]
push dword [ebp + 8]
call sub.KERNEL32.dll_WriteFile
or eax, eax
jne 0x40477b
pop ebx
jmp 0x4049ad
call fcn.004046c5
mov word [edi], 0x3d
add edi, 2
mov dword [ebp - 0xc], edi
movzx edx, word [esi]
add edx, dword [ebp + 0xc]
movzx ecx, word [esi]
add ecx, dword [ebp + 0x10]
mov al, byte [esi + 2]
cmp al, 1
je 0x404802
cmp al, 2
jne 0x40481f
mov eax, dword [edx]
cmp eax, dword [ecx]
je 0x404988
push 0x100
push edi
push eax
call fcn.004059c0
add edi, eax
jmp 0x404988
cmp al, 3
jne 0x404897
push 0x10
push ecx
push edx
call sub.ntdll.dll_RtlCompareMemory
cmp eax, 0x10
je 0x404988
movzx edx, word [esi]
add edx, dword [ebp + 0xc]
push 0x100
push edi
push dword [edx]
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
push 0x100
push edi
push dword [edx + 4]
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
push 0x100
push edi
push dword [edx + 8]
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
push 0x100
push edi
push dword [edx + 0xc]
call fcn.004059c0
add edi, eax
jmp 0x404988
cmp al, 4
jne 0x4048d5
mov eax, dword [edx]
or eax, eax
je 0x404988
cmp word [eax], 0
je 0x404988
mov word [edi], 0x22
add edi, 2
push eax
push edi
call sub.KERNEL32.dll_lstrcpyW
push edi
call sub.KERNEL32.dll_lstrlenW
add eax, eax
add edi, eax
mov word [edi], 0x22
add edi, 2
jmp 0x404988
cmp al, 6
jne 0x404988
movzx eax, byte [esi + 3]
imul eax, eax, 4
add eax, 2
push eax
push eax
push ecx
push edx
call sub.ntdll.dll_RtlCompareMemory
pop ecx
cmp eax, ecx
je 0x404988
movzx edx, word [esi]
add edx, dword [ebp + 0xc]
movzx eax, byte [edx]
push 1
push edi
push eax
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
movsx eax, byte [edx + 1]
push 0x100
push edi
push eax
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
add edx, 2
movzx ecx, byte [esi + 3]
movzx eax, byte [edx]
and eax, 0xfffffffc
push 1
push edi
push eax
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
movzx eax, byte [edx + 1]
push 1
push edi
push eax
call fcn.004059c0
add edi, eax
mov word [edi], 0x2c
add edi, 2
movzx eax, word [edx + 2]
push 1
push edi
push eax
call fcn.004059c0
add edi, eax
cmp ecx, 1
jbe 0x404982
mov word [edi], 0x2c
add edi, 2
add edx, 4
dec ecx
jne 0x404936
cmp edi, dword [ebp - 0xc]
jbe 0x4049ad
mov dword [edi], 0xa000d
add edi, 4
mov edx, edi
sub edx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 4]
push eax
push edx
push dword [ebp - 0x10]
push dword [ebp + 8]
call sub.KERNEL32.dll_WriteFile
add esi, 0x10
dec ebx
jne 0x404718
push dword [ebp - 0x10]
call fcn.0040398e
pop ebx
pop edi
pop esi
leave
ret 0xc