Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] Trying a different way of going about this (the goal is to send normal left/right clicks while Toggl

[DiscordArchive] Trying a different way of going about this (the goal is to send normal left/right clicks while Toggl

[DiscordArchive] Trying a different way of going about this (the goal is to send normal left/right clicks while Toggl

rektbyfaith
Administrator
0
04-07-2025, 05:46 PM
#1
Archived author: Stelmo • Posted: 2025-04-07T17:46:14.531000+00:00
Original source

Trying a different way of going about this (the goal is to send normal left/right clicks while ToggleMouseLook() is active).

It seems like the function I want is CGWorldFrame:TongueerformDefaultAction(), but I'm having a hard time calling it manually.

I'm guessing my calling convention or something is wrong, because it seems to find the WorldFrame address, but crashes immediately when PerformDefaultAction() is called

```cpp
struct WorldFrame;
namespace CGWorldFrame
{
// ghidra decomp 4.1.0 + symbols calling convention
// undefined4 __thiscall CGWorldFrame:TongueerformDefaultAction(CGWorldFrame *this,MOUSEBUTTON param_1)
CLIENT_FUNCTION(PerformDefaultAction, 0x4F7880, __cdecl, void, (WorldFrame**, int))

// ghidra decomp 3.3.5 calling convention (seems incorrect)
// undefined4 __thiscall CGWorldFrame:TongueerformDefaultAction(int param_1_00,int param_1)
// CLIENT_FUNCTION(PerformDefaultAction, 0x4F7880, __stdcall, void, (int, int))
}

//* get worldframe ptr
WorldFrame* cwf = *(WorldFrame**)(0xB7436C);

//? debug: print pointer address to verify that we found the worldframe [SEEMS TO BE WORKING]
char buffer[512];
SStr:Tonguerintf(buffer, 512, "WorldFrame: %p", cwf);
CGChat::AddChatMessage(buffer, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

//! crashes here
CGWorldFrame:TongueerformDefaultAction(&cwf, 1);
```
Any C++ wizards know where I'm going wrong?
rektbyfaith
04-07-2025, 05:46 PM #1

Archived author: Stelmo • Posted: 2025-04-07T17:46:14.531000+00:00
Original source

Trying a different way of going about this (the goal is to send normal left/right clicks while ToggleMouseLook() is active).

It seems like the function I want is CGWorldFrame:TongueerformDefaultAction(), but I'm having a hard time calling it manually.

I'm guessing my calling convention or something is wrong, because it seems to find the WorldFrame address, but crashes immediately when PerformDefaultAction() is called

```cpp
struct WorldFrame;
namespace CGWorldFrame
{
// ghidra decomp 4.1.0 + symbols calling convention
// undefined4 __thiscall CGWorldFrame:TongueerformDefaultAction(CGWorldFrame *this,MOUSEBUTTON param_1)
CLIENT_FUNCTION(PerformDefaultAction, 0x4F7880, __cdecl, void, (WorldFrame**, int))

// ghidra decomp 3.3.5 calling convention (seems incorrect)
// undefined4 __thiscall CGWorldFrame:TongueerformDefaultAction(int param_1_00,int param_1)
// CLIENT_FUNCTION(PerformDefaultAction, 0x4F7880, __stdcall, void, (int, int))
}

//* get worldframe ptr
WorldFrame* cwf = *(WorldFrame**)(0xB7436C);

//? debug: print pointer address to verify that we found the worldframe [SEEMS TO BE WORKING]
char buffer[512];
SStr:Tonguerintf(buffer, 512, "WorldFrame: %p", cwf);
CGChat::AddChatMessage(buffer, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

//! crashes here
CGWorldFrame:TongueerformDefaultAction(&cwf, 1);
```
Any C++ wizards know where I'm going wrong?

rektbyfaith
Administrator
0
04-07-2025, 06:04 PM
#2
Archived author: Jerry • Posted: 2025-04-07T18:04:39.241000+00:00
Original source

`signed int __thiscall CGWorldFrame:TongueerformDefaultAction` for me (IDA)
rektbyfaith
04-07-2025, 06:04 PM #2

Archived author: Jerry • Posted: 2025-04-07T18:04:39.241000+00:00
Original source

`signed int __thiscall CGWorldFrame:TongueerformDefaultAction` for me (IDA)

rektbyfaith
Administrator
0
04-07-2025, 06:26 PM
#3
Archived author: Stelmo • Posted: 2025-04-07T18:26:34.574000+00:00
Original source

Where in the world did I pull __cdecl from lmao, that's what I get for lazily copy-pasting code
No longer crashing at least, so thanks for pointing me in the right direction!
Now to figure out why it's not actually clicking/if I've been barking up the wrong tree with that function
rektbyfaith
04-07-2025, 06:26 PM #3

Archived author: Stelmo • Posted: 2025-04-07T18:26:34.574000+00:00
Original source

Where in the world did I pull __cdecl from lmao, that's what I get for lazily copy-pasting code
No longer crashing at least, so thanks for pointing me in the right direction!
Now to figure out why it's not actually clicking/if I've been barking up the wrong tree with that function

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)