Jump to content
LordJashin

DirectX, OpenGL, Interception...

Recommended Posts

Interception isn't hard at all, but dealing with all that data, and getting it setup initially could take a while. What I don't understand is, why can't SCAR get the image off a DirectX or OpenGL game, sometimes or a lot I think it shows up blank or black?

 

http://www.altdevblogaday.com/2012/04/02/extravagant-cheating-via-direct-x/

 

This D3D9 interceptor program, completely automates the Star Craft 2 game:

 

http://graphics.stanford.edu/~mdfisher/D3D9Interceptor.html

 

 

SCAR has always been based off color reading, not interception. Interception is definitely better, but not if the "devs" can change the data sent. Also in the U.S. you can probably do a lawsuit for this type of thing. So I think color botting still has its place.

 

also...

everybody Edited by LordJashin
Link to comment
Share on other sites

What I don't understand is, why can't SCAR get the image off a DirectX or OpenGL game, sometimes or a lot I think it shows up blank or black?
Not sure on the reason, but it is not hard to work around: One my "side projects" that never saw release was to grab the client area from the desktop itself and set client to that, do color functions, set it back. Worked flawlessly but didn't see much of a use for it so ditched it.
Link to comment
Share on other sites

I liked your idea a lot actually. I think it was to, instead of trying to get the image directly from the client. Get the image of the whole screen/desktop then subtract out to get the box around the client.

 

This could in theory work, and for RS2 we would just need to set the top left point where the box is on the screen. Then the variables in RS2 can tell the width, height of box, and all that.

Link to comment
Share on other sites

I'll see if I can dig up the code if I kept it. Only caveat is the client must be completely visible.

 

Edit: Try this:

 

[sCAR]program DesktopTest;

 

{$DEFINE RS2}

 

{$I OSI\OSI.scar}

 

var

ExistingClient: TSCARWindowClient;

BitmapClient: TSCARBitmapClient;

 

function GetBitmapClient(): TSCARBitmapClient;

var

WindowClient: TSCARWindowClient;

DesktopClient: TSCARWindowClient;

Bitmap: TSCARBitmap;

begin

// This DOES NOT work with smart.

{$IFDEF SMART}

Exit;

{$ENDIF}

 

GetApplication().Minimize();

WindowClient := TSCARWindowClient(GetClient());

DesktopClient := TSCARWindowClient.Create(GetDesktopWindow());

DesktopClient.ImageArea := WindowClient.InputArea;

SetClient(DesktopClient);

Bitmap := DesktopClient.Capture();

Result := TSCARBitmapClient.Create(Bitmap);

SetClient(Result);

end;

 

procedure ScriptTerminate;

begin

FreeOSI();

end;

 

begin

SetUpOSI();

 

ExistingClient := TSCARWindowClient(GetClient());

BitmapClient := GetBitmapClient();

 

// Do something with bitmap client.

 

SetClient(ExistingClient).Free();

end.

[/sCAR]

Edited by Bixby Sayz
Link to comment
Share on other sites

Found some time to find my original files and clean this up so it works properly. Now works with Browser, SMART, and RS Official Client.

 

Note this is overkill if SMART is running in Safe/Software mode. In that case simply grab the bitmap from GetClient.Capture. On a side note I must have renamed this function a dozen times. Can't seem to find a good name that implies what it does.

 

Edit: Double post. My bad.

 

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function ClientBitmapFromDesktop(): TSCARBitmap;

Contributors: Bixby Sayz, Freddy, Brandon

Description: Captures client image to a bitmap from the desktop rather than

the client itself.

Date Created: 2012-10-10. By Bixby Sayz. RS2 Build 736.

Modified: 2012-11-12. By Bixby Sayz. RS2 Build 742.

Note: This will only work if the client is fully visible on the desktop. It

will attempt to bring the client to the foregound, but if this fails then

captured image will be wrong.

Note2: Thank you Freddy, Brandon for the window finding/activating suggestions.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function ClientBitmapFromDesktop(): TSCARBitmap;

var

Scar: TScar; // Scar itself.

OldWindowState: TWindowState; // Current scar window state (normal, maximized, minimized).

{$IFDEF SMART}

WindowHandle: Integer; // Smart client window handle.

{$ENDIF}

ClientWindow: TSCARClient; // Client window.

Desktop: TSCARWindowClient; // Desktop set as client.

begin

Result := nil;

 

// Preserve scar's current window state then minimize to get it out of the

// way. The entire client needs to be visible on screen for this to work.

Scar := GetSelf();

OldWindowState := Scar.WindowState;

Scar.WindowState := wsMinimized;

try

 

// Get client window and bring it to the foreground.

{$IFDEF SMART}

ClientWindow := Smart_Client;

WindowHandle := FindWindowEx('[' + IntToStr(SmartClientIDEx(Smart_Client)) + ']', False, True);

ActivateWindow(WindowHandle);

{$ELSE}

ClientWindow := GetClient();

ClientWindow.Activate();

{$ENDIF}

 

// Get area of desktop that corresponds to client window.

Desktop := TSCARWindowClient.Create(GetDesktopWindow());

{$IFDEF SMART}

Desktop.ImageArea := GetWindowBox(WindowHandle);

with Desktop.ImageArea do

Desktop.ImageArea := Box((X1 + 8), (Y1 + 25 + RSClientY1Offset), (X2 - 24), (Y2 - 45));

{$ELSE}

Desktop.ImageArea := ClientWindow.InputArea;

{$ENDIF}

 

// Capture client from desktop.

Result := Desktop.Capture();

 

finally

// Restore scar's window state.

Scar.WindowState := OldWindowState;

end;

end;

[/sCAR]

Edited by Bixby Sayz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...