I write WINDOWS CLI APP using mingw. I need to read stream that contain mixed raw binary data (0x00) and chars (0x30 for exaple) from console. I try to use main.exe < test.bin (redirect file stream to stdin)
ch=getchar();
or ch=getch();
But this functions does not read data correctly. Where is my mistake?
This is file content: Raw data and decoded text
I try to trace app using gdb but app does not stop at ch=getchar(). I suppouse the problem is in terminal mode but i have no idea how to resolve it. If i send simple text file with hex values debug work fine.