Function at 0x4045d0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov edx, dword [ebp + 8]
push ebx
push esi
xor esi, esi
cmp edx, esi
push edi
mov dword [ebp - 0xc], esi
je 0x404612
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0x50
mov dword [ebp - 8], ecx
jbe 0x404606
mov dword [ebp - 8], 0x50
mov byte [edx + 0x50], al
mov ecx, dword [ebp - 8]
mov eax, dword [ebp + 0x10]
lea edi, [ecx + eax + 0x56]
mov dword [ebp - 0x10], edi
jmp 0x404620
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 8], esi
add ecx, 0x56
mov dword [ebp - 0x10], ecx
mov edi, ecx
lea eax, [edi + 1]
add eax, 3
and al, 0xfc
call fcn.0040c820
mov eax, esp
cmp eax, esi
mov dword [ebp - 4], eax
jne 0x404645
mov eax, 8
lea esp, [ebp - 0x1c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [0x426848], esi
jne 0x404662
push 0x4267c0
mov dword [0x426848], 1
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x4267c0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [0x42684c]
mov ebx, dword [ebp + 0x14]
inc edx
mov dword [0x42684c], edx
mov eax, dword [ebx]
cmp eax, 0xffffffff
je 0x404871
cmp dword [ebx + 0x210], 1
jne 0x4046d9
xor esi, esi
lea edx, [ebp - 0xc]
push esi
push edx
push 0x5c
push str._r_n_begin_of_write_cycle__r_n_r_n_r_n
push eax
mov dword [ebx + 0x210], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4046b8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebx + 0x218]
add ecx, eax
mov eax, ecx
mov dword [ebx + 0x218], ecx
test esi, esi
mov dword [ebx + 0x214], eax
jne 0x40483e
mov ecx, dword [ebx + 0x218]
mov eax, dword [ebx + 0x21c]
lea edx, [ecx + edi]
cmp edx, eax
jbe 0x40478c
sub eax, ecx
mov esi, eax
cmp edi, esi
mov dword [ebp + 0x14], esi
jae 0x40471d
lea eax, [esi + 1]
add eax, 3
and al, 0xfc
call fcn.0040c820
mov edx, esp
test edx, edx
jne 0x404720
mov eax, 8
lea esp, [ebp - 0x1c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 4]
mov ecx, esi
mov eax, 0x20202020
mov edi, edx
push 0
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [ebp + 0x14]
lea eax, [ebp - 0xc]
push eax
push ecx
push edx
mov edx, dword [ebx]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40475d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x40483e
mov eax, dword [ebx + 0x214]
mov ecx, dword [ebx]
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [ebx + 0x218], eax
jne 0x40478c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jne 0x40483e
mov eax, dword [ebp - 8]
test eax, eax
je 0x4047d5
mov edi, dword [ebp + 8]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [ebp - 4]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push esi
push ecx
push eax
call fcn.0040c210
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
add esp, 0xc
add edx, eax
mov byte [edx + esi], 0
jmp 0x4047ed
mov edi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp - 4]
push edi
push ecx
push esi
call fcn.0040bb10
add esp, 0xc
mov byte [esi + edi], 0
mov edi, str._r_n_____________________________________________current_write_position_________________
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov edi, dword [ebp - 4]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp - 4]
and ecx, 3
lea eax, [ebp - 0xc]
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x10]
push eax
mov eax, dword [ebx]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404836
xor esi, esi
jmp 0x40483e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebx + 0x218]
add ecx, 0xffffffac
add edx, ecx
test esi, esi
mov dword [ebx + 0x218], edx
mov eax, edx
jne 0x404871
mov edx, dword [ebx]
push esi
push esi
push eax
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x404871
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x42684c]
test eax, eax
je 0x40488e
mov ecx, eax
push 0x4267c0
dec ecx
mov dword [0x42684c], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea esp, [ebp - 0x1c]
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret