flat assembler
Message board for the users of flat assembler.

Index > Windows > Hilfe bei mein Programm (BMP Datein in Buffer Laden ??)

Author
Thread Post new topic Reply to topic
Harald2026



Joined: 13 Apr 2026
Posts: 2
Harald2026 13 Apr 2026, 09:12
Ich brauche Hilfe bei meinem Programm, da ich noch Neuling im Bereich Windows-Programmierung bin. In mein einfaches Programm möchte ich eine BMP-Datei in den Puffer laden, aber trotz mehrerer Versuche mit Beispielen hat es nicht funktioniert. Was mache ich falsch?


Description: Dies ist mein Programm , fehlt nur noch BMP Datei in Buffer einladen
Download
Filename: HaraldWinT.asm
Filesize: 55.97 KB
Downloaded: 10 Time(s)

Post 13 Apr 2026, 09:12
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 229
Location: Madrid - Spain
avcaballero 13 Apr 2026, 10:41
https://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=4&Lang=1&nivel=0&padre=0&accion=0

I made these examples some year ago, reading some file graphics putting them in memory, but just in c, asm version are not ready. There may be standard Windows functions that handle it in a more orthodox way; in my case, I did it by reading directly from the file.

Your program is a bit long to read it easy and German comments are still a bit challenge for me Smile
Post 13 Apr 2026, 10:41
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4428
Location: vpcmpistri
bitRAKE 13 Apr 2026, 10:47
Were you just concerned with the commented portion?
Code:
hFile           dq ?    ; HANDLE
fileSize        dq ?    ; uint
pBuffer         dq ?    ; VOID*
bytesRead       dd ?    ; uint

invoke CreateFileA, "Logo.bmp", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NUL
mov [hFile], rax

invoke GetFileSize, [hFile], NULL
mov [fileSize], rax ; assume high-dword zero

invoke VirtualAlloc,NULL, [fileSize], MEM_COMMIT or MEM_RESERVE, PAGE_READWRITE
mov [pBuffer], rax

invoke ReadFile, [hFile], [pBuffer], [fileSize], addr bytesRead, 0

invoke CloseHandle, [hFile]    
... perhaps?

_________________
¯\(°_o)/¯ AI may [not] have aided with the above reply.
Post 13 Apr 2026, 10:47
View user's profile Send private message Visit poster's website Reply with quote
Harald2026



Joined: 13 Apr 2026
Posts: 2
Harald2026 14 Apr 2026, 07:37
Hallo , danke mal in voraus .
Wird das mal testen !!!
Post 14 Apr 2026, 07:37
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-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.