Function at 0x10004510
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
push edi
push 0xa0
mov ebx, 0x14
call esi
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x10004547
pop edi
pop esi
pop ebp
mov dword [0x10024160], 0xb
or eax, 0xffffffff
pop ebx
add esp, 0x14
ret
push 0x2dc6c0
call esi
mov esi, eax
add esp, 4
test esi, esi
mov dword [esp + 0x10], esi
jne 0x1000457a
push ebp
mov dword [0x10024160], 0xb
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esp + 0x2c]
push 0x1001c5a8
mov dword [ebp], 0
push eax
mov dword [esi], 0
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x100045c6
mov edi, dword [sym.imp.MSVCRT.dll_free]
push ebp
mov dword [0x10024160], 4
call edi
push esi
call edi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov esi, dword [esp + 0x28]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x2c], 0
add ecx, esi
cmp esi, ecx
mov dword [esp + 0x14], ecx
jae 0x10004666
mov dword [esp + 0x28], 0xa0
push esi
call fcn.100048a0
mov edi, eax
add esp, 4
test edi, edi
jl 0x100046e2
cmp byte [esi], 0
jne 0x1000460c
xor eax, eax
jmp 0x1000461d
push esi
call sym.tmax.dll_fbget_fldkey
add esp, 4
test eax, eax
je 0x1000470a
mov ecx, dword [esp + 0x2c]
mov byte [edi + esi - 1], 0xa
add esi, edi
mov dword [ebp + ecx*8], eax
mov dword [ebp + ecx*8 + 4], 0
inc ecx
cmp ecx, ebx
mov dword [esp + 0x2c], ecx
jl 0x10004660
mov eax, dword [esp + 0x28]
add ebx, 0xa
add eax, 0x50
push eax
push ebp
mov dword [esp + 0x30], eax
call dword [sym.imp.MSVCRT.dll_realloc]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x10004737
cmp esi, dword [esp + 0x14]
jb 0x100045f0
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x10]
dec eax
mov dword [esp + 0x14], 0
mov dword [esp + 0x2c], eax
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x2c]
cmp ebx, eax
jge 0x100047b5
mov eax, dword [ebp + ebx*8]
lea ecx, [ebp + ebx*8]
mov edx, esi
mov dword [esp + 0x28], 0
test eax, eax
mov dword [esp + 0x20], edx
je 0x10004797
lea edi, [ecx + 4]
mov ecx, dword [ecx + 4]
cmp ecx, 0xffffffff
je 0x10004775
lea edx, [esp + 0x1c]
push 7
push edx
push esi
push ecx
push eax
mov eax, dword [esp + 0x44]
push eax
call sym.tmax.dll_fbget_tut
add esp, 0x18
test eax, eax
jge 0x10004760
mov dword [edi], 0xffffffff
jmp 0x10004775
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebp
mov dword [0x10024160], 0xa
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov byte [edi + esi - 1], 0xa
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebp
mov dword [0x10024160], 6
call esi
mov edx, dword [esp + 0x14]
push edx
call esi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov esi, dword [sym.imp.MSVCRT.dll_free]
push 0
mov dword [0x10024160], 0xb
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov ecx, dword [edi]
mov dword [esp + 0x28], 1
inc ecx
mov dword [edi], ecx
mov ecx, dword [esp + 0x1c]
lea esi, [esi + ecx - 1]
add edi, 8
mov byte [esi], 9
inc esi
inc ebx
mov eax, dword [edi - 4]
lea ecx, [edi - 4]
test eax, eax
jne 0x100046ac
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x100047a7
mov edx, dword [esp + 0x20]
inc ebx
mov byte [edx], 0xa
lea esi, [edx + 1]
mov dword [esp + 0x14], ebx
jmp 0x1000467b
dec esi
mov byte [esi], 0xd
inc esi
mov byte [esi], 0xa
inc esi
jmp 0x1000467b
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
mov byte [esi], 0xa
sub esi, edi
push edx
push esi
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fwrite]
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebp
call esi
push edi
call esi
add esp, 0x1c
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret