na screenie widac kolory. To jest gra taka 3d flyff moze ktos zna. Ona blokuje prawie wszystko. Najlepsze jest to ze jak zrobilem na zywca screena w delphi i chcialem z niego pobrac kolor to wlasnie tylko czarny wywalalo :P no ale jak juz go zapisze do pliku to kolory sa. Moze by to w asmie jakos zrobic? Przeszukalem cale google i znalazlem kilka rzeczy ale do konca nie dzialaja. Np to:
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <winuser.h>
#include <stdlib.h>
#include <conio.h>
#include <iomanip>
using namespace std;
DWORD _PMA = NULL; //Third Error
_PMA = (DWORD)GetProcAddress(LoadLibrary("user32.dll"), "PostMessageA") + 5;//First,Second and Fourth Errors
int i=0;
__declspec(naked) BOOL WINAPI _PostMessageA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
__asm{
//All the remaining 4 errors.
"mov edi, edi"
"push ebp"
"mov esp, ebp"
"jmp dword ptr ds:[_PMA]"
};
while(i<657){
HWND hwndXD=FindWindow(NULL , "9Dragons");
_PostMessageA(hwndXD, WM_KEYDOWN, 0x34, (MapVirtualKey(0x34, 0) << 4));
i++;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
<<--- i to powinno dzialac wg niektorych osob :P szkoda ze w c++ ale dobra juz
pozniej znalazlem to:
library GPPMX;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows;
{$R *.res}
function GPX(hdc: HDC; nXPos: integer; nYPos: Integer):COLORREF;stdcall;
var
Neeeew:DWORD;
hHandle:THandle;
begin
hHandle:=LoadLibrary('gdi32.dll');
Neeeew:=DWORD(GetProcAddress(hHandle,'GetPixel'))+ 5;
asm
mov edi,edi
push ebp
mov esp,ebp
jmp [Neeeew]
end;
end;
function PMX(hWnd:HWND; MSG:UINT; WPARAM:wParam; LPARAM:lParam):BOOL;stdcall; export;
var
DblWord:DWORD;
hHandle:THandle;
begin
hHandle:=LoadLibrary('user32.dll');
DblWord:=DWORD(GetProcAddress(hHandle,'PostMessage A'))+5;
asm
mov edi,edi
push ebp
mov esp,ebp
jmp [DblWord]
end;
end;
exports
GPX,
PMX;
begin
end.
pozniej np zeby ominac PostMessage to znalazlem to:
uses
SysUtils,
Classes,
windows;
{$R *.res}
var
DblWord: DWORD;
hHandle: THandle;
procedure DllMain(reason: integer) ;
begin
case reason of
DLL_PROCESS_ATTACH:
begin
hHandle:=LoadLibrary('user32.dll');
DblWord:=DWORD(GetProcAddress(hHandle,'PostMessageA'))+5;
end;
DLL_PROCESS_DETACH
begin
FreeLibrary(hHandle);
end;
end;
end; (*DllMain*)
function myPostMessageA(hWnd:HWND; MSG:UINT; WPARAM:wParam; LPARAM:lParam):BOOL;stdcall; export;
begin
asm
mov edi,edi
push ebp
mov esp,ebp
jmp [DblWord]
end;
end;
exports myPostMessageA;
begin
DllProc := @DllMain;
DllProc(DLL_PROCESS_ATTACH) ;
end.
Umie ktos to " naprawic" ? :P z tymi funkcjami mi wywala zazwyczaj blad odczytu jakis chociaz z postmessage juz mi sie udalo zrobic. (dlle wszystkie mam skompletowane)