Accueil > > > SCREENSHOT CAPTURE D'ECRAN
SCREENSHOT CAPTURE D'ECRAN
Information sur la source
Description
J'avais besoin d'un screenshot en asm J'ai eu beaucoup de mal a trouver des sources finalement j'ai adapter une source c++ en assembleur (MASM32)
Source
- .486
- .model flat,stdcall
- option casemap:none
-
- include \masm32\include\windows.inc
- include \masm32\include\user32.inc
- include \masm32\include\kernel32.inc
- include \masm32\include\gdi32.inc
- include \masm32\include\masm32.inc
-
- includelib \masm32\lib\user32.lib
- includelib \masm32\lib\kernel32.lib
- includelib \masm32\lib\gdi32.lib
- includelib \masm32\lib\masm32.lib
-
- .data
- bmpname db "c:\toto.bmp",0
-
- .data?
-
- hDC HDC ?
- hMemDC HDC ?
- hBits HANDLE ?
- hFile HANDLE ?
- hBitmap HBITMAP ?
- lpBits LPVOID ?
- dwWritten dd ? ;temp
- Pixel dd ?
- _Height DD ?
- _Width DD ?
- bmFH BITMAPFILEHEADER <>
- bih BITMAPINFOHEADER <>
-
- .code
- start:
- invoke GetDC,0
- mov hDC,eax
- invoke GetSystemMetrics,SM_CXSCREEN
- mov _Width,eax
- invoke GetSystemMetrics,SM_CYSCREEN
- mov _Height,eax
- invoke GetDeviceCaps,hDC, BITSPIXEL
- mov Pixel,eax
- invoke CreateCompatibleDC,hDC
- mov hMemDC,eax
- invoke CreateCompatibleBitmap,hDC, _Width, _Height
- mov hBitmap,eax
- mov ecx,sizeof BITMAPINFO
- mov ebx,sizeof RGBQUAD
- mov eax,256
- mul ebx
- add eax,ecx
- invoke GlobalAlloc,GHND,eax
- mov edx,eax
- invoke GlobalLock,edx
- mov esi,eax
- invoke SelectObject,hMemDC, hBitmap
- invoke BitBlt,hMemDC,0,0,_Width,_Height,hDC,0,0,SRCCOPY
- mov bih.biSize,sizeof BITMAPINFOHEADER
- push _Width
- pop bih.biWidth
- push _Height
- pop bih.biHeight
- mov bih.biPlanes,1
- mov eax,Pixel
- mov bih.biBitCount,ax
- mov bih.biCompression,0
- invoke GetDIBits,hDC, hBitmap, 0,_Height, NULL, esi, DIB_RGB_COLORS
- invoke GetDeviceCaps,hDC, SIZEPALETTE
- mov ebx,sizeof RGBQUAD
- mul ebx
- mov ebx,eax
- mov eax,_Width
- mul _Height
- mul Pixel
- shr eax,3
- mov edi,eax
- mov bmFH.bfType,4d42h
- mov eax,ebx
- add eax,sizeof BITMAPINFOHEADER
- add eax,sizeof BITMAPFILEHEADER
- mov bmFH.bfOffBits,eax
- mov eax,edi
- add eax,bmFH.bfOffBits
- mov bmFH.bfSize,eax
- mov bmFH.bfReserved1,0
- mov bmFH.bfReserved2,0
- invoke CreateFile,ADDR bmpname, GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
- mov hFile,eax
- invoke WriteFile,hFile, addr bmFH, sizeof BITMAPFILEHEADER , ADDR dwWritten, NULL
- invoke WriteFile,hFile, addr bih, sizeof BITMAPINFOHEADER , ADDR dwWritten, NULL
-
- invoke GlobalAlloc,GHND, edi
- mov hBits,eax
- invoke GlobalLock,hBits
- mov lpBits,eax
- invoke GetDIBits,hDC, hBitmap, 0,_Height, lpBits, addr bih, DIB_RGB_COLORS
- invoke WriteFile,hFile,lpBits,edi,ADDR dwWritten,NULL
- invoke GlobalUnlock,hBits
- invoke GlobalFree,hBits
-
- invoke GlobalUnlock,esi
- invoke GlobalFree,edx
- invoke DeleteObject,hBitmap
- invoke DeleteDC,hMemDC
- invoke ReleaseDC,0,hDC
- invoke CloseHandle,hFile
- ret
-
- end start
.486
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\masm32.lib
.data
bmpname db "c:\toto.bmp",0
.data?
hDC HDC ?
hMemDC HDC ?
hBits HANDLE ?
hFile HANDLE ?
hBitmap HBITMAP ?
lpBits LPVOID ?
dwWritten dd ? ;temp
Pixel dd ?
_Height DD ?
_Width DD ?
bmFH BITMAPFILEHEADER <>
bih BITMAPINFOHEADER <>
.code
start:
invoke GetDC,0
mov hDC,eax
invoke GetSystemMetrics,SM_CXSCREEN
mov _Width,eax
invoke GetSystemMetrics,SM_CYSCREEN
mov _Height,eax
invoke GetDeviceCaps,hDC, BITSPIXEL
mov Pixel,eax
invoke CreateCompatibleDC,hDC
mov hMemDC,eax
invoke CreateCompatibleBitmap,hDC, _Width, _Height
mov hBitmap,eax
mov ecx,sizeof BITMAPINFO
mov ebx,sizeof RGBQUAD
mov eax,256
mul ebx
add eax,ecx
invoke GlobalAlloc,GHND,eax
mov edx,eax
invoke GlobalLock,edx
mov esi,eax
invoke SelectObject,hMemDC, hBitmap
invoke BitBlt,hMemDC,0,0,_Width,_Height,hDC,0,0,SRCCOPY
mov bih.biSize,sizeof BITMAPINFOHEADER
push _Width
pop bih.biWidth
push _Height
pop bih.biHeight
mov bih.biPlanes,1
mov eax,Pixel
mov bih.biBitCount,ax
mov bih.biCompression,0
invoke GetDIBits,hDC, hBitmap, 0,_Height, NULL, esi, DIB_RGB_COLORS
invoke GetDeviceCaps,hDC, SIZEPALETTE
mov ebx,sizeof RGBQUAD
mul ebx
mov ebx,eax
mov eax,_Width
mul _Height
mul Pixel
shr eax,3
mov edi,eax
mov bmFH.bfType,4d42h
mov eax,ebx
add eax,sizeof BITMAPINFOHEADER
add eax,sizeof BITMAPFILEHEADER
mov bmFH.bfOffBits,eax
mov eax,edi
add eax,bmFH.bfOffBits
mov bmFH.bfSize,eax
mov bmFH.bfReserved1,0
mov bmFH.bfReserved2,0
invoke CreateFile,ADDR bmpname, GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
mov hFile,eax
invoke WriteFile,hFile, addr bmFH, sizeof BITMAPFILEHEADER , ADDR dwWritten, NULL
invoke WriteFile,hFile, addr bih, sizeof BITMAPINFOHEADER , ADDR dwWritten, NULL
invoke GlobalAlloc,GHND, edi
mov hBits,eax
invoke GlobalLock,hBits
mov lpBits,eax
invoke GetDIBits,hDC, hBitmap, 0,_Height, lpBits, addr bih, DIB_RGB_COLORS
invoke WriteFile,hFile,lpBits,edi,ADDR dwWritten,NULL
invoke GlobalUnlock,hBits
invoke GlobalFree,hBits
invoke GlobalUnlock,esi
invoke GlobalFree,edx
invoke DeleteObject,hBitmap
invoke DeleteDC,hMemDC
invoke ReleaseDC,0,hDC
invoke CloseHandle,hFile
ret
end start
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Lire un text tapée a l'ecran [ par balgrim ]
Bonjour, je voudrais savoir comment lire un texte taper a l'ecran style readln(string) en delphi ou reconniatre les touche taper au clavier sans devoi
ecran de veille [ par jlassi ]
k_jlassije veux realisé un ecran de veille avec l'ASM sur le bios (int 10h)
mode 13h [ par krater ]
RebonjourEnfait je voudrait remplacer une parti de l'ecran par un dessin fixée a l'avanceMon ecran etant un tableau[0;320*200] si je ne me trompe pas
aide sur fond d'ecran [ par knetus12 ]
comment faire un fond d'ecran sans que les divers edit passe en dessous. je l'ai fait avec VerticalTile et le bmp passe en premier plan...
Affichage texte (Debutant) [ par ffomnislash ]
BonjourJe debute en assembleur et je voudrais pouvoir afficher du texte en boucle, ceci j'y arrive sans pb mais le texte se rajouteAutrement dit j'ai
detection ecran [ par patatalo ]
salut,Toujours dans le cadre d'un boot 32 bits, je cherche un moyen de detecter la présence d'un écran afin de pouvoir rediriger les sortie video vers
fond d'ecran [ par sam20 ]
Salut a tous je cherche un bout de code asm pour changer le fond d'ecran de windows sans apiet ce possible? ou directement dans la memoire video.Merci
documentation sur le fonctionnement d'un ecran LCD [ par lost01 ]
Boujours, je viens demander ici de l'aide.En effet je recherche de la documentation sur le fonctionnement d'un ecran LCD ( non TV ) car je ne trouve p
SCREENSHOT PAR URL [ par celbcelbcelb ]
BONJOURJE SUIS TRES DEBUTANT EN LAGUAGE informatique et je voudrais apprendre a ecrire un petit prog qui prend une screenshot si lutilisateur est sur
PICBASIC PB3H et IR [ par jejer6 ]
je voudrais decoder le signal envoyé par mes telecommandes infrarouge.... je capte un signal (en utilisant un photodetecteur) mais je n'arrive pas a l
|
Derniers Blogs
MIX10 A LAS VEGAS : IMMERSIONMIX10 A LAS VEGAS : IMMERSION par odewit
Hi from Vegas !
En resume [je corrigerai les accents a mon retour !], Las Vegas m'impressionne par sa demesure.
Ou que l'on aille, les itineraires traversent des salles bruyantes pleines de machines a sous et de tables de jeu.
Les decors, surtout a...
Cliquez pour lire la suite de l'article par odewit [RIA SERVICES] MAITRE - DéTAIL ET DOMAINDATASOURCE[RIA SERVICES] MAITRE - DéTAIL ET DOMAINDATASOURCE par Audrey
A l'occasion d'un projet client, j'ai utilisé RIA Services avec Silverlight 3 (mais cela fonctionne aussi avec la version 4), et je l'ai utilisé pour une interface façon Maitre / Détail. Voici comment j'ai procédé pour arriver à mes fins. Nous allons pren...
Cliquez pour lire la suite de l'article par Audrey CSDL FUNCTIONCSDL FUNCTION par Matthieu MEZIL
Dans mon post précédent , j'ai utilisé une CSDL Function afin de générer une requête SQL avec un DateDiff utilisant la date courante sur la BD à partir d'une requête LINQ. Dans le cadre de ce post , vous avez probablement remarqué que dans le cadre de plu...
Cliquez pour lire la suite de l'article par Matthieu MEZIL LINQ TO ENTITIESLINQ TO ENTITIES par Matthieu MEZIL
Cette semaine je suis à Montréal en tant que speaker sur Entity Framework pour l'évènement confoo . J'en profite pour remercier les organisateurs de cet évènement de m'avoir fait confiance et Access-IT de m'avoir permis d'y participer. En parallèle, j'ai ...
Cliquez pour lire la suite de l'article par Matthieu MEZIL FAIRE APPARAITRE L'ONGLET 'DéVELOPPEUR' DANS OFFICE 2010FAIRE APPARAITRE L'ONGLET 'DéVELOPPEUR' DANS OFFICE 2010 par neodante
La nouvelle interface d'Office 2010 à amener quelques modifications par rapport à celle de 2007. Certes mineures, ces modifications ont fait disparaître la case à cocher de l'onglet 'Développeur' en première page du panneau du 'bouton Office' (dans Office...
Cliquez pour lire la suite de l'article par neodante
Logiciels
Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise... Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate Xilisoft DVD Ripper Ultimate (5.0.64.0304)XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ... Cliquez pour télécharger Xilisoft DVD Ripper Ultimate Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods Konvertor (4.00)KONVERTOR (4.00)Le logiciel est un gestionnaire multimedia affichant, jouant et convertissant plus de 2000 format... Cliquez pour télécharger Konvertor
|