How to extract MM files from an MM1 packet in a reasonable time?

How to extract MM files from an MM1 packet in a reasonable time? SearchSearch
Author Message
M.
New member
Username: Marmarchi

Post Number: 1
Registered: 11-2004
Posted on Tuesday, November 09, 2004 - 10:53 am:   

Hi all,
I'm member of a student group. we're researching and working on an MMS project.
I need to extract Multi Media files from an MM1 packet.
the only solution I know is based on start and end pattern of an MM file. I've found the start pattern and end pattern of some file formats which are used in MMS messages.(e.g. jpeg,gif,bmp,...)
my program operates as follow:
1- scan from the beginning of packet untill find a start pattern.
2- continue scanning EVERY bytes untill find the corresponding end pattern.
3- save all bytes between start and end pattern in a file. this file is the final MM file.
In theory this solution should work. it even works for a very small file.
but when I run my program with an MM1 packet which has a real image file, the runtim is very long and at last the operating system will end the program.

what should I do to reduce the runtime?
do you think I can improve the algorithm?
I thought maybe nowsms can help me because it is doing this in a short time when sending an MMS from a mobile set to an email address.

Thank you in advance
N. M.