• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 7 of 7

    Thread: D3D drawing...

    1. #1
      Coder
      Kappa
       
      Hacking
       
      Szaka's Avatar
      Join Date
      Mar 2013
      Posts
      168
      Thanks (-->)
      1
      Thanks (<--)
      6

      D3D drawing...

      John Kittz
      hello. I have created d3d drawing class which works good and it draws rectagles etc in my exe. I wanted to draw in my exe but from dll. I hooked endscene by vtable (working) and draw a rectangle with my function. It crashes..

      This is code which works:

      HRESULT WINAPI mojeEndScene(LPDIRECT3DDEVICE9 q){
      q->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
      return realEndScene(q);
      }

      This cdode does not work:
      HRESULT WINAPI mojeEndScene(LPDIRECT3DDEVICE9 q){
      draw.Rect(200,200,200,200,D3DCOLOR_XRGB(123,123,123),q);
      return realEndScene(q);
      }

      Function is written good (i can call it from exe) and it looks like that in debugger:

      002B159B |. 68 000000FF PUSH FF000000 ; /Arg5 = FF000000
      002B15A0 |. 6A 14 PUSH 14 ; |Arg4 = 00000014
      002B15A2 |. 6A 02 PUSH 2 ; |Arg3 = 00000002
      002B15A4 |. 6A 0A PUSH 0A ; |Arg2 = 0000000A
      002B15A6 |. 68 62020000 PUSH 262 ; |Arg1 = 00000262
      002B15AB |. E8 50FAFFFF CALL D3D.MALARNIA::Rect ; \MALARNIA::Rect

      but when i call it from my hook it looks like this:

      6EFC10A0 55 PUSH EBP
      6EFC10A1 8BEC MOV EBP,ESP
      6EFC10A3 E8 58FFFFFF CALL 6EFC1000 // WHY THE FUCK THERE ARE NO PARAMS????
      6EFC10A8 5D POP EBP
      6EFC10A9 - FF25 5833FC6E JMP DWORD PTR DS:[6EFC3358] ; d3d9.5527279F // this is ump to rest of EndScene


      If i NOP the CALL 6EFC1000 everything runs fine. So question : why compiler doesnt add parameters??

    2. #2
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      Really strange that the function isn't called normally. Don't think it will matter but try defining the function globally instead of in a class and manually add __cdecl to it. I don't have many ideas regarding your issue really..
      D3D drawing...

    3. #3
      Hacker
      ^.^
       
      Eating
       
      NTvalk's Avatar
      Join Date
      Jul 2013
      Location
      Your RAM
      Posts
      512
      Thanks (-->)
      176
      Thanks (<--)
      145
      Do you know 100% sure you are hooking right?

    4. #4
      Coder
      Kappa
       
      Hacking
       
      Szaka's Avatar
      Join Date
      Mar 2013
      Posts
      168
      Thanks (-->)
      1
      Thanks (<--)
      6
      i rewrote code from scratch and it works fine :3

    5. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      YMelvan's Avatar
      Join Date
      Nov 2013
      Posts
      2
      Thanks (-->)
      0
      Thanks (<--)
      0
      Cool Helloy=)

    6. #6
      Coder
      Kappa
       
      Hacking
       
      Szaka's Avatar
      Join Date
      Mar 2013
      Posts
      168
      Thanks (-->)
      1
      Thanks (<--)
      6
      Why this simple thing does not work?

      HRESULT (WINAPI* realDrawIndexedPrimitive)(LPDIRECT3DDEVICE9,D3DPRIMITIVETYPE,INT,UINT,UINT,UINT,UINT);
      HRESULT mojeDrawIndexedPrimitive(LPDIRECT3DDEVICE9 device,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinIndex,UINT NumVertices,UINT StartIndex,UINT PrimitiveCount){
      return realDrawIndexedPrimitive(device, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
      }


      Code which does nothing but just empty hook. I looked in asm and everything works fine. But after around 10 calls to it it crashes the app....

    7. #7
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      Cheats'n'Trainers
      Log the return address of the trampoline, is it valid when you crash?
      D3D drawing...

    Similar Game Hacker Threads

    1. [Help] Logic For Drawing ESP
      By Ashesh in forum ESP - WorldToScreen - ViewMatrix
      Replies: 2
      Last Post: 05-22-2016, 09:28 AM
    2. [Help] External drawing for GTA V [C#]
      By Raw Development in forum Hacking Help
      Replies: 5
      Last Post: 04-01-2016, 08:56 AM
    3. [Help] ESP Drawing wrong
      By Camaru in forum Hacking Help
      Replies: 5
      Last Post: 11-17-2015, 05:15 PM
    4. Drawing In OpenGL
      By Solaire in forum Direct-X, OpenGL
      Replies: 3
      Last Post: 01-27-2015, 07:00 PM
    5. [Help] GDI Drawing Esp Box for CS 1.6
      By CHAMPION in forum C/C++
      Replies: 10
      Last Post: 01-13-2014, 11:06 PM

    Tags for this Thread