Function at 0x40d7e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41d7d0
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push esi
push edi
mov eax, dword [0x424084]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ebp + 8]
mov dword [ebp - 4], 0
cmp byte [esi + 0x7c], 0
jne 0x40d9a8
lea edi, [esi + 0x60]
mov bl, 1
push edi
mov byte [ebp - 4], bl
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp byte [esi + 0x48], 0
jne 0x40d84d
mov ecx, esi
call fcn.0040da00
mov ecx, esi
call fcn.0040cfb0
test al, al
je 0x40d9a1
mov byte [esi + 0x48], bl
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x18]
push ecx
mov ecx, dword [ebp + 0x14]
push edx
lea eax, [ebp - 0x18]
push eax
call fcn.0040d280
lea ecx, [ebp + 0xc]
push ecx
lea edx, [ebp + 0x10]
push edx
lea ebx, [ebp - 0x18]
mov byte [ebp - 4], 2
call fcn.0040e340
add esp, 8
push eax
lea eax, [ebp - 0x14]
push eax
mov ebx, 0x420fa0
mov byte [ebp - 4], 3
call fcn.0040e3f0
add esp, 8
mov byte [ebp - 4], 5
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d8b1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
cmp dword [eax - 4], 1
mov ebx, dword [eax - 0xc]
jle 0x40d8ca
push ebx
lea edx, [ebp - 0x14]
push edx
call fcn.0040e5b0
mov eax, dword [ebp - 0x14]
push 0
lea ecx, [ebp - 0x1c]
push ecx
lea edx, [ebx + ebx]
push edx
push eax
mov eax, dword [esi + 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
inc dword [esi + 0x78]
mov eax, dword [esi + 0x78]
cdq
mov ecx, 0xa
idiv ecx
test edx, edx
jne 0x40d8fb
mov edx, dword [esi + 0x5c]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [esi + 0x78]
cdq
mov ecx, 0x64
idiv ecx
test edx, edx
jne 0x40d918
mov ecx, esi
call fcn.0040d5c0
mov dword [esi + 0x78], 0
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d942
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d965
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d98b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d9ce
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14