Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msvc #13

Open
john-peterson opened this issue Aug 3, 2023 · 3 comments
Open

msvc #13

john-peterson opened this issue Aug 3, 2023 · 3 comments

Comments

@john-peterson
Copy link
Owner

https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170

However

@john-peterson
Copy link
Owner Author

fn~pushGameStateName
0x180a39520 148 public: void __cdecl Fledge::Core::GameStateManager::pushGameStateName(struct Fledge::Foundation::Name32 const & __ptr64, float, bool) __ptr64

afn
sym.FledgeCore_x64_vk.dll_public:_void___cdecl_Fledge::Core::GameStateManager::pushGameStateName_struct_Fledge::Foundation::Name32_const____ptr64__float__bool____ptr64

[0x180a39520]> afv
arg int64_t arg1 @ rcx
var int64_t var_20h @ rsp+0x20
var int64_t var_30h @ rsp+0x30
var int64_t var_8h @ rsp+0x50
var int64_t var_10h @ rsp+0x58
[0x180a39520]> pd1
┌ 148: sym.FledgeCore_x64_vk.dll_public:_void___cdecl_Fledge::Core::GameStateManager::pushGameStateName_struct_Fledge::Foundation::Name32_const____ptr64__float__bool____ptr64 (int64_t arg1);
│ rg: 1 (vars 0, args 1)
│ bp: 0 (vars 0, args 0)
│ sp: 4 (vars 4, args 0)
│     0x180a39520 qword [var_8h] = rbx ; moves data from src to dst; public: void __cdecl Fledge::Core::GameStateManager::pushGameStateName(struct Fledge::Foundation::Name32 const & __ptr64, float, bool) __ptr64

@john-peterson
Copy link
Owner Author

Anyway the pointer is in rdx!!!!!!!!!

I thought the last identified vars could differ. But rcx rdx etc are ALWAYS the arguments in the symbol

Guess I was wrong again

Here rcx is absolutely not the pointer. The first symbol argument

Where the bool is I don't know

But I guess I'm still learning

@john-peterson
Copy link
Owner Author

john-peterson commented Aug 5, 2023

fn~m::getTweak
0x180cd6000 176 public: class Fledge::Foundation::Variant __cdecl Fledge::Core::Next::InputSystem::getTweakable(struct Fledge::Foundation::Name32, class Fledge::Foundation::Variant) __ptr64

afn
sym.FledgeCore_x64_vk.dll_public:_class_Fledge::Foundation::Variant___cdecl_Fledge::Core::Next::InputSystem::getTweakable_struct_Fledge::Foundation::Name32__class_Fledge::Foundation::Variant____ptr64

afv
arg int64_t arg1 @ rcx
arg int64_t arg2 @ rdx
arg int64_t arg3 @ r8
arg int64_t arg4 @ r9

msvc engineer: "I always put ONE ARGUMENT IN EXACTLY ONE REGISTER"

Small objects in the stack itself and large objects in the heap. (Only a pointer in the stack)

...

Is everyone a moron or am I the idiot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant