Awesome tutorial thx very much for the link ;)
So I'm a very beginner in programing with C++ so I have some question xD.
1st If I understand the tutorial, GG change the 1st 5 bytes of the apply. So we must to rechange the 5 bytes that GG changed before.
So I've download Visual C++ and Visual basics, & created a new DLL project. Then the first code which is:
And BypassedPostmessage.def
And then when I try to compile I've this:
So I'm a very beginner in programing with C++ so I have some question xD.
1st If I understand the tutorial, GG change the 1st 5 bytes of the apply. So we must to rechange the 5 bytes that GG changed before.
So I've download Visual C++ and Visual basics, & created a new DLL project. Then the first code which is:
Code:
// stdafx.h*: fichier Include pour les fichiers Include système standard,
// ou les fichiers Include spécifiques aux projets qui sont utilisés fréquemment,
// et sont rarement modifiés
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclure les en-têtes Windows rarement utilisés
// Fichiers d'en-tête Windows*:
#include <windows.h>
HINSTANCE hInst;
DWORD DLLFunc;
HWND hDragonica;
HWND hWnd;
__declspec(naked) BOOL WINAPI __stdcall myPostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
__asm
{
mov edi, edi
push ebp
mov ebp, esp
jmp [DLLFunc]
}
}
// TODO*: faites référence ici aux en-têtes supplémentaires nécessaires au programme
Code:
// dllmain.cpp : Définit le point d'entrée pour l'application DLL.
#include "stdafx.h"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpvReason*/)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
if (DLLFunc == NULL) {
hInst = LoadLibrary("user32.dll");
DLLFunc = (DWORD)GetProcAddress(hInst, "PostMessageA") + 5;
}
if (hDragonica == NULL) {
hDragonica = ::FindWindow(NULL, "DRAGONICA");
}
}
break;
case DLL_THREAD_ATTACH:
{
if (DLLFunc == NULL) {
hInst = LoadLibrary("user32.dll");
DLLFunc = (DWORD)GetProcAddress(hInst, "PostMessageA") + 5;
}
if (hDragonica == NULL) {
hDragonica = ::FindWindow(NULL, "DRAGONICA");
}
}
break;
case DLL_THREAD_DETACH:
{
if (hInst != NULL) {
// Un-Load DLL
::FreeLibrary(hInst);
hInst = NULL;
}
}
break;
case DLL_PROCESS_DETACH:
{
if (hInst != NULL) {
// Un-Load DLL
::FreeLibrary(hInst);
hInst = NULL;
}
}
break;
}
return TRUE;
}
Code:
LIBRARY "BypassedPostmessage"
EXPORTS
myPostMessageA
Code:
1>------ Début de la régénération globale*: Projet*: BypassedPostmessage, Configuration*: Debug Win32 ------ 1>Suppression des fichiers de sortie et des fichiers intermédiaires du projet 'BypassedPostmessage', configuration 'Debug|Win32' 1>Compilation en cours... 1>stdafx.cpp 1>Compilation en cours... 1>BypassedPostmessage.cpp 1>Compilation en cours... 1>dllmain.cpp 1>c:\users\jerem\documents\visual studio 2008\projects\bypassedpostmessage\bypassedpostmessage\dllmain.cpp(12) : error C2664: 'LoadLibraryW'*: impossible de convertir le paramètre 1 de 'const char [11]' en 'LPCWSTR' 1> Les types pointés n'ont aucun rapport entre eux*; conversion nécessitant reinterpret_cast, cast de style C ou cast de style fonction 1>c:\users\jerem\documents\visual studio 2008\projects\bypassedpostmessage\bypassedpostmessage\dllmain.cpp(16) : error C2664: 'FindWindowW'*: impossible de convertir le paramètre 2 de 'const char [10]' en 'LPCWSTR' 1> Les types pointés n'ont aucun rapport entre eux*; conversion nécessitant reinterpret_cast, cast de style C ou cast de style fonction 1>c:\users\jerem\documents\visual studio 2008\projects\bypassedpostmessage\bypassedpostmessage\dllmain.cpp(24) : error C2664: 'LoadLibraryW'*: impossible de convertir le paramètre 1 de 'const char [11]' en 'LPCWSTR' 1> Les types pointés n'ont aucun rapport entre eux*; conversion nécessitant reinterpret_cast, cast de style C ou cast de style fonction 1>c:\users\jerem\documents\visual studio 2008\projects\bypassedpostmessage\bypassedpostmessage\dllmain.cpp(28) : error C2664: 'FindWindowW'*: impossible de convertir le paramètre 2 de 'const char [10]' en 'LPCWSTR' 1> Les types pointés n'ont aucun rapport entre eux*; conversion nécessitant reinterpret_cast, cast de style C ou cast de style fonction 1>Le journal de génération a été enregistré à l'emplacement "file://c:\Users\Jerem\Documents\Visual Studio 2008\Projects\BypassedPostmessage\BypassedPostmessage\Debug\BuildLog.htm" 1>BypassedPostmessage - 4 erreur(s), 0 avertissement(s) ========== Régénération globale*: 0 a réussi, 1 a échoué, 0 a été ignoré ==========