Function at 0x10031360
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov ebx, ecx
cmp byte [ebx + 0xc], 0
jne 0x10031394
push 0x290
push str.src_sample_utils.cpp
push 0xfffffffffffffff8
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
mov eax, 0xfffffff8
pop ebx
mov esp, ebp
pop ebp
ret 4
push esi
mov esi, dword [ebp + 8]
test esi, esi
jne 0x100313a7
lea eax, [esi - 2]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push edi
lea edi, [esi + 0x58]
test edi, edi
jne 0x100313bb
lea eax, [edi - 2]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp dword [esi + 0x30], 0x3231564e
movzx eax, word [esi + 0x2c]
mov dword [ebp - 0xc], eax
je 0x100313d9
pop edi
pop esi
mov eax, 0xfffffffd
pop ebx
mov esp, ebp
pop ebp
ret 4
xor eax, eax
xor ecx, ecx
mov dword [ebp + 8], eax
cmp cx, word [esi + 0x3e]
jb 0x10031493
movzx eax, word [esi + 0x3e]
movzx ecx, word [esi + 0x3c]
shr eax, 1
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], ecx
mov dword [ebp + 8], 0
je 0x100315cb
jmp 0x10031410
cmp dword [ebp - 8], 0
mov dword [ebp - 4], 0
jbe 0x100315bc
cmp byte [ebx + 0xd], 0
movzx ecx, word [edi + 0x2e]
jne 0x10031569
movzx eax, word [esi + 0x3a]
mov edx, dword [ebx + 4]
imul eax, ecx
imul ecx, dword [ebp + 8]
push edx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
movzx ecx, word [esi + 0x38]
add eax, ecx
add eax, dword [edi + 0x34]
push 1
add eax, dword [ebp - 4]
push 1
push eax
call fcn.10041862
add esp, 0x10
cmp eax, 1
je 0x100315a7
push 0x2b7
push str.src_sample_utils.cpp
push 0xfffffffffffffff0
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
pop edi
pop esi
mov eax, 0xfffffff0
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [ebp + 8]
cmp byte [ebx + 0xd], 0
jne 0x100314f2
mov edx, dword [ebx + 4]
movzx ecx, word [esi + 0x3c]
push edx
movzx edx, word [esi + 0x3a]
add edx, eax
movzx eax, word [edi + 0x2e]
imul edx, eax
push ecx
movzx ecx, word [esi + 0x38]
add edx, ecx
add edx, dword [edi + 0x30]
push 1
push edx
call fcn.10041862
movzx edx, word [esi + 0x3c]
add esp, 0x10
cmp edx, eax
je 0x1003152a
push 0x2a3
push str.src_sample_utils.cpp
push 0xfffffffffffffff0
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
pop edi
pop esi
mov eax, 0xfffffff0
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebx + 8]
mov edx, dword [ebp - 0xc]
mov ecx, dword [ecx + edx*4]
movzx edx, word [esi + 0x3c]
push ecx
movzx ecx, word [esi + 0x3a]
push edx
movzx edx, word [edi + 0x2e]
add ecx, eax
movzx eax, word [esi + 0x38]
imul ecx, edx
add ecx, eax
add ecx, dword [edi + 0x30]
push 1
push ecx
call fcn.10041862
movzx ecx, word [esi + 0x3c]
add esp, 0x10
cmp ecx, eax
jne 0x10031542
mov eax, dword [ebp + 8]
movzx edx, word [esi + 0x3e]
inc eax
mov dword [ebp + 8], eax
cmp eax, edx
jb 0x10031490
jmp 0x100313ea
push 0x2a9
push str.src_sample_utils.cpp
push 0xfffffffffffffff0
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
pop edi
pop esi
mov eax, 0xfffffff0
pop ebx
mov esp, ebp
pop ebp
ret 4
mov edx, dword [ebx + 8]
mov eax, dword [ebp - 0xc]
mov edx, dword [edx + eax*4]
movzx eax, word [esi + 0x3a]
imul eax, ecx
imul ecx, dword [ebp + 8]
push edx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
movzx ecx, word [esi + 0x38]
add eax, ecx
add eax, dword [edi + 0x34]
push 1
add eax, dword [ebp - 4]
push 1
push eax
call fcn.10041862
add esp, 0x10
cmp eax, 1
jne 0x1003165e
mov eax, dword [ebp - 4]
add eax, 2
mov dword [ebp - 4], eax
cmp eax, dword [ebp - 8]
jb 0x10031421
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
inc ecx
mov dword [ebp + 8], ecx
cmp ecx, eax
jb 0x10031410
mov dword [ebp + 8], 0
test eax, eax
je 0x100316e3
lea ebx, [ebx]
mov ecx, 1
mov dword [ebp - 4], ecx
cmp dword [ebp - 8], ecx
jbe 0x100316d4
cmp byte [ebx + 0xd], 0
movzx ecx, word [edi + 0x2e]
jne 0x10031685
movzx eax, word [esi + 0x3a]
mov edx, dword [ebx + 4]
imul eax, ecx
imul ecx, dword [ebp + 8]
push edx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
movzx ecx, word [esi + 0x38]
add eax, ecx
add eax, dword [edi + 0x34]
push 1
add eax, dword [ebp - 4]
push 1
push eax
call fcn.10041862
add esp, 0x10
cmp eax, 1
je 0x100316bf
push 0x2c9
push str.src_sample_utils.cpp
push 0xfffffffffffffff0
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
pop edi
pop esi
mov eax, 0xfffffff0
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x2bd
push str.src_sample_utils.cpp
push 0xfffffffffffffff0
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
pop edi
pop esi
mov eax, 0xfffffff0
pop ebx
mov esp, ebp
pop ebp
ret 4
mov edx, dword [ebx + 8]
mov eax, dword [ebp - 0xc]
mov edx, dword [edx + eax*4]
movzx eax, word [esi + 0x3a]
imul eax, ecx
imul ecx, dword [ebp + 8]
push edx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
movzx ecx, word [esi + 0x38]
add eax, ecx
add eax, dword [edi + 0x34]
push 1
add eax, dword [ebp - 4]
push 1
push eax
call fcn.10041862
add esp, 0x10
cmp eax, 1
jne 0x100316ee
mov eax, dword [ebp - 4]
add eax, 2
mov dword [ebp - 4], eax
cmp eax, dword [ebp - 8]
jb 0x100315f1
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
inc ecx
mov dword [ebp + 8], ecx
cmp ecx, eax
jb 0x100315e0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x2cf
push str.src_sample_utils.cpp
push 0xfffffffffffffff0
push str._nReturn_on_error:_error_code__d__t_s_t_d_n_n
call fcn.1007325b
add esp, 0x10
pop edi
pop esi
mov eax, 0xfffffff0
pop ebx
mov esp, ebp
pop ebp
ret 4