calculate object's screen position menu

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 37
  1. #16
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by wanyancan View Post
    Aha! CreateRemoteThread is exactly what I'm asking for! Thanks Cypher!
    I think there's no big deal of race conditions for TraceLine function. I'll give it a kick and see how it goes.
    Actually you may be right, from memory map objects are handled in a separate thread (and of course traceline only cares about terrain and map objects, not mobs, which are in the primary thread), traceline should perform all the necesary locking and thread synchronization for you.

    calculate object's screen position
  2. #17
    wanyancan's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got a weird problem using CreateRemoteThread... When built in "Release", the dummy codes are copied correctly to remote process and invoked properly, however for "debug" build, some non-sense bytes are copied from a wrong function address..

    Codes as below
    Code:
    #define INJECTSIZE 4096
    DWORD __stdcall mySnubber( DWORD c )
    {
    		/*
    		0   float float float 
    		0xC float float float 
    		0x18 float float float
    		0x24 float
    		0x28 float (flag)
    		0x2C float float float
    		*/
    	typedef bool (__cdecl *tTraceLine)(int*, int*, int*, int*, int*, int*);
    	tTraceLine pTraceLine = (tTraceLine)0x506060;
    	return pTraceLine((int*)c, (int*)(c+0xC), (int*)(c+0x18), (int*)(c+0x24) ,(int*)(c+0x28) , (int*)0);	
    }
    void testRemoteCall(){
    	DWORD RmThdId;
    	LPVOID procAdd, paraAdd;
    	procAdd = VirtualAllocEx(wowprohnd,NULL, INJECTSIZE,  MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    	if(!procAdd){
    		printf("can't allocate proc Memory\n");
    		goto cleanup;
    	}
    	paraAdd = VirtualAllocEx(wowprohnd,NULL, INJECTSIZE,  MEM_COMMIT, PAGE_READWRITE );
    	if(!paraAdd){
    		printf("can't allocate parameters Memory\n");
    		goto cleanup;
    	}
    	DWORD szWritten;
    	if(!WriteProcessMemory(wowprohnd, procAdd, &mySnubber, INJECTSIZE, &szWritten)){
    		printf("can't write procedure into proc memory\n");
    		goto cleanup;
    	}
    	char testbuff[INJECTSIZE+4];
    	ReadStr(procAdd, testbuff, INJECTSIZE); // for test
    
    	// Setting [in]paraAddress as well , omitted
    
    	HANDLE hRmThd = CreateRemoteThread(wowprohnd, NULL, NULL,(DWORD (__stdcall *)( void *))procAdd, paraAdd, NULL, &RmThdId);
    	if(!hRmThd){
    		printf("can't create thread \n");
    		goto cleanup;
    	}
    	RmThdId = WaitForSingleObject(hRmThd, 3000);
    	CloseHandle(hRmThd);
    cleanup:
    	
    	if(procAdd)
    		if(!VirtualFreeEx(wowprohnd, procAdd, 0, MEM_RELEASE))
    			printf("Can't free allocated proc memory\n");
    	if(paraAdd)
    		if(!VirtualFreeEx(wowprohnd, paraAdd, 0, MEM_RELEASE))
    			printf("Can't free allocated proc memory\n");
    }
    This line
    Code:
    WriteProcessMemory(wowprohnd, procAdd, &mySnubber, INJECTSIZE, &szWritten)
    works correctly for "Release" build, but not in "Debug" build. The address for "mySnubber" is wrong...

    Another thing I'm concerning is the WriteProcessMemory.. Is it currently being checked by warden when reading/writing in the newly allocated memory space?

  3. #18
    b0t001's Avatar Private
    Reputation
    5
    Join Date
    Oct 2009
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i should read the rest of the thread first before posting ;D
    Last edited by b0t001; 01-05-2010 at 12:04 PM.

  4. #19
    rafalsk's Avatar Active Member
    Reputation
    17
    Join Date
    Jul 2009
    Posts
    194
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did some reversing can someone confirm that these are the current offsets?:
    WOW_CAMERA_PTR1 0xB0C544
    WOW_CAMERA_OFFSET 0x7E20

    they seem to return right values, and react properly to camera change but my mouse is just not pointing right;]

  5. #20
    asmodei's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    those are the offsets in the current dump sticky...i haven't tried it recently though

  6. #21
    rafalsk's Avatar Active Member
    Reputation
    17
    Join Date
    Jul 2009
    Posts
    194
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't found first offset anywhere in these forums, probably haven't looked for it well enough;] the offsets look FINE I've compared camera position I receive with position of the player and it's the same when cam is over a player, but that World To screen algo from http://www.mmowned.com/forums/wow-me...ld-screen.html seems to give me wrong results, I don't uderstand the math involved;P

    LOL. not sure yet bot it seems like I was pointing my mouse position was relative to Screen corner not window corner:P
    EDIT2: well I translated to cords using Control.PointToScreen however it still is not right;]
    Last edited by rafalsk; 01-05-2010 at 02:12 PM.

  7. #22
    asmodei's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just verified that it's working. It also seems to only work for me when wow is maximized. I'm running in windowed mode, just maximized. I'm at work right now, so i haven't really messed around too much, but thought i'd verify for you.

    good luck

  8. #23
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you use the code from yetihunter:
    remove this:
    if ((diff * camera.ViewMat.GetFirstColumn) < 0)
    return false;

    i dont know why it causes problems, but it sometimes does :P

  9. #24
    rafalsk's Avatar Active Member
    Reputation
    17
    Join Date
    Jul 2009
    Posts
    194
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep I'm using code from YetiHunter and I've already noticed that this seems to be the part causing problems, deleting this did the thing, and now it works as asmodei mentioned (thanks) only when WoW's window is maximized, trying to find out now what's the reason it's not working in normal windows state.

    EDIT:Finally, the reason why it was working only when Window is maximized was because I ****ed up;] but I see not only me was having that kind of problem;P

    GetClientRect returns the width and height of the window (bottom right corner) you need to find upper left corner of wow window and add it.
    Last edited by rafalsk; 01-05-2010 at 05:47 PM.

  10. #25
    wanyancan's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    probably I'd better to open a new thread to ask my question...

  11. #26
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
            public static bool WorldToScreen(Vector3 position, out Vector3 screen)
            {
                screen = Vector3.Project(position, Device.Viewport, Projection, View, Matrix.Identity);
    
                return (screen.Z < 1f);
            }
    IMO.

  12. #27
    wanyancan's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've considered to shift to C# many many times... But still haven't...
    I do envy you.

    Originally Posted by Apoc View Post
    Code:
            public static bool WorldToScreen(Vector3 position, out Vector3 screen)
            {
                screen = Vector3.Project(position, Device.Viewport, Projection, View, Matrix.Identity);
    
                return (screen.Z < 1f);
            }
    IMO.

  13. #28
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to get the position in a windowed window:

    [DllImport("user32.dll")]
    private static extern bool GetClientRect(IntPtr hWnd, ref Rect rect);

    var rc2 = new Rect();
    GetWindowRect(ptr.HWND, ref rc2);


    for the standard win xp border widths:
    Position = new Point(pctMouse.X + rc2.left + 4, pctMouse.Y + rc2.top + 30);

  14. #29
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by wanyancan View Post
    I've considered to shift to C# many many times... But still haven't...
    I do envy you.
    Code:
    bool Renderer::WorldToScreen( idVec3 vecPos, idVec2& vecScreen )
    {
        D3DXVECTOR3 Out, In( vecPos[0], vecPos[1], vecPos[2] );
        D3DVIEWPORT9 Viewport;
        D3DXMATRIX Proj(m_ProjMatrix), View(m_ViewMatrix), World;
        
        m_pDevice->GetViewport(&Viewport);
        D3DXMatrixIdentity(&World);
    
        D3DXVec3Project( &Out, &In, &Viewport, &Proj, &View, &World );
    
        vecScreen[0] = Out.x;
        vecScreen[1] = Out.y;
    
        return ( Out.z < 1.f );
    }
    IMO

  15. #30
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was going to say, isn't the .NET implementation of D3D just a COM wrapper...? :O

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 09-08-2016, 07:16 AM
  2. 3.3.5 ObjectManager questions relating setting position of objects
    By felixdabayer in forum WoW Memory Editing
    Replies: 5
    Last Post: 08-12-2012, 10:28 AM
  3. How to get a spell Object's target and position?
    By demonguy in forum WoW Memory Editing
    Replies: 24
    Last Post: 05-29-2012, 11:39 PM
  4. Burning Crusade Screen Shots
    By Bossman4 in forum World of Warcraft General
    Replies: 4
    Last Post: 05-18-2006, 08:58 PM
  5. [Trick] WSG Safe Flag Holding Position
    By Matt in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 05-10-2006, 06:17 PM
All times are GMT -5. The time now is 06:27 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search