Function at 0x403bc0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9c
mov eax, dword [0x472058]
xor eax, ebp
mov dword [ebp - 4], eax
xorps xmm0, xmm0
movlpd qword [ebp - 0x68], xmm0
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x6c], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x5c], 1
mov dword [ebp - 0x70], 1
mov dword [ebp - 0x9c], 0
mov dword [ebp - 0x74], 0
cmp dword [ebp + 8], 1
jle 0x403e27
mov eax, 4
shl eax, 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + eax]
push edx
call fcn.004148d0
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.00407510
add esp, 0xc
mov edx, dword [ebp - 0x74]
mov dword [ebp - 0x80], edx
cmp dword [ebp - 0x80], 0x3c
jae 0x403c63
jmp 0x403c68
call fcn.0040642b
mov eax, dword [ebp - 0x80]
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.00404730
add esp, 0x10
push 0x476558
lea eax, [ebp - 0x40]
push eax
call fcn.0044002d
add esp, 8
test eax, eax
je 0x403d12
push str._File_is_Empty______FILE_SIZE:FAILED_n
call fcn.00404730
add esp, 4
call fcn.0041476d
mov ecx, dword [eax]
mov dword [ebp - 0x84], ecx
cmp dword [ebp - 0x84], 2
je 0x403cd7
cmp dword [ebp - 0x84], 0x16
je 0x403cea
jmp 0x403cf9
lea edx, [ebp - 0x40]
push edx
push str.File__s_not_found._n
call fcn.00404730
add esp, 8
jmp 0x403d06
push str.Invalid_parameter_to__stat._n
call fcn.00404730
add esp, 4
jmp 0x403d06
push str.Unexpected_error_in__stat._n
call fcn.00404730
add esp, 4
mov eax, 2
jmp 0x4044e6
mov eax, dword [0x47656c]
push eax
push str.FILE_SIZE:__lu_n
call fcn.00404730
add esp, 8
mov ecx, dword [0x47656c]
mov dword [0x476550], ecx
mov edx, dword [0x47656c]
push edx
call fcn.0041495b
add esp, 4
mov dword [0x476554], eax
cmp dword [0x476554], 0
jne 0x403d6d
mov eax, dword [0x47656c]
push eax
push str.MALLOC_FAILED_____:__lu_n
call fcn.00404730
add esp, 8
mov eax, 2
jmp 0x4044e6
push str.MALLOC_SUCCEEDED_______n
call fcn.00404730
add esp, 4
lea ecx, [ebp - 0x40]
push ecx
push str.File_name_for_FOPEN____s__n
call fcn.00404730
add esp, 8
push 0x465d88
lea edx, [ebp - 0x40]
push edx
call fcn.0041707d
add esp, 8
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
jne 0x403dbe
push str.FILE_OPEN_FAILED________n
call fcn.00404730
add esp, 4
mov eax, 2
jmp 0x4044e6
mov eax, dword [0x47656c]
push eax
push str.FILE_opened:__lu_n
call fcn.00404730
add esp, 8
mov ecx, dword [ebp - 0x7c]
push ecx
push 1
mov edx, dword [0x47656c]
push edx
mov eax, dword [0x476554]
push eax
call fcn.0041732f
add esp, 0x10
mov dword [ebp - 0x90], eax
cmp dword [ebp - 0x90], 1
je 0x403e07
mov eax, 3
jmp 0x4044e6
mov ecx, dword [0x47656c]
push ecx
push str.FILE_Read_OK:__lu_n
call fcn.00404730
add esp, 8
mov edx, dword [ebp - 0x7c]
push edx
call fcn.00416d8f
add esp, 4
push 0x465dd0
call fcn.00404730
add esp, 4
push str.__xlCANdemo___Test_Application_for_XL_Family_Driver_API____n
call fcn.00404730
add esp, 4
push str.______________Vector_Informatik_GmbH___Oct_26_2023_________n
call fcn.00404730
add esp, 4
push str.___________________________________________________________n
call fcn.00404730
add esp, 4
mov dword [ebp + 8], 0
cmp dword [ebp + 8], 1
jle 0x403eb2
mov eax, 4
shl eax, 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + eax]
push edx
call fcn.00416950
add esp, 4
mov dword [0x472028], eax
cmp dword [0x472028], 0
je 0x403eb2
mov eax, dword [0x472028]
push eax
push str.Baudrate___u_n
call fcn.00404730
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 0x403f27
push 0x20
mov eax, 4
shl eax, 0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + eax]
push edx
push 0x20
push str.xlCANdemo
call fcn.004148c3
add esp, 0x10
mov eax, 1
shl eax, 5
mov dword [ebp - 0x88], eax
cmp dword [ebp - 0x88], 0x21
jae 0x403ef1
jmp 0x403ef6
call fcn.0040642b
mov ecx, dword [ebp - 0x88]
mov byte [ecx + str.xlCANdemo], 0
push str.xlCANdemo
push str.AppName___s_n
call fcn.00404730
add esp, 8
mov edx, dword [ebp + 8]
sub edx, 1
mov dword [ebp + 8], edx
mov eax, dword [ebp + 0xc]
add eax, 4
mov dword [ebp + 0xc], eax
cmp dword [ebp + 8], 1
jle 0x403f64
lea ecx, [ebp - 0x5c]
push ecx
push 0x465ee0
mov edx, 4
shl edx, 0
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + edx]
push ecx
call fcn.00404770
add esp, 0xc
cmp dword [ebp - 0x5c], 0
je 0x403f64
mov edx, dword [ebp - 0x5c]
push edx
push str.TX_ID___x_n
call fcn.00404730
add esp, 8
lea eax, [ebp - 0x60]
push eax
lea ecx, [ebp - 0x68]
push ecx
call fcn.00403810
add esp, 8
mov word [ebp - 0x58], ax
movzx edx, word [ebp - 0x58]
push edx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__Init_____________:__s_n
call fcn.00404730
add esp, 8
movsx eax, word [ebp - 0x58]
test eax, eax
jne 0x403fb9
call fcn.00403250
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__Create_RX_thread_:__s_n
call fcn.00404730
add esp, 8
mov edx, dword [0x472024]
push edx
call sub.vxlapi.dll__xlFlushReceiveQueue_4
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0x58]
push eax
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__xlFlushReceiveQueue__:___s_n
call fcn.00404730
add esp, 8
movsx ecx, word [ebp - 0x58]
test ecx, ecx
jne 0x40403e
push 8
push 1
mov edx, dword [0x4764d4]
push edx
mov eax, dword [0x4764d0]
push eax
mov ecx, dword [0x472024]
push ecx
call sub.vxlapi.dll__xlActivateChannel_20
mov word [ebp - 0x58], ax
movzx edx, word [ebp - 0x58]
push edx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov eax, dword [0x4764d4]
push eax
mov ecx, dword [0x4764d0]
push ecx
push str.__ActivateChannel__:_CM0x_I64x___s_n
call fcn.00404730
add esp, 0x10
movsx edx, word [ebp - 0x58]
test edx, edx
jne 0x40403e
mov dword [ebp - 0x6c], 1
mov eax, dword [ebp - 0x64]
push eax
mov ecx, dword [ebp - 0x68]
push ecx
mov edx, dword [ebp - 0x60]
push edx
push str._n:_Press__h__for_help___actual_channel_Ch_d__CM0x_02I64x_n
call fcn.00404730
add esp, 0x10
cmp dword [ebp - 0x8c], 0
jne 0x40448f
lea eax, [ebp - 0x94]
push eax
push 1
lea ecx, [ebp - 0x54]
push ecx
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleInputA]
cmp dword [ebp - 0x94], 1
jne case.0x4040d4.1
movzx edx, word [ebp - 0x54]
cmp edx, 1
jne case.0x4040d4.1
cmp dword [ebp - 0x50], 0
je case.0x4040d4.1
movsx eax, byte [ebp - 0x46]
mov dword [ebp - 0x98], eax
mov ecx, dword [ebp - 0x98]
mov dword [ebp - 0x78], ecx
mov edx, dword [ebp - 0x78]
sub edx, 0x1b
mov dword [ebp - 0x78], edx
cmp dword [ebp - 0x78], 0x5e
ja case.0x4040d4.1
mov eax, dword [ebp - 0x78]
movzx ecx, byte [eax + 0x404540]
jmp dword [ecx*4 + 0x4044f4]
cmp dword [0x4764e0], 0
je 0x4040fd
mov dword [0x4764e0], 0
push str.__screen_on_n
call fcn.00404730
add esp, 4
jmp 0x404114
mov dword [0x4764e0], 1
push str.__screen_off_n
call fcn.00404730
add esp, 4
jmp case.0x4040d4.1
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
mov ecx, dword [ebp - 0x5c]
push ecx
call fcn.004032e0
add esp, 0xc
jmp case.0x4040d4.1
cmp dword [0x476500], 0
je 0x404142
call fcn.00403500
jmp 0x404156
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
mov ecx, dword [ebp - 0x5c]
push ecx
call fcn.00403530
add esp, 0xc
jmp case.0x4040d4.1
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
mov ecx, dword [ebp - 0x5c]
push ecx
call fcn.004035b0
add esp, 0xc
jmp case.0x4040d4.1
cmp dword [ebp - 0x60], 0
jne 0x404183
mov edx, dword [0x472be4]
mov dword [ebp - 0x60], edx
mov eax, dword [ebp - 0x60]
sub eax, 1
mov dword [ebp - 0x60], eax
imul ecx, dword [ebp - 0x60], 0xe3
mov edx, dword [ecx + 0x472c3a]
mov eax, dword [ecx + 0x472c3e]
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, 0x472c10
push eax
imul ecx, dword [ebp - 0x60], 0xe3
movzx edx, byte [ecx + 0x472c39]
push edx
push 0x465fcc
call fcn.00404730
add esp, 0x14
jmp case.0x4040d4.1
mov eax, dword [ebp - 0x60]
add eax, 1
mov dword [ebp - 0x60], eax
mov ecx, dword [ebp - 0x60]
cmp ecx, dword [0x472be4]
jb 0x4041f6
mov dword [ebp - 0x60], 0
imul edx, dword [ebp - 0x60], 0xe3
mov eax, dword [edx + 0x472c3a]
mov ecx, dword [edx + 0x472c3e]
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x64], ecx
mov edx, dword [ebp - 0x64]
push edx
mov eax, dword [ebp - 0x68]
push eax
imul ecx, dword [ebp - 0x60], 0xe3
add ecx, 0x472c10
push ecx
imul edx, dword [ebp - 0x60], 0xe3
movzx eax, byte [edx + 0x472c39]
push eax
push str.__TX_Channel_set_to_channel:__02d___s_CM_0x_I64x__n
call fcn.00404730
add esp, 0x14
jmp case.0x4040d4.1
mov ecx, dword [ebp - 0x5c]
xor ecx, 0x80000000
mov dword [ebp - 0x5c], ecx
mov edx, dword [ebp - 0x5c]
push edx
push 0x466034
call fcn.00404730
add esp, 8
jmp case.0x4040d4.1
mov eax, dword [ebp - 0x5c]
and eax, 0x80000000
je 0x404283
mov ecx, dword [ebp - 0x5c]
sub ecx, 1
or ecx, 0x80000000
mov dword [ebp - 0x5c], ecx
jmp 0x40429b
cmp dword [ebp - 0x5c], 0
jne 0x404292
mov dword [ebp - 0x5c], 0x7ff
jmp 0x40429b
mov edx, dword [ebp - 0x5c]
sub edx, 1
mov dword [ebp - 0x5c], edx
mov eax, dword [ebp - 0x5c]
push eax
push 0x466048
call fcn.00404730
add esp, 8
jmp case.0x4040d4.1
mov ecx, dword [ebp - 0x5c]
and ecx, 0x80000000
je 0x4042cd
mov edx, dword [ebp - 0x5c]
add edx, 1
or edx, 0x80000000
mov dword [ebp - 0x5c], edx
jmp 0x4042e8
cmp dword [ebp - 0x5c], 0x7ff
jne 0x4042df
mov dword [ebp - 0x5c], 0
jmp 0x4042e8
mov eax, dword [ebp - 0x5c]
add eax, 1
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x5c]
push ecx
push str.__Id_set_to_0x_08X_n
call fcn.00404730
add esp, 8
jmp case.0x4040d4.1
mov edx, dword [0x4764d4]
push edx
mov eax, dword [0x4764d0]
push eax
mov ecx, dword [0x472024]
push ecx
call sub.vxlapi.dll__xlCanRequestChipState_12
mov word [ebp - 0x58], ax
movzx edx, word [ebp - 0x58]
push edx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov eax, dword [0x4764d4]
push eax
mov ecx, dword [0x4764d0]
push ecx
push str.__RequestChipState_:_CM_0x_I64x____s_n
call fcn.00404730
add esp, 0x10
jmp case.0x4040d4.1
cmp dword [0x4764e4], 0
je 0x40435a
mov dword [0x4764e4], 0
jmp 0x404364
mov dword [0x4764e4], 0x4e20
mov edx, dword [0x4764e4]
push edx
mov eax, dword [0x472024]
push eax
call sub.vxlapi.dll__xlSetTimerRate_8
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov edx, dword [0x4764e4]
push edx
push str.__SetTimerRate_____:__d___s_n
call fcn.00404730
add esp, 0xc
jmp case.0x4040d4.1
cmp dword [ebp - 0x70], 1
jne 0x4043c6
mov dword [ebp - 0x70], 0
mov eax, dword [ebp - 0x64]
push eax
mov ecx, dword [ebp - 0x68]
push ecx
push str.SILENT
mov edx, dword [ebp - 0x70]
push edx
call fcn.00403780
add esp, 0x10
jmp 0x4043e6
mov dword [ebp - 0x70], 1
mov eax, dword [ebp - 0x64]
push eax
mov ecx, dword [ebp - 0x68]
push ecx
push str.NORMAL
mov edx, dword [ebp - 0x70]
push edx
call fcn.00403780
add esp, 0x10
jmp case.0x4040d4.1
mov eax, dword [0x472024]
push eax
call sub.vxlapi.dll__xlResetClock_4
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
push str.__ResetClock_______:__s_n
call fcn.00404730
add esp, 8
jmp case.0x4040d4.1
cmp dword [ebp - 0x6c], 0
je 0x404423
mov dword [ebp - 0x6c], 0
jmp 0x40442a
mov dword [ebp - 0x6c], 1
mov edx, dword [ebp - 0x6c]
push edx
call fcn.004036d0
add esp, 4
jmp case.0x4040d4.1
call fcn.00403110
jmp case.0x4040d4.1
mov eax, dword [ebp - 0x64]
push eax
mov ecx, dword [ebp - 0x68]
push ecx
mov edx, dword [0x472024]
push edx
call sub.vxlapi.dll__xlGenerateSyncPulse_12
mov word [ebp - 0x58], ax
movzx eax, word [ebp - 0x58]
push eax
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov ecx, dword [ebp - 0x64]
push ecx
mov edx, dword [ebp - 0x68]
push edx
push str.__xlGenerateSyncPulse_:_CM_0x_I64x____s_n
call fcn.00404730
add esp, 0x10
jmp case.0x4040d4.1
mov dword [ebp - 0x8c], 1
jmp case.0x4040d4.1
call fcn.00402fc0
jmp 0x404057
movsx eax, word [ebp - 0x58]
test eax, eax
je 0x4044df
cmp dword [ebp - 0x6c], 0
je 0x4044df
mov ecx, dword [0x4764d4]
push ecx
mov edx, dword [0x4764d0]
push edx
mov eax, dword [0x472024]
push eax
call sub.vxlapi.dll__xlDeactivateChannel_12
mov word [ebp - 0x58], ax
movzx ecx, word [ebp - 0x58]
push ecx
call sub.vxlapi.dll__xlGetErrorString_4
push eax
mov edx, dword [0x4764d4]
push edx
mov eax, dword [0x4764d0]
push eax
push str.__DeactivateChannel:_CM_0x_I64x____s_n
call fcn.00404730
add esp, 0x10
call fcn.00403b70
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040661b
mov esp, ebp
pop ebp
ret