Function at 0x54ff60
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x108
push ebx
push ebp
push esi
push edi
mov ebx, ecx
push 0
call dword [sym.imp.MSVCRT.dll_time]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x120]
add esp, 4
cmp eax, 1
jl 0x55018d
mov eax, dword [esp + 0x120]
test eax, eax
jl 0x55018d
lea ebp, [ebx + 8]
push ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0x37ec]
test eax, eax
je 0x54ffc3
mov eax, dword [ebx + 0x37f0]
mov ecx, dword [ebx + 0x37f4]
inc eax
cmp eax, ecx
jl 0x550057
mov ecx, dword [ebx + 0x37f4]
add ecx, 0x12
shl ecx, 4
push ecx
call fcn.004c2e90
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
jne 0x550008
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push str.TradeBase:_not_enough_memory_for_trailing_stops
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret 8
mov esi, dword [ebx + 0x37ec]
test esi, esi
je 0x550042
mov ecx, dword [ebx + 0x37f0]
test ecx, ecx
jle 0x55002f
shl ecx, 4
mov edx, ecx
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 eax, dword [ebx + 0x37ec]
push eax
call fcn.004c2eb0
mov eax, dword [esp + 0x18]
add esp, 4
mov ecx, dword [ebx + 0x37f4]
mov dword [ebx + 0x37ec], eax
add ecx, 0x10
mov dword [ebx + 0x37f4], ecx
mov ecx, dword [ebx + 0x37f0]
xor eax, eax
test ecx, ecx
jle 0x55008a
mov esi, dword [ebx + 0x37ec]
mov edx, esi
mov edi, dword [ebx + 0x24]
cmp dword [edx], edi
jne 0x550082
mov edi, dword [edx + 4]
cmp edi, dword [esp + 0x11c]
je 0x55019a
inc eax
add edx, 0x10
cmp eax, ecx
jl 0x55006b
mov edx, dword [ebx + 0x37ec]
mov eax, dword [ebx + 0x24]
shl ecx, 4
mov edi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebp
mov dword [ecx + edx], eax
mov ecx, dword [ebx + 0x37f0]
mov edx, dword [ebx + 0x37ec]
mov eax, dword [esp + 0x120]
shl ecx, 4
mov dword [ecx + edx + 4], eax
mov ecx, dword [ebx + 0x37f0]
mov edx, dword [ebx + 0x37ec]
mov eax, dword [esp + 0x124]
shl ecx, 4
mov dword [ecx + edx + 8], eax
mov ecx, dword [ebx + 0x37f0]
mov edx, dword [ebx + 0x37ec]
mov eax, dword [esp + 0x14]
shl ecx, 4
mov dword [ecx + edx + 0xc], eax
mov esi, dword [ebx + 0x37f0]
inc esi
mov dword [ebx + 0x37f8], 1
mov dword [ebx + 0x37f0], esi
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebx + 0x37f8], 1
jne 0x55018a
mov eax, dword [ebx + 0x37c0]
test eax, eax
jne 0x55018a
push 0x5965b8
push str._sprofiles_trailingstops.ini
lea ecx, [esp + 0x20]
push 0xff
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
lea edx, [esp + 0x28]
push 0x581698
push edx
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x550180
mov ecx, dword [ebx + 0x37ec]
test ecx, ecx
je 0x550176
mov eax, dword [ebx + 0x37f0]
test eax, eax
jle 0x550176
push esi
push 1
shl eax, 4
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [ebx + 0x37f8], 0
push ebp
call edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret 8
mov ecx, dword [esp + 0x120]
mov edi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
shl eax, 4
push ebp
mov dword [eax + esi + 8], ecx
mov edx, dword [ebx + 0x37ec]
mov ecx, dword [esp + 0x14]
mov esi, 1
mov dword [edx + eax + 0xc], ecx
mov dword [ebx + 0x37f8], esi
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebx + 0x37f8], esi
jne 0x55018a
mov eax, dword [ebx + 0x37c0]
test eax, eax
jne 0x55018a
push 0x5965b8
push str._sprofiles_trailingstops.ini
lea edx, [esp + 0x20]
push 0xff
push edx
call dword [sym.imp.MSVCRT.dll__snprintf]
lea eax, [esp + 0x28]
push 0x581698
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x550180
mov ecx, dword [ebx + 0x37ec]
test ecx, ecx
je 0x550176
mov eax, dword [ebx + 0x37f0]
test eax, eax
jle 0x550176
jmp 0x550165