Accueil > > > CODE POUR DISTRIBUER SES PATCH[MASM]
CODE POUR DISTRIBUER SES PATCH[MASM]
Information sur la source
Description
c pas trop compliquer mais g galéré un moment pour y arriver..donc ca peut servir au autre!!
Source
- .386
- .model flat,stdcall
- option casemap:none
- WinMain proto :DWORD,:DWORD,:DWORD,:DWORD
-
- include \masm32\include\windows.inc
- include \masm32\include\user32.inc
- include \masm32\include\kernel32.inc
- include \masm32\include\comdlg32.inc
-
-
- includelib \masm32\lib\user32.lib
- includelib \masm32\lib\kernel32.lib
- includelib \masm32\lib\comdlg32.lib
-
-
-
-
- .data
- ButtonID equ 1
- ButtonID1 equ 2
- MAXSIZE equ 260
- OUTPUTSIZE equ 512
-
- ClassName db "SimpleWinClass",0
- AppName db " -=EEDY 31 patch=-",0
-
- ButtonClassName db "button",0
- ButtonText db "Go!!",0
- ButtonText1 db "Quitter",0
-
- MenuName db "FirstMenu",0
- ofn OPENFILENAME <>
- FilterString db "All Files",0,"*.*",0
- db "eXecutables",0,"*.exe",0,0
- Exe db MAXSIZE dup(0)
- OurTitle db "Choisis le file à cracker",0
-
- MsgCaption db "Erreur",0
- MsgBoxText db "Fichier protégé en écriture ou utilisé!!",0
-
- MsgCaption1 db "Succès!!",0
- MsgBoxText1 db "Fichier patché avec succès",0
-
-
- NbBytesWritten dd 0
-
- hInstance HINSTANCE ?
- CommandLine LPSTR ?
- hwndButton HWND ?
- hwndButton1 HWND ?
- handle dd ?
-
- byte_a_ecrire db 90h
-
-
-
- .code
- start:
- invoke GetModuleHandle, NULL
- mov hInstance,eax
- invoke GetCommandLine
- invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT
- invoke ExitProcess,eax
-
- WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
- LOCAL wc:WNDCLASSEX
- LOCAL msg:MSG
- LOCAL hwnd:HWND
- mov wc.cbSize,SIZEOF WNDCLASSEX
- mov wc.style, WS_TILED
- mov wc.lpfnWndProc, OFFSET WndProc
- mov wc.cbClsExtra,NULL
- mov wc.cbWndExtra,NULL
- push hInst
- pop wc.hInstance
- mov wc.hbrBackground,COLOR_BTNTEXT +1
- mov wc.lpszClassName,OFFSET ClassName
- invoke LoadIcon,NULL,IDI_APPLICATION
- mov wc.hIcon,eax
- mov wc.hIconSm,eax
- invoke LoadCursor,NULL,IDC_ARROW
- mov wc.hCursor,eax
- invoke RegisterClassEx, addr wc
- INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
- WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\
- CW_USEDEFAULT,250,200,NULL,NULL,\
- hInst,NULL
- mov hwnd,eax
- INVOKE ShowWindow, hwnd,SW_SHOWNORMAL
- INVOKE UpdateWindow, hwnd
- .WHILE TRUE
- INVOKE GetMessage, ADDR msg,NULL,0,0
- .BREAK .IF (!eax)
- INVOKE TranslateMessage, ADDR msg
- INVOKE DispatchMessage, ADDR msg
- .ENDW
- mov eax,msg.wParam
- ret
- WinMain endp
-
- WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
-
- .IF uMsg==WM_DESTROY
- invoke PostQuitMessage,NULL
- .elseif uMsg==WM_CREATE
- ; --> CREER BUTTON
- invoke CreateWindowEx,NULL, ADDR ButtonClassName,\
- ADDR ButtonText,\
- WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
- 10,140,100,20,hWnd,ButtonID,hInstance,NULL
- mov hwndButton,eax
-
- ; --> CREER BUTTON
- invoke CreateWindowEx,NULL, ADDR ButtonClassName,ADDR ButtonText1,\
- WS_CHILD or WS_VISIBLE or BS_PUSHBUTTON ,\
- 130,140,100,20,hWnd,ButtonID1,hInstance,NULL
- mov hwndButton1,eax
-
-
-
-
-
- .ELSEIF uMsg==WM_COMMAND
- mov eax,wParam
- .if ax==1
-
- mov ofn.lStructSize,SIZEOF ofn
- push hWnd
- pop ofn.hWndOwner
- push hInstance
- pop ofn.hInstance
- mov ofn.lpstrFilter, OFFSET FilterString
- mov ofn.lpstrFile, OFFSET Exe
- mov ofn.nMaxFile,MAXSIZE
- mov ofn.Flags, OFN_FILEMUSTEXIST or \
- OFN_PATHMUSTEXIST or OFN_LONGNAMES or\
- OFN_EXPLORER or OFN_HIDEREADONLY
- mov ofn.lpstrTitle, OFFSET OurTitle
- invoke GetOpenFileName, ADDR ofn
-
- .if eax==TRUE
-
- ;Ouverture de l'exe
-
- invoke CreateFileA,offset Exe,0C0000000h ,1,0,3,80h,0
- mov handle, eax
- ;TRES IMPORTANT DE L'OUVRIR DE CETTE FACON SINON CA MARCHE PAS!!
-
-
- .if eax==INVALID_HANDLE_VALUE
- invoke MessageBox, NULL,addr MsgBoxText, addr MsgCaption, MB_OK
- jmp @end
- .endif
-
- ;Deplacement dans le fichier
-
- invoke SetFilePointer,handle,0FEh,0,0 ;on se place a l'offset FE
- ;Ecriture dans le fichier
- mov esi,offset byte_a_ecrire
- invoke WriteFile,handle,esi,1,offset NbBytesWritten,0
-
- ;et voila!
- invoke MessageBox, NULL,addr MsgBoxText1, addr MsgCaption1, MB_OK
- invoke CloseHandle,handle
-
- .endif
-
-
- .else
- invoke DestroyWindow, hWnd
-
- .endif
- .ELSE
- @end:
- invoke DefWindowProc,hWnd,uMsg,wParam,lParam
- ret
- .ENDIF
- xor eax,eax
- ret
- WndProc endp
- end start
.386
.model flat,stdcall
option casemap:none
WinMain proto :DWORD,:DWORD,:DWORD,:DWORD
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\comdlg32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\comdlg32.lib
.data
ButtonID equ 1
ButtonID1 equ 2
MAXSIZE equ 260
OUTPUTSIZE equ 512
ClassName db "SimpleWinClass",0
AppName db " -=EEDY 31 patch=-",0
ButtonClassName db "button",0
ButtonText db "Go!!",0
ButtonText1 db "Quitter",0
MenuName db "FirstMenu",0
ofn OPENFILENAME <>
FilterString db "All Files",0,"*.*",0
db "eXecutables",0,"*.exe",0,0
Exe db MAXSIZE dup(0)
OurTitle db "Choisis le file à cracker",0
MsgCaption db "Erreur",0
MsgBoxText db "Fichier protégé en écriture ou utilisé!!",0
MsgCaption1 db "Succès!!",0
MsgBoxText1 db "Fichier patché avec succès",0
NbBytesWritten dd 0
hInstance HINSTANCE ?
CommandLine LPSTR ?
hwndButton HWND ?
hwndButton1 HWND ?
handle dd ?
byte_a_ecrire db 90h
.code
start:
invoke GetModuleHandle, NULL
mov hInstance,eax
invoke GetCommandLine
invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT
invoke ExitProcess,eax
WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:HWND
mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style, WS_TILED
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra,NULL
mov wc.cbWndExtra,NULL
push hInst
pop wc.hInstance
mov wc.hbrBackground,COLOR_BTNTEXT +1
mov wc.lpszClassName,OFFSET ClassName
invoke LoadIcon,NULL,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx, addr wc
INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\
CW_USEDEFAULT,250,200,NULL,NULL,\
hInst,NULL
mov hwnd,eax
INVOKE ShowWindow, hwnd,SW_SHOWNORMAL
INVOKE UpdateWindow, hwnd
.WHILE TRUE
INVOKE GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
INVOKE TranslateMessage, ADDR msg
INVOKE DispatchMessage, ADDR msg
.ENDW
mov eax,msg.wParam
ret
WinMain endp
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
.elseif uMsg==WM_CREATE
; --> CREER BUTTON
invoke CreateWindowEx,NULL, ADDR ButtonClassName,\
ADDR ButtonText,\
WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
10,140,100,20,hWnd,ButtonID,hInstance,NULL
mov hwndButton,eax
; --> CREER BUTTON
invoke CreateWindowEx,NULL, ADDR ButtonClassName,ADDR ButtonText1,\
WS_CHILD or WS_VISIBLE or BS_PUSHBUTTON ,\
130,140,100,20,hWnd,ButtonID1,hInstance,NULL
mov hwndButton1,eax
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.if ax==1
mov ofn.lStructSize,SIZEOF ofn
push hWnd
pop ofn.hWndOwner
push hInstance
pop ofn.hInstance
mov ofn.lpstrFilter, OFFSET FilterString
mov ofn.lpstrFile, OFFSET Exe
mov ofn.nMaxFile,MAXSIZE
mov ofn.Flags, OFN_FILEMUSTEXIST or \
OFN_PATHMUSTEXIST or OFN_LONGNAMES or\
OFN_EXPLORER or OFN_HIDEREADONLY
mov ofn.lpstrTitle, OFFSET OurTitle
invoke GetOpenFileName, ADDR ofn
.if eax==TRUE
;Ouverture de l'exe
invoke CreateFileA,offset Exe,0C0000000h ,1,0,3,80h,0
mov handle, eax
;TRES IMPORTANT DE L'OUVRIR DE CETTE FACON SINON CA MARCHE PAS!!
.if eax==INVALID_HANDLE_VALUE
invoke MessageBox, NULL,addr MsgBoxText, addr MsgCaption, MB_OK
jmp @end
.endif
;Deplacement dans le fichier
invoke SetFilePointer,handle,0FEh,0,0 ;on se place a l'offset FE
;Ecriture dans le fichier
mov esi,offset byte_a_ecrire
invoke WriteFile,handle,esi,1,offset NbBytesWritten,0
;et voila!
invoke MessageBox, NULL,addr MsgBoxText1, addr MsgCaption1, MB_OK
invoke CloseHandle,handle
.endif
.else
invoke DestroyWindow, hWnd
.endif
.ELSE
@end:
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.ENDIF
xor eax,eax
ret
WndProc endp
end start
Conclusion
des amélioration a venir et je suis en train de concocter un patcher ki compare le fichier d'origine et celui patché et ki sort un patch à distibuer automatikement(100% asm bien sur!) donc a bientot !!
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
[MSTD10] SHAREPOINT 2010 ET TEAM FOUNDATION SERVER[MSTD10] SHAREPOINT 2010 ET TEAM FOUNDATION SERVER par phil
Un post rapide pour vous informer de la disponibilité de la vidéo de ma présentation sur SharePoint 2010 & Team Foundation Server. http://www.microsoft.com/france/vision/mstechdays10/Webcast.aspx?EID=20215d48-02e3-4d43-8c36-e53505c3b316 Dans la ...
Cliquez pour lire la suite de l'article par phil [MSTD10] SQL SERVER 2008 POUR LES DéVELOPPEURS ET VISUAL STUDIO TEAM SYSTEM DATABASE EDITION[MSTD10] SQL SERVER 2008 POUR LES DéVELOPPEURS ET VISUAL STUDIO TEAM SYSTEM DATABASE EDITION par Miiitch
Lors de cette session que j'ai animé avec Rui , j'ai eu l'occasion de présenter, en plus des nouveautés de SQL Server 2008, comment utiliser l'édition "database" de Visual Studio 2008. Le principe? Avoir les mêmes outils lors que l'on travaille avec une b...
Cliquez pour lire la suite de l'article par Miiitch [WF4] LOCALISER SIMPLEMENT UNE ACTIVITé ET SON DESIGNER WPF[WF4] LOCALISER SIMPLEMENT UNE ACTIVITé ET SON DESIGNER WPF par JeremyJeanson
La localisation . vous connaissez ce system miraculeux qui permet à votre application de s'afficher dans la langue de l'utilisateur (à condition de l'avoir intégrée dans votre programme). Comment mettre en place la localisation dans WF4? Cette question m'...
Cliquez pour lire la suite de l'article par JeremyJeanson [TECHDAYS 2010] WEBCASTS ET SLIDES[TECHDAYS 2010] WEBCASTS ET SLIDES par Audrey
Les webcasts des sessions des Techdays 2010 sont maintenant disponibles en ligne ! Me concernant, voici les slides et le webcast de la session Blend 3 / Skechtflow : Dessinez c'est gagné ! (animée avec Michel Perfetti ) Les slides et le webcast : Blend 3/...
Cliquez pour lire la suite de l'article par Audrey NDEPEND V3. J'ADORE SON INTéGRATION AVEC VS2010NDEPEND V3. J'ADORE SON INTéGRATION AVEC VS2010 par tja
Après une petite introduction à son utilisation que vous pouvez lire ici j'ai également eu envie d'installer ma copie et de jouer un peu avec. Après les premières minutes de son utilisation. J'ai tout de suite ADORE. L'utilisation intuitive sans besoi...
Cliquez pour lire la suite de l'article par tja
Logiciels
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 Xlite (v 3.0 build 41150)XLITE (V 3.0 BUILD 41150)c'est un logiciel qui permet de téléphoner par Internet à l'aide d'un compte SIP pratique pour le... Cliquez pour télécharger Xlite Academy System (10.9.3.0)ACADEMY SYSTEM (10.9.3.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
Comparez les prix

HTC Magic
Entre 429€ et 429€
|