Function at 0x40bea6
Capabilities:
Write file on windows

Disassembly:
push 0x90
mov eax, 0x4167a3
call fcn.00415e12
mov dword [ebp - 0x78], ecx
xor edi, edi
mov dword [ebp - 0x8c], edi
mov dword [ebp - 0x88], edi
mov dword [ebp - 4], edi
xor ebx, ebx
inc ebx
mov byte [ebp - 4], bl
push 2
push edi
call dword [sym.imp.ole32.dll_CoInitializeEx]
test eax, eax
jns 0x40bee3
mov ecx, eax
call fcn.004107d2
mov dword [0x41a070], edi
mov dword [ebp - 0x80], edi
mov dword [ebp - 0x7c], edi
mov byte [ebp - 4], 2
mov byte [ebp - 4], 3
mov byte [ebp - 4], 4
mov byte [ebp - 4], 5
lea eax, [ebp - 0x90]
push eax
lea ecx, [ebp - 0x80]
call fcn.0040d987
mov byte [ebp - 4], 6
push dword [eax]
call fcn.0040bd6b
test eax, eax
js 0x40bedc
mov byte [ebp - 4], 7
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x90]
cmp dword [eax], edi
je 0x40bf32
mov dword [eax + 4], ebx
mov dword [ebp - 0x6c], edi
mov dword [ebp - 0x68], edi
mov byte [ebp - 4], 8
mov byte [ebp - 4], 9
mov byte [ebp - 4], 0xa
mov byte [ebp - 4], 0xb
lea eax, [ebp - 0x94]
push eax
lea ecx, [ebp - 0x6c]
call fcn.0040d987
mov byte [ebp - 4], 0xc
push dword [eax]
push ebx
push edi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x40bedc
mov byte [ebp - 4], 0xd
mov byte [ebp - 4], 0xb
mov eax, dword [ebp - 0x94]
cmp dword [eax], edi
je 0x40bf82
mov dword [eax + 4], ebx
push edi
push edi
push edi
push dword [ebp - 0x80]
push 0x4013a0
push dword [ebp - 0x6c]
call dword [sym.imp.ole32.dll_CoMarshalInterface]
test eax, eax
js 0x40bedc
cmp dword [ebp - 0x7c], 0
je 0x40bfbe
mov ecx, dword [ebp - 0x80]
test ecx, ecx
je 0x40bfbb
mov eax, dword [ecx]
push ecx
mov esi, dword [eax + 8]
mov ecx, esi
call dword [0x41b25c]
call esi
mov dword [ebp - 0x7c], edi
mov eax, dword [ebp - 0x6c]
mov esi, dword [eax]
push ebx
lea ecx, [ebp - 0x5c]
push ecx
push eax
mov ecx, dword [esi + 0x30]
call dword [0x41b25c]
call dword [esi + 0x30]
test eax, eax
js 0x40bedc
mov ecx, dword [ebp - 0x54]
mov dword [ebp - 0x64], ecx
call fcn.0040e63d
mov ebx, eax
mov dword [ebp - 0x74], ebx
mov dword [ebp - 0x70], edi
test ebx, ebx
je 0x40bffb
mov dword [ebp - 0x70], 1
mov byte [ebp - 4], 0xe
mov byte [ebp - 4], 0xf
mov byte [ebp - 4], 0x10
mov byte [ebp - 4], 0x11
mov eax, dword [ebp - 0x6c]
mov esi, dword [eax]
push edi
push edi
push edi
push edi
push eax
mov ecx, dword [esi + 0x14]
call dword [0x41b25c]
call dword [esi + 0x14]
mov eax, dword [ebp - 0x6c]
mov esi, dword [eax]
lea ecx, [ebp - 0x98]
push ecx
push dword [ebp - 0x64]
push ebx
push eax
mov ecx, dword [esi + 0xc]
call dword [0x41b25c]
call dword [esi + 0xc]
test eax, eax
js 0x40bedc
mov eax, dword [ebp - 0x98]
cmp eax, dword [ebp - 0x64]
je 0x40c05b
mov ecx, 0x80004005
jmp 0x40bede
cmp dword [ebp - 0x68], 0
je 0x40c07b
mov ecx, dword [ebp - 0x6c]
test ecx, ecx
je 0x40c078
mov eax, dword [ecx]
push ecx
mov esi, dword [eax + 8]
mov ecx, esi
call dword [0x41b25c]
call esi
mov dword [ebp - 0x68], edi
push edi
lea eax, [ebp - 0x60]
push eax
push 4
lea eax, [ebp - 0x64]
push eax
mov esi, dword [ebp - 0x78]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40c099
call fcn.004108b8
cmp dword [ebp - 0x60], 4
jne 0x40c051
push edi
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 0x64]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c094
mov eax, dword [ebp - 0x60]
cmp eax, dword [ebp - 0x64]
jne 0x40c051
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [0x41a54c]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
je 0x40c094
call fcn.0040be14
test eax, eax
js 0x40bedc
call dword [sym.imp.ole32.dll_CoUninitialize]
mov byte [ebp - 4], 0x12
mov byte [ebp - 4], 0x13
mov byte [ebp - 4], 0x14
mov byte [ebp - 4], 0xb
cmp dword [ebp - 0x70], 0
je 0x40c109
test ebx, ebx
je 0x40c106
mov edx, ebx
call fcn.0040e617
mov dword [ebp - 0x70], edi
mov byte [ebp - 4], 0x15
mov byte [ebp - 4], 0x16
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x6c]
call fcn.0040dcf2
mov byte [ebp - 4], 0x17
mov byte [ebp - 4], 0x18
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x80]
call fcn.0040dcf2
mov dword [ebp - 4], edi
or dword [ebp - 4], 0xffffffff
jmp 0x40c1f2
test byte [ebp - 0x8c], 2
je 0x40c200
call fcn.00412dfd
mov eax, edi
call fcn.00415d5f
ret