Function at 0x542c00
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x24
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor esi, esi
mov edi, ecx
cmp eax, esi
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], esi
je 0x542f5c
cmp dword [eax + 4], esi
je 0x542f5c
mov ebx, dword [edi + 0x2dc]
cmp ebx, esi
je 0x542f5c
mov ecx, dword [eax + 0x2c]
mov edx, dword [eax + 8]
mov dword [edi + 0x2f4], esi
mov esi, dword [eax + 4]
lea ecx, [ecx + ecx*2]
mov dword [esp + 0x14], esi
lea ecx, [ecx + ecx*4]
shl ecx, 2
mov dword [esp + 0x2c], ecx
mov ecx, dword [ebp + 0xc]
dec edx
test ecx, ecx
mov dword [esp + 0x18], edx
jle 0x542c9f
mov eax, dword [eax + 0x2c]
push 0
push eax
push ecx
push edx
push esi
call fcn.0042b240
add esp, 0x14
cmp eax, 0x3e8
jle 0x542c9c
mov ecx, dword [esp + 0x18]
sub eax, 0x3e8
sub ecx, eax
mov dword [esp + 0x18], ecx
lea ecx, [eax + eax*4]
lea edx, [eax + ecx*2]
lea eax, [esi + edx*4]
mov dword [esp + 0x14], eax
mov esi, eax
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x18]
xor edx, edx
test ecx, ecx
mov dword [esp + 0x28], esi
mov dword [esp + 0x1c], edx
jl 0x542e1d
jmp 0x542cc6
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
mov eax, dword [ebp + 8]
mov ecx, dword [edi + 0x2e4]
test ecx, ecx
jne 0x542e1d
mov ecx, dword [ebp + 0x10]
mov byte [esp + 0x13], 0
test ecx, ecx
jle 0x542ce8
cmp ecx, dword [esi]
jle 0x542e16
test edx, 0x3ff
jne 0x542cff
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebp + 0x10]
cmp edx, 0x63
jle 0x542da5
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x542d17
cmp eax, dword [esi]
jg 0x542da5
test ecx, ecx
je 0x542d23
cmp ecx, dword [esi]
jle 0x542da5
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x542d30
inc edx
mov dword [esp + 0x24], edx
fld qword [esi + 0x24]
fcomp qword [0x567050]
fnstsw ax
test ah, 0x41
jne 0x542da0
mov ecx, dword [esi]
mov dword [ebx + 0x2c], ecx
mov edx, dword [esi]
mov dword [ebx], edx
mov eax, dword [esi + 4]
mov dword [ebx + 4], eax
mov ecx, dword [esi + 8]
mov dword [ebx + 8], ecx
mov edx, dword [esi + 4]
mov dword [ebx + 0xc], edx
mov eax, dword [esi + 8]
mov dword [ebx + 0x10], eax
mov ecx, dword [esi + 4]
mov dword [ebx + 0x14], ecx
mov edx, dword [esi + 8]
mov dword [ebx + 0x18], edx
mov eax, dword [esi + 4]
mov dword [ebx + 0x1c], eax
mov ecx, dword [esi + 8]
mov dword [ebx + 0x24], 0
mov dword [ebx + 0x20], ecx
mov dword [ebx + 0x28], 0x3ff00000
mov dword [ebx + 0x30], 1
mov eax, dword [edi + 0x2f4]
add ebx, 0x34
inc eax
mov dword [edi + 0x2f4], eax
jmp 0x542da5
mov byte [esp + 0x13], 1
mov edx, dword [esp + 0x14]
mov ecx, 0xb
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [edx]
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x18]
lea edx, [ecx + eax - 1]
mov eax, dword [esp + 0x1c]
cmp eax, esi
mov dword [ebx + 0x2c], edx
jge 0x542ddc
mov cl, byte [esp + 0x13]
test cl, cl
jne 0x542ddc
mov dword [ebx + 0x30], 0
jmp 0x542de3
mov dword [ebx + 0x30], 1
mov ecx, dword [esp + 0x14]
inc eax
add ecx, 0x2c
add ebx, 0x34
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x1c], eax
mov edx, dword [ecx + 0x2f4]
inc edx
cmp eax, esi
mov dword [ecx + 0x2f4], edx
jle 0x542cb7
mov eax, dword [ebp + 8]
mov edi, ecx
jmp 0x542e1d
mov dword [ebx - 4], 1
mov ecx, dword [esp + 0x18]
mov dword [edi + 0x2f0], 0
inc ecx
mov dword [edi + 0xd8], ecx
mov ecx, dword [esp + 0x24]
test ecx, ecx
jle 0x542e4a
lea edx, [ecx + ecx*4]
lea ecx, [ecx + edx*2]
mov edx, dword [esp + 0x28]
mov ecx, dword [edx + ecx*4 - 0x2c]
jmp 0x542e50
mov edx, dword [esp + 0x28]
mov ecx, dword [edx]
mov dword [edi + 0xdc], ecx
mov edx, dword [ebx - 8]
mov dword [edi + 0xe0], edx
mov ecx, dword [eax + 0x2c]
add eax, 0x20
push ecx
mov ecx, dword [0x596208]
push eax
call fcn.00475ea0
xor ebx, ebx
mov dword [edi + 0xe8], ebx
mov dword [edi + 0xec], ebx
mov eax, dword [edi + 0x2e4]
cmp eax, ebx
je 0x542ec4
mov eax, dword [edi + 0x2d8]
cmp eax, ebx
je 0x542f5c
mov edx, dword [eax + 0x10]
push ebx
push edx
call dword [sym.imp.MSVCRT.dll__chsize]
mov eax, dword [edi + 0x2d8]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0xc
mov dword [edi + 0x2d8], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [edi + 0x2d8]
push ebx
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [edi + 0x2d8]
mov esi, dword [sym.imp.MSVCRT.dll_fwrite]
push edx
push 1
push 0x2d8
push edi
call esi
add esp, 0x1c
cmp eax, 1
jne 0x542f10
mov eax, dword [edi + 0x2d8]
mov ecx, dword [edi + 0x2f4]
mov edx, dword [edi + 0x2dc]
push eax
push ecx
push 0x34
push edx
call esi
add esp, 0x10
mov ebx, eax
mov eax, dword [edi + 0x2d8]
test eax, eax
je 0x542f32
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [edi + 0x2d8], 0
test eax, eax
jne 0x542f48
cmp ebx, dword [edi + 0x2f4]
jne 0x542f48
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push str.TestGenerator:_write_file_error
push 1
push 0x5960a0
call fcn.0046b660
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc