Function at 0x40e650
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4be373
mov eax, dword fs:[0]
push eax
sub esp, 0x114
mov eax, dword [0x4e9688]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
lea eax, [edi + 4]
push eax
mov dword [ebp - 0x110], edi
mov dword [ebp - 0x114], eax
mov dword [ebp - 0x120], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, dword [edi + 0x180]
mov ecx, dword [eax + 4]
lea esi, [edi + 0x168]
push ecx
mov ecx, esi
call fcn.004156a0
mov eax, dword [esi + 0x18]
mov dword [eax + 4], eax
mov eax, dword [esi + 0x18]
mov dword [esi + 0x1c], ebx
mov dword [eax], eax
mov esi, dword [esi + 0x18]
lea edx, [ebp - 0xf0]
mov dword [esi + 8], esi
push edx
mov dword [edi + 0x1c], ebx
call fcn.0040ecb0
mov byte [ebp - 4], 1
mov ecx, dword [edi + 0x20]
lea edi, [ebp - 0xf0]
call fcn.0040edd0
mov dword [ebp - 0x104], ebx
call fcn.0040f470
mov ebx, eax
test ebx, ebx
je 0x40e830
mov eax, dword [ebx + 0x14]
mov edi, dword [ebx]
mov eax, dword [eax]
mov dword [ebp - 0x108], eax
mov dword [ebp - 0x100], edi
mov esi, eax
test edi, edi
jne 0x40e7d0
call fcn.00492f40
xor ecx, ecx
mov eax, esi
cmp eax, dword [ecx + 0x14]
jne 0x40e738
call fcn.00492f40
mov eax, dword [ebp - 0x108]
mov eax, dword [eax + 8]
mov dword [ebp - 0x108], eax
mov ecx, dword [ebx + 0x14]
mov eax, dword [ebx]
mov dword [ebp - 0x118], ecx
test edi, edi
je 0x40e754
cmp edi, eax
je 0x40e759
call fcn.00492f40
cmp esi, dword [ebp - 0x118]
je 0x40e7e5
test edi, edi
jne 0x40e7d7
call fcn.00492f40
cmp esi, dword [edi + 0x14]
jne 0x40e778
call fcn.00492f40
mov eax, dword [ebp - 0x108]
sub eax, dword [esi + 8]
mov ecx, dword [ebp - 0x110]
mov edi, dword [ecx + 0x190]
push 0
cdq
push 0x15180
push edx
push eax
call fcn.004a7ba0
xor ecx, ecx
cmp edx, ecx
jg 0x40e7df
jl 0x40e7a8
cmp eax, edi
jae 0x40e7df
mov eax, dword [ebp - 0x100]
test eax, eax
jne 0x40e7db
call fcn.00492f40
xor eax, eax
cmp esi, dword [eax + 0x14]
jne 0x40e7c3
call fcn.00492f40
mov esi, dword [esi]
mov edi, dword [ebp - 0x100]
jmp 0x40e741
mov ecx, dword [edi]
jmp 0x40e728
mov edi, dword [edi]
jmp 0x40e76e
mov eax, dword [eax]
jmp 0x40e7b9
mov edi, dword [ebp - 0x100]
mov edx, dword [ebx + 0x14]
mov eax, dword [ebx]
mov dword [ebp - 0x118], edx
test edi, edi
je 0x40e7f8
cmp edi, eax
je 0x40e7fd
call fcn.00492f40
cmp esi, dword [ebp - 0x118]
je 0x40e826
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx]
push eax
push ecx
push esi
push edi
lea eax, [ebp - 0x11c]
push eax
mov eax, ebx
call fcn.004119d0
mov dword [ebp - 0x104], 1
lea ecx, [ebp - 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [ebp - 0x110]
mov eax, dword [esi + 0x20]
cmp dword [eax - 0xc], 0
jne 0x40e863
lea edx, [ebp - 0xf0]
push edx
mov byte [ebp - 4], 0
call fcn.0040d3a0
mov eax, dword [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40ea09
xor edi, edi
mov dword [ebp - 0x108], edi
mov byte [ebp - 4], 2
cmp dword [ebp - 0x104], edi
je 0x40e9ea
cmp dword [ebx + 0x18], edi
jbe 0x40e9ea
push edi
push 0x80
push 4
push edi
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x40e9c8
call fcn.004230e0
test eax, eax
jne 0x40e9ea
xor eax, eax
push eax
lea ecx, [ebp - 0xfc]
push ecx
push eax
push edi
mov dword [ebp - 0x100], eax
mov dword [ebp - 0xfc], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40e8e3
call fcn.004230e0
test eax, eax
jge 0x40e8e3
jne 0x40e9df
push 0
lea edx, [ebp - 0x104]
push edx
push 0x64
add esi, 0x24
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40e90a
call fcn.004230e0
test eax, eax
jne 0x40e9df
push 0
push 0x64
lea esi, [ebp - 0x108]
call fcn.00422e30
test eax, eax
jne 0x40e9df
test edi, edi
je 0x40e936
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x108], 0
mov eax, dword [ebx + 0x14]
mov eax, dword [eax]
mov esi, dword [ebx]
mov byte [ebp - 0xf1], 1
mov dword [ebp - 0x100], esi
mov dword [ebp - 0xfc], eax
mov edi, dword [ebx + 0x14]
mov eax, dword [ebx]
test esi, esi
je 0x40e95d
cmp esi, eax
je 0x40e962
call fcn.00492f40
cmp dword [ebp - 0xfc], edi
je 0x40e9d9
mov dword [ebp - 0x104], 0xffffffff
test esi, esi
jne 0x40e9d5
call fcn.00492f40
mov eax, dword [ebp - 0xfc]
cmp eax, dword [esi + 0x14]
jne 0x40e98d
call fcn.00492f40
mov ecx, dword [ebp - 0xfc]
mov edx, dword [ebp - 0x110]
add ecx, 8
push ecx
push edx
lea edx, [ebp - 0xf1]
lea ecx, [ebp - 0x104]
call fcn.0040e2b0
lea edi, [ebp - 0x11c]
lea esi, [ebp - 0x100]
call fcn.00414290
mov esi, dword [ebp - 0x100]
jmp 0x40e950
mov dword [ebp - 0x108], eax
mov edi, eax
jmp 0x40e8b1
mov esi, dword [esi]
jmp 0x40e97d
mov edi, dword [ebp - 0x108]
test edi, edi
je 0x40e9ea
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0xf0]
push eax
mov byte [ebp - 4], 0
call fcn.0040d3a0
mov ecx, dword [ebp - 0x114]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00491281
mov esp, ebp
pop ebp
ret