Board index » delphi » Problem: Secured "Space" or "Dot"

Problem: Secured "Space" or "Dot"

i open a jpeg file as text to change some attributes of the file
but when i save as .jpg again its no picture because
every jpg, bmp or other file has a secure
"Space" or "Dot" as i call it it can only be written as HEX

and i do not know how to write a hex into a txt file

i added a example bmp file:
i see that in my editor:
|< is the begin and end >|

|<BMF       6   (                       ?   ?           ?  ???    ? ?   >|

thats nice but in hex it says:
BMF....6.....( and so on

written as hex:
42 4D 46 00 00 00 00 00 00 00 36 00 00 00 28 00 => so the 00 is shown as a .
but then i type a dot its 2E and if i type a SPACE its 20

so how can i edit that file to e.g.
|<BMF       6   (                       ?   ?           ?  ???XX? ?   >|
without a hex editor??
i want to write that in Delphi 6

Thanks a lot

begin 666 example.bmp
M0DU&`````````#8````H`````@````(````!`!@``````! ```#$#@``Q X`
9````````````_P``____`````/\`_P``````
`
end

 

Re:Problem: Secured "Space" or "Dot"


maybe an ulucky example because the modiefied bmp is not able to open as
 |<BMF       6   (                       ?   ?           ?  ???XX? ?   >|

but i got some jpgs to work modiefied at certain positions that i found out

"Ludwig Moser" <csad2...@uibk.ac.at> schrieb im Newsbeitrag
news:mAWx7.51642$Pg3.1424852@news.chello.at...

Quote
> i open a jpeg file as text to change some attributes of the file
> but when i save as .jpg again its no picture because
> every jpg, bmp or other file has a secure
> "Space" or "Dot" as i call it it can only be written as HEX

> and i do not know how to write a hex into a txt file

> i added a example bmp file:
> i see that in my editor:
> |< is the begin and end >|

> |<BMF       6   (                       ?   ?           ?  ???    ? ?   >|

> thats nice but in hex it says:
> BMF....6.....( and so on

> written as hex:
> 42 4D 46 00 00 00 00 00 00 00 36 00 00 00 28 00 => so the 00 is shown as a
.
> but then i type a dot its 2E and if i type a SPACE its 20

> so how can i edit that file to e.g.
> |<BMF       6   (                       ?   ?           ?  ???XX? ?   >|
> without a hex editor??
> i want to write that in Delphi 6

> Thanks a lot

Re:Problem: Secured "Space" or "Dot"


Finally got it by my own with some help of a firend

Problemstatus: SOLVED

<thatsItIAmOutaH...@hotmail.com> schrieb im Newsbeitrag
news:xYzJO20hyA9m5PBLZg=D5i4heTrG@4ax.com...

Quote
> "Ludwig Moser" <csad2...@uibk.ac.at> wrote:

> >i open a jpeg file as text to change some attributes of the file
> >but when i save as .jpg again its no picture because
> >every jpg, bmp or other file has a secure
> >"Space" or "Dot" as i call it it can only be written as HEX

> Many editors replace 'unprintable' characters with a space or a dot.
> Unprintable characters are usually those that have an ASCII code of
> less than 32, and in some cases, those with an ASCII code higher than
> 127 - it all depends on the font being used by the editor.

> What is it that you are trying to achieve?  If you're wanting to write
> some sort of image editor, I think you should lower your sights
> somewhat until you've learned the basics of the programming language.
> This may sound a bit harsh, but it's no different to asking somebody
> to cook a souffle when they can't even boil an egg, or to strip down a
> car engine if they can't change a wheel.
> You can't expect to write a complex program like that if you don't
> know the fundamentals like writing data to a file.
> Get yourself some good books on Delphi and/or Pascal and work through
> them, look at the examples supplied with Delphi, and read the Help
> files.

> I don't know what you're trying to change within the JPEG file.  If
> it's palette information, you're probably ok fooling around with it.
> If it's something else like the image size, then you're unlikely to
> get the resulting file to display, because if you increase the image
> size, you need to add a whole load more image data.  That's not that
> easy, because the data in JPEG files are compressed.

> You might want to look around on the internet for information on the
> format of JPEG files if you don't already have it.

> >and i do not know how to write a hex into a txt file

> >i added a example bmp file:
> >i see that in my editor:
> >|< is the begin and end >|

> >|<BMF       6   (

>            ?   ?           ?  ???    ? ?   >|

> >thats nice but in hex it says:
> >BMF....6.....( and so on

> >written as hex:
> >42 4D 46 00 00 00 00 00 00 00 36 00 00 00 28 00 => so the 00 is shown as
a .
> >but then i type a dot its 2E and if i type a SPACE its 20

> >so how can i edit that file to e.g.
> >|<BMF       6   (

>            ?   ?           ?  ???XX? ?   >|
> >without a hex editor??
> >i want to write that in Delphi 6

> >Thanks a lot

> ____
> Chimaera

Other Threads