Function at 0x4047d0
Capabilities:
Write file on windows

Disassembly:
push esi
push ebx
sub esp, 0x44
lea eax, [esp + 0x30]
mov dword [esp], eax
call sub.KERNEL32.dll_GetLocalTime
sub esp, 4
call fcn.004065a0
mov dword [esp], 0x64
mov ebx, eax
call sub.KERNEL32.dll_Sleep
sub esp, 4
cmp byte [ebx], 0
je 0x4047e4
mov eax, dword [0x42a080]
mov dword [esp + 8], 0x41f113
mov esi, 0x100
mov dword [esp + 4], 0x100
mov dword [esp], 0x429e80
mov dword [esp + 0xc], eax
call fcn.00414600
movzx edx, word [esp + 0x3c]
movzx eax, al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.BK_CAL__s__02d__02d__d__02d._02d._02d.bkcal
mov dword [esp + 0x24], edx
movzx edx, word [esp + 0x3a]
mov dword [esp + 0x20], edx
movzx edx, word [esp + 0x38]
mov dword [esp + 0x1c], edx
movzx edx, word [esp + 0x30]
mov dword [esp + 0x18], edx
movzx edx, word [esp + 0x32]
mov dword [esp + 0x14], edx
movzx edx, word [esp + 0x36]
mov dword [esp + 0x10], edx
mov edx, esi
sub edx, eax
add eax, 0x429e80
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00414600
mov dword [esp + 4], 0x429e80
mov dword [esp], str._STATUS_:_Generating_file:__s_n
call fcn.004036b0
mov dword [esp + 4], 0x41f163
mov dword [esp], 0x429e80
call sub.msvcrt.dll_fopen
test eax, eax
mov dword [0x428368], eax
je 0x404b32
mov eax, dword [0x42a080]
mov dword [esp + 8], 0x41f113
mov dword [esp + 4], 0x100
mov dword [esp], 0x429c60
mov dword [esp + 0xc], eax
call fcn.00414600
movzx edx, word [esp + 0x3c]
movzx eax, al
mov dword [esp + 0xc], ebx
sub esi, eax
add eax, 0x429c60
mov dword [esp + 8], str.BK_CAL__s__02d__02d__d__02d._02d._02d_LOG.log
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [esp + 0x24], edx
movzx edx, word [esp + 0x3a]
mov dword [esp + 0x20], edx
movzx edx, word [esp + 0x38]
mov dword [esp + 0x1c], edx
movzx edx, word [esp + 0x30]
mov dword [esp + 0x18], edx
movzx edx, word [esp + 0x32]
mov dword [esp + 0x14], edx
movzx edx, word [esp + 0x36]
mov dword [esp + 0x10], edx
call fcn.00414600
mov dword [esp + 4], 0x429c60
mov dword [esp], str._STATUS_:_Generating_file:__s_n
call fcn.004036b0
mov dword [esp + 4], 0x41f163
mov dword [esp], 0x429c60
call sub.msvcrt.dll_fopen
test eax, eax
mov dword [0x428364], eax
je 0x404b51
mov eax, dword [0x428368]
mov dword [esp + 8], 0x51
mov dword [esp + 4], 1
mov dword [esp], 0x41f1d0
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x428368]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.__Bkool_calibration_file_for_the_device:__s_n
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
movzx eax, word [esp + 0x3c]
mov dword [esp + 4], str.__Date_of_the_calibration:__d__d__d___02d:_02d:_02d_n
mov dword [esp + 0x1c], eax
movzx eax, word [esp + 0x3a]
mov dword [esp + 0x18], eax
movzx eax, word [esp + 0x38]
mov dword [esp + 0x14], eax
movzx eax, word [esp + 0x30]
mov dword [esp + 0x10], eax
movzx eax, word [esp + 0x32]
mov dword [esp + 0xc], eax
movzx eax, word [esp + 0x36]
mov dword [esp + 8], eax
mov eax, dword [0x428368]
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [0x428368]
mov dword [esp + 8], 0x51
mov dword [esp + 4], 1
mov dword [esp], 0x41f1d0
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x428368]
mov dword [esp + 8], 0x52
mov dword [esp + 4], 1
mov dword [esp], str._________________________________File_definitions________________________________n_n
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x428368]
mov dword [esp + 8], 0x42
mov dword [esp + 4], 1
mov dword [esp], str.Position_____Speed_RPM___Torque_Nm___Power_W___Temperature_deg.C__n
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x428368]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [0x428364]
mov dword [esp + 8], 0x51
mov dword [esp + 4], 1
mov dword [esp], 0x41f1d0
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x428364]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.__Bkool_calibration_log_file_for_the_device:__s_n
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
movzx eax, word [esp + 0x3c]
mov dword [esp + 4], str.__Date_of_the_calibration:__d__d__d___02d:_02d:_02d_n
mov dword [esp + 0x1c], eax
movzx eax, word [esp + 0x3a]
mov dword [esp + 0x18], eax
movzx eax, word [esp + 0x38]
mov dword [esp + 0x14], eax
movzx eax, word [esp + 0x30]
mov dword [esp + 0x10], eax
movzx eax, word [esp + 0x32]
mov dword [esp + 0xc], eax
movzx eax, word [esp + 0x36]
mov dword [esp + 8], eax
mov eax, dword [0x428364]
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [0x428364]
mov dword [esp + 8], 0x51
mov dword [esp + 4], 1
mov dword [esp], 0x41f1d0
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, dword [0x428364]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
xor eax, eax
add esp, 0x44
pop ebx
pop esi
ret
mov dword [esp + 4], 0x429e80
mov dword [esp], str._ERROR_:_Could_not_generate_the_calibration_file:__s_n
call fcn.004036b0
add esp, 0x44
mov eax, 1
pop ebx
pop esi
ret
mov dword [esp + 4], 0x429c60
mov dword [esp], str._ERROR_:_Could_not_generate_the_calibration_file:__s_n
call fcn.004036b0
mov eax, 1
jmp 0x404b2c