Function at 0x403e10
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa4
mov eax, dword [0x474058]
xor eax, ebp
mov dword [ebp - 4], eax
xorps xmm0, xmm0
movlpd qword [ebp - 0x68], xmm0
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x6c], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x5c], 1
mov dword [ebp - 0x70], 1
mov dword [ebp - 0xa4], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x94], 0
cmp dword [ebp + 8], 1
jle 0x404122
mov eax, 4
shl eax, 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + eax]
push edx
call fcn.00414be0
add esp, 4
mov dword [ebp - 0x74], eax
mov eax, dword [ebp - 0x74]
push eax
mov ecx, 4
shl ecx, 0
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + ecx]
push eax
lea ecx, [ebp - 0x40]
push ecx
call fcn.00407810
add esp, 0xc
mov edx, dword [ebp - 0x74]
mov dword [ebp - 0x84], edx
cmp dword [ebp - 0x84], 0x3c
jae 0x403ec3
jmp 0x403ec8
call fcn.0040672b
mov eax, dword [ebp - 0x84]
mov byte [ebp + eax - 0x40], 0
mov ecx, dword [ebp - 0x74]
push ecx
lea edx, [ebp - 0x40]
push edx
mov eax, 4
shl eax, 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + eax]
push edx
push str.filename___s_sameas__s_strnlength_found__d
call fcn.00404a30
add esp, 0x10
push 0x478560
lea eax, [ebp - 0x40]
push eax
call fcn.0044084d
add esp, 8
test eax, eax
je 0x403f75
push str._File_is_Empty______FILE_SIZE:FAILED_n
call fcn.00404a30
add esp, 4
call fcn.00414a7d
mov ecx, dword [eax]
mov dword [ebp - 0x88], ecx
cmp dword [ebp - 0x88], 2
je 0x403f3a
cmp dword [ebp - 0x88], 0x16
je 0x403f4d
jmp 0x403f5c
lea edx, [ebp - 0x40]
push edx
push str.File__s_not_found._n
call fcn.00404a30
add esp, 8
jmp 0x403f69
push str.Invalid_parameter_to__stat._n
call fcn.00404a30
add esp, 4
jmp 0x403f69
push str.Unexpected_error_in__stat._n
call fcn.00404a30
add esp, 4
mov eax, 2
jmp 0x4047e3
mov eax, dword [0x478574]
push eax
push str.FILE_SIZE:__lu_n
call fcn.00404a30
add esp, 8
mov ecx, dword [0x478574]
mov dword [0x478554], ecx
mov edx, dword [0x478554]
mov dword [0x478558], edx
mov eax, dword [0x478574]
add eax, 4
push eax
call fcn.00414c6b
add esp, 4
mov dword [0x478590], eax
cmp dword [0x478590], 0
jne 0x403fe2
mov ecx, dword [0x478574]
push ecx
push str.MALLOC_FAILED_____:__lu_n
call fcn.00404a30
add esp, 8
mov eax, 2
jmp 0x4047e3
mov edx, dword [0x478590]
push edx
push str.MALLOC_SUCCEEDED______content____X__n_n
call fcn.00404a30
add esp, 8
mov eax, dword [0x478590]
mov dword [0x478854], eax
call fcn.00401730
mov dword [ebp - 0x94], eax
push str._n_n_______n_____________________________stTransferData.pArrReq__
call fcn.00404a30
add esp, 4
push 4
mov ecx, dword [0x478844]
push ecx
mov edx, dword [0x478590]
push edx
call fcn.00407810
add esp, 0xc
mov dword [ebp - 0x78], 0
jmp 0x404042
mov eax, dword [ebp - 0x78]
add eax, 1
mov dword [ebp - 0x78], eax
cmp dword [ebp - 0x78], 4
jge 0x404064
mov ecx, dword [0x478590]
add ecx, dword [ebp - 0x78]
movzx edx, byte [ecx]
push edx
push str.__X
call fcn.00404a30
add esp, 8
jmp 0x404039
push str._n_n_______n______________________________n_n
call fcn.00404a30
add esp, 4
lea eax, [ebp - 0x40]
push eax
push str._n_nFile_name_for_FOPEN____s__n
call fcn.00404a30
add esp, 8
push 0x466e6c
lea ecx, [ebp - 0x40]
push ecx
call fcn.004178a0
add esp, 8
mov dword [ebp - 0x80], eax
cmp dword [ebp - 0x80], 0
jne 0x4040b5
push str.FILE_OPEN_FAILED________n
call fcn.00404a30
add esp, 4
mov eax, 2
jmp 0x4047e3
mov edx, dword [0x478574]
push edx
push str.FILE_opened:__lu_n
call fcn.00404a30
add esp, 8
mov eax, dword [ebp - 0x80]
push eax
push 1
mov ecx, dword [0x478574]
push ecx
mov edx, dword [0x478590]
add edx, 4
push edx
call fcn.00417b52
add esp, 0x10
mov dword [ebp - 0x98], eax
cmp dword [ebp - 0x98], 1
je 0x404103
mov eax, 3
jmp 0x4047e3
mov eax, dword [0x478574]
push eax
push str.FILE_Read_OK:__lu_n
call fcn.00404a30
add esp, 8
mov ecx, dword [ebp - 0x80]
push ecx
call fcn.004175b2
add esp, 4
push 0x466eb4
call fcn.00404a30
add esp, 4
push str.__xlCANdemo___Test_Application_for_XL_Family_Driver_API____n
call fcn.00404a30
add esp, 4
push str.______________Vector_Informatik_GmbH___Nov_15_2023_________n
call fcn.00404a30
add esp, 4
push str.___________________________________________________________n
call fcn.00404a30
add esp, 4
mov dword [ebp + 8], 0
cmp dword [ebp + 8], 1
jle 0x4041ae
mov edx, 4
shl edx, 0
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + edx]
push ecx
call fcn.00417180
add esp, 4
mov dword [0x474028], eax
cmp dword [0x474028], 0
je 0x4041ae
mov edx, dword [0x474028]
push edx
push str.Baudrate___u_n
call fcn.00404a30
add esp, 8
mov eax, dword [ebp + 8]
sub eax, 1
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [ebp + 0xc], ecx
cmp dword [ebp + 8], 1
jle 0x404223
push 0x20
mov edx, 4
shl edx, 0
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + edx]
push ecx
push 0x20
push str.xlCANdemo
call fcn.00414bd3
add esp, 0x10
mov edx, 1
shl edx, 5
mov dword [ebp - 0x8c], edx
cmp dword [ebp - 0x8c], 0x21
jae 0x4041ed
jmp 0x4041f2
call fcn.0040672b
mov eax, dword [ebp - 0x8c]
mov byte [eax + str.xlCANdemo], 0
push str.xlCANdemo
push str.AppName___s_n
call fcn.00404a30
add esp, 8
mov ecx, dword [ebp + 8]
sub ecx, 1
mov dword [ebp + 8], ecx
mov edx, dword [ebp + 0xc]
add edx, 4
mov dword [ebp + 0xc], edx
cmp dword [ebp + 8], 1
jle 0x404260
lea eax, [ebp - 0x5c]
push eax
push 0x466fc4
mov ecx, 4
shl ecx, 0
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + ecx]
push eax
call fcn.00404a70
add esp, 0xc
cmp dword [ebp - 0x5c], 0
je 0x404260
mov ecx, dword [ebp - 0x5c]
push ecx
push str.TX_ID___x_n
call fcn.00404a30
add esp, 8
lea edx, [ebp - 0x60]
push edx
lea eax, [ebp - 0x68]
push eax
call fcn.00403a60
add esp, 8
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__Init_____________:__s_n
call fcn.00404a30
add esp, 8
movsx edx, word [ebp - 0x58]
test edx, edx
jne 0x4042b5
call fcn.004034a0
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0x58]
push eax
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__Create_RX_thread_:__s_n
call fcn.00404a30
add esp, 8
mov ecx, dword [0x474024]
push ecx
call sub.vxlapi.dll__xlFlushReceiveQueue_4
mov word [ebp - 0x58], ax
movzx edx, word [ebp - 0x58]
push edx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__xlFlushReceiveQueue__:___s_n
call fcn.00404a30
add esp, 8
movsx eax, word [ebp - 0x58]
test eax, eax
jne 0x40433a
push 8
push 1
mov ecx, dword [0x4784d4]
push ecx
mov edx, dword [0x4784d0]
push edx
mov eax, dword [0x474024]
push eax
call sub.vxlapi.dll__xlActivateChannel_20
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov edx, dword [0x4784d4]
push edx
mov eax, dword [0x4784d0]
push eax
push str.__ActivateChannel__:_CM0x_I64x___s_n
call fcn.00404a30
add esp, 0x10
movsx ecx, word [ebp - 0x58]
test ecx, ecx
jne 0x40433a
mov dword [ebp - 0x6c], 1
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
mov ecx, dword [ebp - 0x60]
push ecx
push str._n:_Press__h__for_help___actual_channel_Ch_d__CM0x_02I64x_n
call fcn.00404a30
add esp, 0x10
cmp dword [ebp - 0x90], 0
jne 0x40478b
lea edx, [ebp - 0x9c]
push edx
push 1
lea eax, [ebp - 0x54]
push eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleInputA]
cmp dword [ebp - 0x9c], 1
jne case.0x4043d0.1
movzx ecx, word [ebp - 0x54]
cmp ecx, 1
jne case.0x4043d0.1
cmp dword [ebp - 0x50], 0
je case.0x4043d0.1
movsx edx, byte [ebp - 0x46]
mov dword [ebp - 0xa0], edx
mov eax, dword [ebp - 0xa0]
mov dword [ebp - 0x7c], eax
mov ecx, dword [ebp - 0x7c]
sub ecx, 0x1b
mov dword [ebp - 0x7c], ecx
cmp dword [ebp - 0x7c], 0x5e
ja case.0x4043d0.1
mov edx, dword [ebp - 0x7c]
movzx eax, byte [edx + 0x404840]
jmp dword [eax*4 + 0x4047f4]
cmp dword [0x4784e0], 0
je 0x4043f9
mov dword [0x4784e0], 0
push str.__screen_on_n
call fcn.00404a30
add esp, 4
jmp 0x404410
mov dword [0x4784e0], 1
push str.__screen_off_n
call fcn.00404a30
add esp, 4
jmp case.0x4043d0.1
mov ecx, dword [ebp - 0x64]
push ecx
mov edx, dword [ebp - 0x68]
push edx
mov eax, dword [ebp - 0x5c]
push eax
call fcn.00403530
add esp, 0xc
jmp case.0x4043d0.1
cmp dword [0x478500], 0
je 0x40443e
call fcn.00403750
jmp 0x404452
mov ecx, dword [ebp - 0x64]
push ecx
mov edx, dword [ebp - 0x68]
push edx
mov eax, dword [ebp - 0x5c]
push eax
call fcn.00403780
add esp, 0xc
jmp case.0x4043d0.1
mov ecx, dword [ebp - 0x64]
push ecx
mov edx, dword [ebp - 0x68]
push edx
mov eax, dword [ebp - 0x5c]
push eax
call fcn.00403800
add esp, 0xc
jmp case.0x4043d0.1
cmp dword [ebp - 0x60], 0
jne 0x40447f
mov ecx, dword [0x474be4]
mov dword [ebp - 0x60], ecx
mov edx, dword [ebp - 0x60]
sub edx, 1
mov dword [ebp - 0x60], edx
imul eax, dword [ebp - 0x60], 0xe3
mov ecx, dword [eax + 0x474c3a]
mov edx, dword [eax + 0x474c3e]
mov dword [ebp - 0x68], ecx
mov dword [ebp - 0x64], edx
mov eax, dword [ebp - 0x64]
push eax
mov ecx, dword [ebp - 0x68]
push ecx
imul edx, dword [ebp - 0x60], 0xe3
add edx, 0x474c10
push edx
imul eax, dword [ebp - 0x60], 0xe3
movzx ecx, byte [eax + 0x474c39]
push ecx
push 0x4670b0
call fcn.00404a30
add esp, 0x14
jmp case.0x4043d0.1
mov edx, dword [ebp - 0x60]
add edx, 1
mov dword [ebp - 0x60], edx
mov eax, dword [ebp - 0x60]
cmp eax, dword [0x474be4]
jb 0x4044f3
mov dword [ebp - 0x60], 0
imul ecx, dword [ebp - 0x60], 0xe3
mov edx, dword [ecx + 0x474c3a]
mov eax, dword [ecx + 0x474c3e]
mov dword [ebp - 0x68], edx
mov dword [ebp - 0x64], eax
mov ecx, dword [ebp - 0x64]
push ecx
mov edx, dword [ebp - 0x68]
push edx
imul eax, dword [ebp - 0x60], 0xe3
add eax, 0x474c10
push eax
imul ecx, dword [ebp - 0x60], 0xe3
movzx edx, byte [ecx + 0x474c39]
push edx
push str.__TX_Channel_set_to_channel:__02d___s_CM_0x_I64x__n
call fcn.00404a30
add esp, 0x14
jmp case.0x4043d0.1
mov eax, dword [ebp - 0x5c]
xor eax, 0x80000000
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x5c]
push ecx
push 0x467118
call fcn.00404a30
add esp, 8
jmp case.0x4043d0.1
mov edx, dword [ebp - 0x5c]
and edx, 0x80000000
je 0x40457e
mov eax, dword [ebp - 0x5c]
sub eax, 1
or eax, 0x80000000
mov dword [ebp - 0x5c], eax
jmp 0x404596
cmp dword [ebp - 0x5c], 0
jne 0x40458d
mov dword [ebp - 0x5c], 0x7ff
jmp 0x404596
mov ecx, dword [ebp - 0x5c]
sub ecx, 1
mov dword [ebp - 0x5c], ecx
mov edx, dword [ebp - 0x5c]
push edx
push 0x46712c
call fcn.00404a30
add esp, 8
jmp case.0x4043d0.1
mov eax, dword [ebp - 0x5c]
and eax, 0x80000000
je 0x4045c7
mov ecx, dword [ebp - 0x5c]
add ecx, 1
or ecx, 0x80000000
mov dword [ebp - 0x5c], ecx
jmp 0x4045e2
cmp dword [ebp - 0x5c], 0x7ff
jne 0x4045d9
mov dword [ebp - 0x5c], 0
jmp 0x4045e2
mov edx, dword [ebp - 0x5c]
add edx, 1
mov dword [ebp - 0x5c], edx
mov eax, dword [ebp - 0x5c]
push eax
push str.__Id_set_to_0x_08X_n
call fcn.00404a30
add esp, 8
jmp case.0x4043d0.1
mov ecx, dword [0x4784d4]
push ecx
mov edx, dword [0x4784d0]
push edx
mov eax, dword [0x474024]
push eax
call sub.vxlapi.dll__xlCanRequestChipState_12
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov edx, dword [0x4784d4]
push edx
mov eax, dword [0x4784d0]
push eax
push str.__RequestChipState_:_CM_0x_I64x____s_n
call fcn.00404a30
add esp, 0x10
jmp case.0x4043d0.1
cmp dword [0x4784e4], 0
je 0x404654
mov dword [0x4784e4], 0
jmp 0x40465e
mov dword [0x4784e4], 0x4e20
mov ecx, dword [0x4784e4]
push ecx
mov edx, dword [0x474024]
push edx
call sub.vxlapi.dll__xlSetTimerRate_8
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0x58]
push eax
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov ecx, dword [0x4784e4]
push ecx
push str.__SetTimerRate_____:__d___s_n
call fcn.00404a30
add esp, 0xc
jmp case.0x4043d0.1
cmp dword [ebp - 0x70], 1
jne 0x4046c1
mov dword [ebp - 0x70], 0
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
push str.SILENT
mov ecx, dword [ebp - 0x70]
push ecx
call fcn.004039d0
add esp, 0x10
jmp 0x4046e1
mov dword [ebp - 0x70], 1
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
push str.NORMAL
mov ecx, dword [ebp - 0x70]
push ecx
call fcn.004039d0
add esp, 0x10
jmp case.0x4043d0.1
mov edx, dword [0x474024]
push edx
call sub.vxlapi.dll__xlResetClock_4
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0x58]
push eax
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__ResetClock_______:__s_n
call fcn.00404a30
add esp, 8
jmp case.0x4043d0.1
cmp dword [ebp - 0x6c], 0
je 0x40471f
mov dword [ebp - 0x6c], 0
jmp 0x404726
mov dword [ebp - 0x6c], 1
mov ecx, dword [ebp - 0x6c]
push ecx
call fcn.00403920
add esp, 4
jmp case.0x4043d0.1
call fcn.00403360
jmp case.0x4043d0.1
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
mov ecx, dword [0x474024]
push ecx
call sub.vxlapi.dll__xlGenerateSyncPulse_12
mov word [ebp - 0x58], ax
movzx edx, word [ebp - 0x58]
push edx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov eax, dword [ebp - 0x64]
push eax
mov ecx, dword [ebp - 0x68]
push ecx
push str.__xlGenerateSyncPulse_:_CM_0x_I64x____s_n
call fcn.00404a30
add esp, 0x10
jmp case.0x4043d0.1
mov dword [ebp - 0x90], 1
jmp case.0x4043d0.1
call fcn.00403210
jmp 0x404353
movsx edx, word [ebp - 0x58]
test edx, edx
je 0x4047dc
cmp dword [ebp - 0x6c], 0
je 0x4047dc
mov eax, dword [0x4784d4]
push eax
mov ecx, dword [0x4784d0]
push ecx
mov edx, dword [0x474024]
push edx
call sub.vxlapi.dll__xlDeactivateChannel_12
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0x58]
push eax
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov ecx, dword [0x4784d4]
push ecx
mov edx, dword [0x4784d0]
push edx
push str.__DeactivateChannel:_CM_0x_I64x____s_n
call fcn.00404a30
add esp, 0x10
call fcn.00403dc0
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040691b
mov esp, ebp
pop ebp
ret