Function at 0x40bff8
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x54
mov byte [ebp - 0x31], 1
mov dword [ebp - 0x20], 0
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
jge 0x40c103
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
mov eax, dword [ebp + 0x10]
mov eax, dword [edx + eax]
cmp byte [eax], 0x2d
je 0x40c037
jmp 0x40c103
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], str.__list_size
mov eax, dword [edx + eax]
mov dword [esp], eax
call sym._strcmp
test eax, eax
je 0x40c07f
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], 0x414162
mov eax, dword [edx + eax]
mov dword [esp], eax
call sym._strcmp
test eax, eax
jne 0x40c0d9
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
jl 0x40c0a7
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
mov eax, dword [ebp + 0x10]
mov eax, dword [edx + eax]
mov dword [esp + 4], eax
mov dword [esp], str.no_parameter_for__s
call sym._quit
lea eax, [ebp - 0xc]
inc dword [eax]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
mov eax, dword [ebp + 0x10]
mov eax, dword [edx + eax]
mov dword [esp], eax
call sym._strtoul
mov dword [ebp - 0x20], eax
jmp 0x40c0f9
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
mov eax, dword [ebp + 0x10]
mov eax, dword [edx + eax]
mov dword [esp + 4], eax
mov dword [esp], str.invalid_option__s_for_save
call sym._quit
lea eax, [ebp - 0xc]
inc dword [eax]
jmp 0x40c011
mov edx, dword [ebp - 0xc]
lea eax, [ebp + 0xc]
sub dword [eax], edx
mov eax, dword [ebp - 0xc]
lea edx, [eax*4]
lea eax, [ebp + 0x10]
add dword [eax], edx
cmp dword [ebp + 0xc], 0
jg 0x40c12c
mov dword [esp], str.not_enough_parameters
call sym._quit
cmp dword [ebp - 0x20], 0
jne 0x40c13a
mov eax, dword [0x41f5b4]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
add ecx, 0x1fd
mov eax, 0x80808081
imul ecx
lea eax, [edx + ecx]
mov edx, eax
sar edx, 8
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov eax, edx
mov dword [ebp - 0x24], eax
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 8
sub eax, edx
add eax, eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x24]
shl eax, 9
mov dword [esp], eax
call sym._xmalloc
mov dword [ebp - 8], eax
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0
mov dword [esp], 0x417364
call sym._memset
mov dword [ebp - 0x28], 0x417364
mov eax, dword [ebp - 0x28]
mov dword [eax], 0x52414246
mov eax, dword [ebp - 0x28]
mov byte [eax + 4], 1
mov eax, dword [ebp - 0x28]
mov byte [eax + 5], 6
mov edx, dword [ebp - 0x28]
mov eax, dword [0x41f5e4]
mov word [edx + 0xa], ax
mov ecx, dword [ebp - 0x28]
mov edx, dword [0x41f5e4]
mov eax, dword [0x41f5f4]
sub eax, edx
mov dword [ecx + 0xc], eax
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
mov word [edx + 8], ax
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x2c], 0
mov eax, dword [0x41f5d4]
add eax, dword [ebp - 0x14]
cmp byte [eax], 0
je 0x40c2b3
mov eax, dword [ebp - 0x14]
add eax, dword [0x41f5d4]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 8]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x38]
movzx eax, byte [eax]
add eax, dword [ebp - 0x18]
add eax, 2
cmp eax, dword [ebp - 0x20]
jl 0x40c240
mov dword [esp], str.not_enough_space_for_file_list
call sym._quit
mov eax, dword [ebp - 0x38]
movzx eax, byte [eax]
add eax, 2
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sym._memcpy
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x1c]
mov dword [edx + 2], eax
mov eax, dword [ebp - 0x38]
mov eax, dword [eax + 6]
add eax, 0x1ff
mov edx, eax
shr edx, 9
lea eax, [ebp - 0x1c]
add dword [eax], edx
mov eax, dword [ebp - 0x38]
mov edx, dword [eax + 6]
lea eax, [ebp - 0x2c]
add dword [eax], edx
mov eax, dword [0x41f5d4]
add eax, dword [ebp - 0x14]
movzx eax, byte [eax]
add eax, dword [ebp - 0x14]
add eax, 2
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x18]
movzx eax, byte [eax]
add eax, dword [ebp - 0x18]
add eax, 2
mov dword [ebp - 0x18], eax
jmp 0x40c1fd
mov ebx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x18]
mov eax, 0x80808081
imul ecx
lea eax, [edx + ecx]
mov edx, eax
sar edx, 8
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov eax, edx
inc eax
mov word [ebx + 6], ax
mov eax, dword [ebp - 0x18]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov eax, dword [ebp - 8]
mov dword [esp], eax
call sym._add_mark
mov dword [esp + 8], 0x1b6
mov dword [esp + 4], 0x8302
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [esp], eax
call sym._open
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jns 0x40c332
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], str.cant_write_to_file__s
call sym._quit
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0x417364
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._write
cmp eax, 0x200
setne al
movzx ebx, al
mov eax, dword [ebp - 0x24]
shl eax, 9
mov dword [esp + 8], eax
mov eax, dword [ebp - 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._write
mov edx, eax
mov eax, dword [ebp - 0x24]
shl eax, 9
cmp edx, eax
setne al
movzx eax, al
or eax, ebx
test eax, eax
je 0x40c396
mov dword [esp], str.file_write_fails
call sym._quit
mov eax, dword [ebp - 8]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._dot_init
mov dword [ebp - 0x14], 0
mov eax, dword [0x41f5d4]
add eax, dword [ebp - 0x14]
cmp byte [eax], 0
je 0x40c46f
mov eax, dword [ebp - 0x14]
add eax, dword [0x41f5d4]
mov dword [ebp - 0x3c], eax
mov dword [esp + 0xc], 0xffffffff
mov eax, dword [ebp - 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._load_file_data
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 6]
and eax, 0x1ff
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x40c456
mov eax, 0x200
sub eax, dword [ebp - 0x38]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0x417364
call sym._memset
mov eax, dword [ebp - 0x38]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x417364
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._write
cmp eax, dword [ebp - 0x38]
je 0x40c456
mov dword [esp], str.file_write_fails
call sym._quit
mov eax, dword [0x41f5d4]
add eax, dword [ebp - 0x14]
movzx eax, byte [eax]
add eax, dword [ebp - 0x14]
add eax, 2
mov dword [ebp - 0x14], eax
jmp 0x40c3b3
call sym._dot_fini
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._close
mov dword [esp + 4], 0x414d37
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jne 0x40c4b2
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], str.cant_open_file__s
call sym._quit
mov dword [esp + 8], 0
mov dword [esp + 4], 0x10
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sym._fseek
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
lea eax, [ebp - 0x31]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sym._fclose
add esp, 0x54
pop ebx
pop ebp
ret