Function at 0x4c8520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5603f8
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x5d0074]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov al, byte [edi + 0x18]
lea esi, [edi + 0x18]
mov dword [ebp - 0x34], edi
mov byte [ebp - 0x30], 0
test al, al
jne 0x4c8566
push edi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov al, 1
xchg byte [esi], al
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
mov ecx, edi
call fcn.004c8820
lea ecx, [ebp - 0x1c]
call fcn.004c8740
mov byte [ebp - 4], 1
lea edx, [ebp - 0x20]
mov ecx, dword [eax]
push 0
push edx
mov eax, dword [ecx - 0xc]
add eax, eax
push eax
push ecx
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov byte [ebp - 4], 0
or ebx, 0xffffffff
mov edx, dword [ebp - 0x1c]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4c85cb
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
call fcn.00411fd0
mov ecx, eax
test ecx, ecx
je 0x4c8729
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 3
mov eax, 0x58bab8
lea ecx, [ebp - 0x14]
test eax, 0xffff0000
jne 0x4c8603
movzx eax, ax
push eax
call fcn.00412350
jmp 0x4c860f
push 1
push 0x58bab8
call fcn.004126c0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x24]
mov esi, dword [ebp - 0x14]
push 0
push ecx
mov eax, dword [esi - 0xc]
add eax, eax
push eax
push esi
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4c8650
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x28]
push 0
push edx
mov ecx, dword [eax]
mov eax, dword [ecx - 0xc]
add eax, eax
push eax
push ecx
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
call fcn.00411fd0
mov ecx, eax
test ecx, ecx
je 0x4c8733
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 6
mov eax, 0x57fe68
lea ecx, [ebp - 0x18]
test eax, 0xffff0000
jne 0x4c86ac
movzx eax, ax
push eax
call fcn.00412350
jmp 0x4c86b8
push 2
push 0x57fe68
call fcn.004126c0
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x2c]
mov esi, dword [ebp - 0x18]
push 0
push ecx
mov eax, dword [esi - 0xc]
add eax, eax
push eax
push esi
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [edi + 0x30]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov byte [ebp - 4], 0
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x4c86f7
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov al, byte [ebp - 0x30]
test al, al
jne 0x4c8715
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
lea ecx, [ebp - 0x30]
xchg byte [ecx], 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 4
push 0x80004005
call fcn.004126a0
push 0x80004005
call fcn.004126a0
int3