Function at 0x40bf77
Capabilities:
Write file on windows

Disassembly:
push 0x7c
mov eax, 0x426f08
call fcn.00418141
mov edi, ecx
mov dword [ebp - 0x5c], edi
xor eax, eax
mov bl, al
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x6c], eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], eax
call fcn.00403c37
mov dword [ebp - 0x64], eax
xor eax, eax
lea ecx, [ebp - 0x78]
inc eax
mov byte [ebp - 4], al
lea eax, [ebp - 0x64]
push eax
call fcn.004014d1
lea ecx, [ebp - 0x64]
call fcn.0040300e
xor eax, eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], eax
mov byte [ebp - 4], 2
mov esi, dword [edi + 0x44]
mov edi, dword [edi + 0x48]
jmp 0x40c01b
push esi
call fcn.00406273
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 3
push eax
lea ecx, [ebp - 0x88]
call fcn.0040115c
push eax
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 4
call fcn.00402f5e
lea ecx, [ebp - 0x88]
call fcn.00401269
push 0
push 1
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 2
call fcn.004062d8
add esi, 0x18
lea ecx, [ebp - 0x28]
cmp esi, edi
jne 0x40bfd7
push str.allowed_origins
call fcn.00405f0d
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 5
push eax
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x78]
call fcn.00401454
mov ecx, eax
call fcn.00402fb5
mov ecx, eax
call fcn.0040148f
xor edi, edi
mov byte [ebp - 4], 2
push edi
push 1
lea ecx, [ebp - 0x28]
call fcn.004062d8
push str.path
lea ecx, [ebp - 0x28]
call fcn.00405f0d
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x58]
mov esi, dword [ebp - 0x5c]
lea edx, [esi + 0x50]
call fcn.00407289
push eax
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 7
call fcn.004011ea
push eax
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 8
push eax
lea ecx, [ebp - 0x78]
call fcn.00401454
mov ecx, eax
call fcn.00402fb5
mov ecx, eax
call fcn.004013ac
lea ecx, [ebp - 0x88]
call fcn.00401269
push edi
push 1
lea ecx, [ebp - 0x58]
call fcn.004062d8
push edi
push 1
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 2
call fcn.004062d8
push str.description
lea ecx, [ebp - 0x28]
call fcn.00405f0d
push str.Info_Software_lp_Native_Host
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 9
call fcn.00401222
push eax
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xa
push eax
lea ecx, [ebp - 0x78]
call fcn.00401454
mov ecx, eax
call fcn.00402fb5
mov ecx, eax
call fcn.004013ac
lea ecx, [ebp - 0x88]
call fcn.00401269
push edi
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x28]
push 1
call fcn.004062d8
push str.name
lea ecx, [ebp - 0x28]
call fcn.00405f0d
push str.org.infosoftware.ext_host
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 0xb
call fcn.00401222
push eax
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xc
push eax
lea ecx, [ebp - 0x78]
call fcn.00401454
mov ecx, eax
call fcn.00402fb5
mov ecx, eax
call fcn.004013ac
lea ecx, [ebp - 0x88]
call fcn.00401269
push edi
push 1
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 2
call fcn.004062d8
push str.type
lea ecx, [ebp - 0x28]
call fcn.00405f0d
push str.stdio
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 0xd
call fcn.00401222
push eax
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xe
push eax
lea ecx, [ebp - 0x78]
call fcn.00401454
mov ecx, eax
call fcn.00402fb5
mov ecx, eax
call fcn.004013ac
lea ecx, [ebp - 0x88]
call fcn.00401269
push edi
inc edi
mov byte [ebp - 4], 2
push edi
lea ecx, [ebp - 0x28]
call fcn.004062d8
push ecx
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x78]
call fcn.0040172f
lea eax, [esi + 0x80]
cmp dword [eax + 0x14], 8
jb 0x40c1fb
mov eax, dword [eax]
push 0
push 0x80
push 2
push 0
push edi
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40c251
and dword [ebp - 0x5c], 0
lea eax, [ebp - 0x5c]
cmp dword [ebp - 0x2c], 0x10
lea ecx, [ebp - 0x40]
push 0
cmovae ecx, dword [ebp - 0x40]
push eax
push dword [ebp - 0x30]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c24a
mov eax, dword [ebp - 0x5c]
cmp eax, dword [ebp - 0x30]
movzx ebx, bl
cmove ebx, edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push edi
lea ecx, [ebp - 0x40]
call fcn.004062d8
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 0
call fcn.00403277
lea ecx, [ebp - 0x78]
call fcn.00401269
mov al, bl
call fcn.004180f0
ret