flat assembler
Message board for the users of flat assembler.

Index > Windows > JPEG, GIF and other stream formats

Author
Thread Post new topic Reply to topic
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 04 Jun 2005, 08:53
After very hard work i finished my program, and i want to introduce source code
for it.


Description: main program
Download
Filename: stream2.7z
Filesize: 23.86 KB
Downloaded: 895 Time(s)


_________________
[not enough memory]
Post 04 Jun 2005, 08:53
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 04 Jun 2005, 10:06
small addiction: this program can display jpg, jpeg, gif, dib, bmp formats
Post 04 Jun 2005, 10:06
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 04 Jun 2005, 13:08
Hm, are you both doing CreateStreamOnHGlobal with fDeleteOnRelease=TRUE, and freeing the the memory manually afterwards?
Post 04 Jun 2005, 13:08
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 06 Jun 2005, 18:41
what about supporting png's? just wondering Wink
Post 06 Jun 2005, 18:41
View user's profile Send private message Visit poster's website Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 19 Jun 2005, 10:10
f0dder, this code totally memory-leaks free, every stream and allocated memory are freed after using

donkey7, there is available pnglib, i think that this library can be ported to fasm with ease, but it contains a lot of code, i create this stream example because it contain very simple method to show popular picture formats
Post 19 Jun 2005, 10:10
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 19 Jun 2005, 12:26
Quote:

f0dder, this code totally memory-leaks free, every stream and allocated memory are freed after using

What I meant is that I see you pass TRUE on your CreateStreamOnHGlobal call, but it also seems like you're both manually freeing the memory, as well as calling the picture release method. If this is true, you're introducing a double-free bug, which can cause heap corruption (and does this reproducably on NT4).

If you're not doing the double-free, sorry for misreading your code.
Post 19 Jun 2005, 12:26
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 01 Jul 2010, 19:47
Hello,

I just found this great example.

I'm having a hard time assembling it. For example "enter" and "return" instructions produce errors in FASM.

Also, procs defined like it is in the code is not accepted:

proc _centerwnd, lpWnd


Not sure if I'm missing includes...

Any help to assembly the code with latest FASM?

Thanks!
Post 01 Jul 2010, 19:47
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 01 Jul 2010, 20:13
The example is terribly old so you need to remove all ocurrences of "enter" and replace "return" with "ret". Also, it seems that at that time the locals where handled differently.You'll have to wrap them in a locals/endl block to make them work because otherwise them will end up being executable code.

As for ole32.inc you can fix that by changing "apia" in the path to "api" but I have no solution for oleaut32.inc, you'll have to search if it is available somewhere in this forum.
Post 01 Jul 2010, 20:13
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.