Sponsored Content
Top Forums Programming Serial file transfer protocol / checksums Post 302786681 by nidal on Thursday 28th of March 2013 07:13:28 AM
Old 03-28-2013
Quote:
Who wrote the STB firmware that carries on this conversation? I guess it is not what is being overwritten, but a sort of BIOS for the STB.
True, i realised that this file is not the real firmware file, its the first part of downloading firmware and i was told that this part (this file) purpose is to program a microcontroller in the board to make it able to connect through ethernet to continue downloading the second file of firmware with TFTP, but i dont beleive this, because the kernel is already existing in (i think) a kind of microcontroller embedded as a microOS.
I see the content of the first file as : a first part of it is unreadable, make me remember HEX files translated from a microchip PIC program so it could be a program for the second microcontroller of the STB, the second part is readable and i guess it gives how the STB will treat the second file, this is a sample of the communication in this level:

Image


Quote:
What is the LINUX code written in?
If i knew, i could do better understood this protocol, i only have the linux executable application and not a code, i asked before if there is somehow to analyse a code from an executable application, a kind of reverse engineering, found nothing.

Quote:
The windows code?
this is what i'm working on using Labwindows/cvi, i'm just simulating this protocol without success till the moment coz of something strange in this communication.

---------- Post updated at 06:13 AM ---------- Previous update was at 03:34 AM ----------

Problem solved.
I thought that the linux PC is the master of this communication so that the response from the STB is just a report, as i didnt get what kind of protocols it is, and didnt found out how the cheks are calculated i ignored the response and sent the file continuously block by block, but when i thinked what if the STB was the master and it is probably the master as it sends the file name first as a request, so waiting the STB response before continuing transfer process is maybe needed.
So as i know that the STB will certenly respond with the known answers (t0,t1,...,t128) i didnt controlled them but just inserted a delay of 0.1 s between blocks to let the STB send the request and then be able to receive the next block.

It was my bad.
But the source of problem was that the spying link that i made is not in the middle, it was in the PC rs232 side , so i left 2 meters of the existing link on the STB side, so the communication that i got contain a retard in the STB frames :


Quote:
the PC sent at 100 ms :
[ 1 kb of data
[ a header A
[for exemple 150 bytes of data

the STB sent at 102 ms:
[ a header as a response for header A

the PC sent at 102.02 ms:
[ (1024-150) bytes of data
[ header B
and so on...

so as you can see the 150 bytes of data made me think that the response for header A is just a report and that the STB can still receive data continuously without a breack to calculate the checks and give the response.

Now i have two options :

1- i copy parts of the communication ( file blocks and headers) and use them as they are in my application ( the stupid way of emulation)

2- search more for this strange protocol to find out how it calculates checksums and make my application autonomous.

all the headers contain 3 parts [command of 4bytes]+[file position / size loaded ] + [checksum of 4bytes]
i can let the command part as it is, the position or the size could be just incremented,
what do you think about the checksums? a 4 bytes checksum that is calculated from something that could be a block of 1024 bytes or a serie of blocks ?

I found the next: the checksum given by the STB is not a checksum, its a static answer, i tried the download with two versions of this file, one with 127 kb and one with 126 kb and i found that those are the same unless that the 127 have one more and always the last one does not contain a static checksum but the contains the number of bytes loaded in hexadecimal for exemple for the 127k file the last is 0x00 0x01 0xFD 0x22 = 130338 which is the real number of bytes contained in the file, so the response checksum doesnt make any trouble. i guess its a confirmation static code.

but for the checksum sent by the PC i didnt found any clue,
Quote:
what do you think about the checksums? a 4 bytes checksum that is calculated from something that could be a block of 1024 bytes or a serie of blocks ?
 

9 More Discussions You Might Find Interesting

1. Programming

File transfer using Zmodem protocol

can anybody guide me how do i initiate file transfer over modem using zmodem protocol... (0 Replies)
Discussion started by: borntorock
0 Replies

2. SCO

Serial File Transfer

I need to transfer files from a sco/unix system to a windows xp system and they are only connected via a digiboard serial connection. The terminal emulation software connects and runs a program but I need to transfer files. Anyone know a good solution? (2 Replies)
Discussion started by: chansen
2 Replies

3. Programming

how i can transfer and receive file in any format over serial port

helo i m using fedora core 6 o.s. i want to develop application using c,c++ which transfer file in any format(like pdf,txt,doc etc) over the serial port and i want to receive the same file from the serial port please guide me. amit (4 Replies)
Discussion started by: amitpansuria
4 Replies

4. Shell Programming and Scripting

Secure File Transfer Protocol

Hi, Is there any protocol other than SFTP to transfer the file using secured connection SSH. ? Regards, Arthik (2 Replies)
Discussion started by: arthikbabu
2 Replies

5. HP-UX

SFTP Protocol: How to transfer the file in PC Format

Hi, We are facing issue with files transfered using SFTP in Hp-UX. The transfered files are in Unix Format. That is, file format as UNIX (LF) instead of a PC format (CR & LF). How can we achieve file transfers as PC format using SFTP? Your help and input will be highly appreciated. ... (2 Replies)
Discussion started by: brap45
2 Replies

6. UNIX for Dummies Questions & Answers

How do i transfer file using ftp protocol in Linux.

Hi , I want to transfer file using ftp protocol . I m using following linux distribution. LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: OracleVMserver Description: Oracle VM server release 2.2.0 Release: 2.2.0 Codename: ... (5 Replies)
Discussion started by: pinga123
5 Replies

7. SCO

Need some advice concerning file transfer with a serial connection

Hi, I have a SCO Unix ver 5.0.7 from which I need to get some files. The problem is that I'm working remotely (have no physical access) and using Dejawin because this server is only has a serial connection to a Windows machine. Ucopy isn't on the server. What I was thinking is to do a print... (5 Replies)
Discussion started by: spartanboy184
5 Replies

8. Solaris

Transfer files from windows to solaris with winscp (file protocol:SFTP)

Hello, I have a couple of zip files to be copied from my local drive to a folder in solaris10 residing in a VM ware. i am using WINSCP, I tried to get hold of the solaris hostname or ip using ifconfig -a , hostname|nslookup etc. when i create a new session in WINSCP using that IP and port... (6 Replies)
Discussion started by: herbich1985
6 Replies

9. Shell Programming and Scripting

file transfer using AWK over serial port

I have a unix system that only has AWK to program with which hooks up to a windows or linux based system with all progamming and software capabilities. The link between the systems is typically a 9600 baud TTY port on the AWK system and COM1 on the other system. I can cat <filenm> from the unix... (4 Replies)
Discussion started by: bobfrog
4 Replies
All times are GMT -4. The time now is 08:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy