Page 1 of 10 123 ... LastLast
Results 1 to 25 of 239

Thread: Direct-X Plugin (Beta)

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default Direct-X Plugin (Beta)

    I did say I would release a beta plugin for SMART for Direct-X hooks..

    Well, today (2015-05-23) is the day I release the very first beta test -- Speed test.

    This beta is specifically for testing speed while the plugin gathers data AND renders on the screen. Although, in reality you won't be rendering ALL ID's on screen while botting (you usually only render ID's when gather info to write the script.. not while running it), I need to test the speed while the ID's are all on screen so that I know how to handle rendering on different computers and what to tweak/redo/fix/patch..

    Here goes:

    d3d9.zip


    Place it in the Simba plugin folder. Run:

    Simba Code:
    {$DEFINE SMART}
    {$I SRL-6/SRL.Simba}

    begin
      SetupSRL;
    end.

    Enter Direct-X mode and you should see a bunch of ID's on screen. Log in and you should see model ID's on screen.. Ex:







    What I need (test on a dummy account if you can):

    Does it draw for you? Can you see IDs?
    FPS while all of this is on screen. Is it laggy? Is it responsive? Is it fast? What is the average FPS you're getting? Are your computer's specs good?
    Is the font right? Is it blurry?
    Is it crashing? Do you get a Java log with the crash report?
    Is there missing textures or models?
    Is there two EXACTLY the same models different IDs?
    Last edited by Brandon; 05-24-2015 at 04:18 AM.
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Nice work Brandon, I'll give this a test for sure

    Forum account issues? Please send me a PM

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Works perfect for me, and direct-x runs a hell of a lot better than openGL.

    (srl6 code for anyone)

    Simba Code:
    {$DEFINE SMART}
    {$i srl-6/srl.simba}

    var
      bmp: integer;

    begin
      smartPlugins := ['d3d9.dll'];
      setupSRL();

      bmp := bitmapFromClient(0, 0, getClientBounds().x2 -1, getClientBounds().y2 -1);
      debugBitmap(bmp);
      freeBitmap(bmp);
    end.
    Last edited by Olly; 12-22-2013 at 01:33 AM.

  4. #4
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Awesome. And it's not restricted to RS!

    I have a question, I wanted to take a screenshot from a game and show it in debug window.

    First I do:
    Simba Code:
    DXISetup(gamePID);

    And now there is a function DXIImagePointer() which returns Pointer. But how to convert this PointerToImage to Simba type bmp ?

  5. #5
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by bg5 View Post
    Awesome. And it's not restricted to RS!

    I have a question, I wanted to take a screenshot from a game and show it in debug window.

    First I do:
    Simba Code:
    DXISetup(gamePID);

    And now there is a function DXIImagePointer() which returns Pointer. But how to convert this PointerToImage to Simba type bmp ?
    Simba Code:
    Procedure TGraphics.Create(Width, Height: Integer; Ptr: Uint32); overload
    Begin
      Self.__Bmp.Init(Client.GetMBitmaps);
      Self.__Bmp.SetPersistentMemory(Ptr, Width, Height);
      Self.__Init := True;
      Self.__Width := Width;
      Self.__Height := Height;
      Self.__Bmp.SetTransparentColor(0);
      Insert(@Self, __Bmp__Pointers);
      AddOnTerminate('__TGraphicsFreeAll');
    End;

    The above is from GitHub. Bmp is a TMufasabitmap and to get an int from it, then it's Bmp.GetIndex.

    Can't type much. I'm replying from my phone. You just need to do init, set persistent memory, get index then free when done.
    I am Ggzz..
    Hackintosher

  6. #6
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

  7. #7
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Simba Code:
    Procedure TGraphics.Create(Width, Height: Integer; Ptr: Uint32); overload
    Begin
      Self.__Bmp.Init(Client.GetMBitmaps);
      Self.__Bmp.SetPersistentMemory(Ptr, Width, Height);
      Self.__Init := True;
      Self.__Width := Width;
      Self.__Height := Height;
      Self.__Bmp.SetTransparentColor(0);
      Insert(@Self, __Bmp__Pointers);
      AddOnTerminate('__TGraphicsFreeAll');
    End;

    The above is from GitHub. Bmp is a TMufasabitmap and to get an int from it, then it's Bmp.GetIndex.

    Can't type much. I'm replying from my phone. You just need to do init, set persistent memory, get index then free when done.
    Thanks, I tried it but then I found with whatever PID I use DXISetup() , pointers are the same. I guess it's because game doesn't use your d3d9.dll at all!

    How to force game to load this file instead of windows/system32 one? In your OpenGL tutorial you wrote about placing .dll in the game folder, but if we move it out of Simba/plugins folder would DXI.dll be still able to communicate with it?
    I'm also not sure where to put it, because I'm targeting Unity Web Player :/

  8. #8
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by bg5 View Post
    Thanks, I tried it but then I found with whatever PID I use DXISetup() , pointers are the same. I guess it's because game doesn't use your d3d9.dll at all!

    How to force game to load this file instead of windows/system32 one? In your OpenGL tutorial you wrote about placing .dll in the game folder, but if we move it out of Simba/plugins folder would DXI.dll be still able to communicate with it?
    I'm also not sure where to put it, because I'm targeting Unity Web Player :/
    DXI.dll can communicate with the d3d9.dll no matter where it is. It uses a shared-memory-map. The memory map id never changes.

    It would help if I knew what game it was. Yes it is the same as the OpenGL plugin. You just place it in the application's folder.

    Like GLXSetup, DXISetup also should return a boolean telling you whether it was loaded successfully. If it returns false, the other application did not "successfully" load the plugin.

    Many many things can cause this, such as placing it in the wrong folder, wrong process id (PID), static linkage, etc..
    Last edited by Brandon; 01-03-2014 at 04:58 AM.
    I am Ggzz..
    Hackintosher

  9. #9
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    DXI.dll can communicate with the d3d9.dll no matter where it is. It uses a shared-memory-map. The memory map id never changes.
    Didn't know that. I will read more about it

    Quote Originally Posted by Brandon View Post

    It would help if I knew what game it was. Yes it is the same as the OpenGL plugin. You just place it in the application's folder.

    Like GLXSetup, DXISetup also should return a boolean telling you whether it was loaded successfully. If it returns false, the other application did not "successfully" load the plugin.

    Many many things can cause this, such as placing it in the wrong folder, wrong process id (PID), static linkage, etc..

    I've placed it in firefox folder, same place where plugin-container.exe is. Now I'm sure it's loaded because I can't delete it when game is running (my way of checking:P).

    Now pointers seems to change when I setup game's (actually plugin-container) PID, but image is empty (black). Maybe something is wrong with my code?

    Simba Code:
    program new;
    {$loadlib DXI}
    var Pr:TSysProcArr;
    var bmp : integer;
    var TMB :TMufasaBitmap;
    var P :Pointer;
    begin


    while true do
      if iskeydown(VK_F1) then
      begin
        bmp := CreateBitmap(1,1);
        TMB := GetMufasaBitmap(bmp);

       // writeln(GetProcesses());
        writeln(DXISetup(10880));
        writeln(DXIImagePointer());
        writeln(DXIDebugPointer());
        P := DXIImagePointer();
        TMB.SetPersistentMemory(LongInt(P),1024,768);
        bmp := TMB.GetIndex;
       // DisplayDebugImgWindow(1025,769);
       // DrawBitmapDebugImg(bmp);
        writeln(CreateBitmapString(bmp));
        wait(1000);
        TMB.ResetPersistentMemory;
        TMB.Free;


      end;

    end.


    The game is: http://www.kongregate.com/games/tfender/contract-wars

  10. #10
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by bg5 View Post
    Didn't know that. I will read more about it
    The game is: http://www.kongregate.com/games/tfender/contract-wars
    Updated OP. It should now WORK with the browser properly for any and all games!

    See the pictures on the OP

    The script I used to test it was:

    Simba Code:
    {$loadlib DXI}

    Function PtrToBmp(Width, Height: Integer; Ptr: Pointer): Integer;
    var
      Bmp: TMufasaBitmap;
    Begin
      Bmp.Init(Client.GetMBitmaps);
      Bmp.SetPersistentMemory(Uint32(Ptr), Width, Height);
      Bmp.SetTransparentColor(0);
      Result := Bmp.GetIndex();
    End;

    Procedure DebugBitmap(Bmp: Integer);
    var
      W, H: Integer;
    Begin
      GetBitmapSize(Bmp, W, H);
      DisplayDebugImgWindow(W, H);
      DrawBitmapDebugImg(Bmp);
    End;

    var
      Bmp: Integer;
      W, H: Integer;
    begin
      GetClientDimensions(W, H); //this line requires that you drag the crosshairs on the window.
      if (DXISetup(1388)) then //change the this value to whatever the message box shows LAST!
      begin
        writeln('DXI setup succeeded');
        Bmp := PtrToBmp(W, H, DXIImagePointer());
        DebugBitmap(Bmp);
        FreeBitmap(Bmp);
      end else
        writeln('Failed to setup DXI.');
    end.

    And all I did was place the d3d9.dll plugin in the Chrome/Firefox installation folder. I also have an injector written if you don't want to place it in the folder. Does the same thing but it's more difficult to inject into chrome and firefox child tabs! So yeah, placing it in the folder is the easiest option atm until I get around to writing some more code..


    It is a test plugin so feedback is appreciated.
    Last edited by Brandon; 01-03-2014 at 01:19 PM.
    I am Ggzz..
    Hackintosher

  11. #11
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Updated OP. It should now WORK with the browser properly for any and all games!

    See the pictures on the OP

    And all I did was place the d3d9.dll plugin in the Chrome/Firefox installation folder. I also have an injector written if you don't want to place it in the folder. Does the same thing but it's more difficult to inject into chrome and firefox child tabs! So yeah, placing it in the folder is the easiest option atm until I get around to writing some more code..


    It is a test plugin so feedback is appreciated.
    Awesome Brandon, works like a charm! Finally this game has an option to make screenshot in fullscreen mode :P

    Are you planning to add more features like in OGL plugin?

    @Edit

    Well, it worked in menu at least :P But when I join a room, after map is loaded, Unity crash, everytime.



    Code:
    webplayer_win.dll caused an Integer Divide by Zero (0xc0000094)
      in module webplayer_win.dll at 001b:0588ba22.
    Last edited by bg5; 01-03-2014 at 02:24 PM.

  12. #12
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by bg5 View Post
    Awesome Brandon, works like a charm! Finally this game has an option to make screenshot in fullscreen mode :P

    Are you planning to add more features like in OGL plugin?
    Glad it works That's is always good news! There really hasn't been very many testers for this plugin.. So I am glad.

    I really have no problem adding features in the DXI plugin. It took me what? A couple hours to make this plugin and 5 mins to add browser/smart support? Hooks won't be so hard, same as OpenGL. Testing is what takes time because there usually isn't very many testers or there is usually something that happens on someone else's system that doesn't happen on the developer's. So far I haven't seen any Direct-X bugs at all, unlike the OpenGL ones (and the code is the same :l).

    However, the GLX plugin hasn't really seen much usage so I am hesitant to put effort into creating a hook plugin. At the time of creating this plugin, I only had in mind colour only..

    Direct-X api is actually just as easy for me as OpenGL api (DX may be even easier and better for hooks). Usage or probably the amount of requests would change my mind. If more people want that then sure I'll add it but as of this exact moment, I'm undecided.

    As for the regular features that all graphics plugins must have, yes this plugin already has drawing on the client, it just isn't in use/enabled yet.
    Last edited by Brandon; 01-03-2014 at 02:19 PM.
    I am Ggzz..
    Hackintosher

  13. #13
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    idk what I've done! So put the plugins in my plugin folder - ran the following (& included srl6)

    smartPlugins := ['d3d9.dll'];
    SetupSRL;

    smart loads up but the screen is constantly flashing between


    and the login screen (yes I'm in directx mode).

    What have I done!

  14. #14
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Testing is what takes time because there usually isn't very many testers or there is usually something that happens on someone else's system that doesn't happen on the developer's.
    I can test it for you, as I'm interested in it.

    So far I haven't seen any Direct-X bugs at all, unlike the OpenGL ones (and the code is the same :l).
    See my edit in post above:P I'm curious if it happens to you too.

    As for the regular features that all graphics plugins must have, yes this plugin already has drawing on the client, it just isn't in use/enabled yet.
    Just drawing would be awesome. I could make custom aiming mark :P I've done it before with my ETL, but it can't work in fullscreen mode.

  15. #15
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by bg5 View Post
    I can test it for you, as I'm interested in it.
    See my edit in post above:P I'm curious if it happens to you too.
    Just drawing would be awesome. I could make custom aiming mark :P I've done it before with my ETL, but it can't work in fullscreen mode.
    I haven't tried entering a room. It says: caused an Integer Divide by Zero in web_unity module. I'm curious at to whether this happens only with this plugin?

    @Asha, your plugin isn't even loaded. Notice the Smart buttons say "Disable Capture". If the plugin was loaded, Smart would say "Disable Direct-X" on a button. You are loading it wrong somehow. I'm not familiar with SRL-6's api.
    I am Ggzz..
    Hackintosher

  16. #16
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    I haven't tried entering a room. It says: caused an Integer Divide by Zero in web_unity module. I'm curious at to whether this happens only with this plugin?
    Yes, it always and only happens when your d3d9.dll is in browser folder.

  17. #17
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    idk what I've done! So put the plugins in my plugin folder - ran the following (& included srl6)
    This works fine for me.

    Simba Code:
    {$DEFINE SMART}
    {$i srl-6/srl.simba}

    var
      bmp: integer;

    begin
      smartPlugins := ['d3d9.dll'];
      setupSRL();

      bmp := bitmapFromClient(0, 0, getClientBounds().x2 -1, getClientBounds().y2 -1);
      debugBitmap(bmp);
      freeBitmap(bmp);
    end.

  18. #18
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    idk what I've done! So put the plugins in my plugin folder - ran the following (& included srl6)

    smartPlugins := ['d3d9.dll'];
    SetupSRL;

    smart loads up but the screen is constantly flashing between


    and the login screen (yes I'm in directx mode).

    What have I done!
    did u managed to resolve this? I got the same problem.

    edit: runescape is fine when I disable smart, but enabled it's causing me epileptic seizures (i don't have epilepsia, don't worry )

    (called it the same way as Olly)

    edit: @Brandon; cheeky mention, in case you missed it.
    Last edited by Sjoe; 01-07-2014 at 05:20 AM.

    Creds to DannyRS for this wonderful sig!

  19. #19
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    I'm not sure why the plugin isn't loading for you guys.. Couldn't work better for me. :s

  20. #20
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    @Brandon
    There's this annoying pop up when starting Smart with the DX plugin. It doesn't serve much purpose...

  21. #21
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    @Sjoe

    Can you try this...?

    Simba Code:
    {$loadlib libsmartremote}

    var
      params: TStringArray;

    begin
      params := explode(',', between('<iframe id="game" src="', '"', getPage('http://www.runescape.com/game.ws?j=1')));

      if (not fileExists(PluginPath+'d3d9.dll')) then
      begin
        writeln('NO PLUGIN!@!@@!@');
        terminateScript();
      end;

      smartSpawnClient('java.exe', stringReplace(PluginPath, '\', '/', [rfReplaceAll]), params[0], ',' + params[1], 800, 600, '', '', '', 'd3d9.dll');
    end.

    And see if the plugin successfully loads? (you will see a disable direct-x button).

  22. #22
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  23. #23
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    you don't want me to try it? I see how it is.




    I'll try it too when I get home tonight
    O YEA! it didn't work for you either!

  24. #24
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    still flashing for me

    Creds to DannyRS for this wonderful sig!

  25. #25
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    still flashing for me
    What is actually printed in your Smart console? If you don't have it showing, add: "smartShowConsole := true;" right before calling "setupSRL".

    Then try loading it, copy paste everything into here.. I need to see everything..


    As for the popup riwu, it was added so that someone could see that it actually loaded.. It will of course be removed.
    I am Ggzz..
    Hackintosher

Page 1 of 10 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •