Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Can you use inline ASM on x64 in Visual Studio

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
themandem
Cheater
Reputation: 0

Joined: 06 Dec 2019
Posts: 35

PostPosted: Fri Aug 18, 2023 9:51 pm    Post subject: Can you use inline ASM on x64 in Visual Studio Reply with quote

is there any way to use the inline ASM function in visual studio for x64 applications? i don't know how to code in C++
so far I had been using inline ASM to make my DLL for hacks/cheats but it was for x86. now I'm working on a x64 game and I cannot find a way
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4307

PostPosted: Fri Aug 18, 2023 10:01 pm    Post subject: Reply with quote

That depends on what language and compiler you're using. Look for relevant documentation. e.g. gcc:
https://gcc.gnu.org/onlinedocs/gcc/Using-Assembly-Language-with-C.html
This should be more or less the same in C++ / g++.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
themandem
Cheater
Reputation: 0

Joined: 06 Dec 2019
Posts: 35

PostPosted: Fri Aug 18, 2023 11:35 pm    Post subject: Reply with quote

ParkourPenguin wrote:
That depends on what language and compiler you're using. Look for relevant documentation. e.g. gcc:
https://gcc.gnu.org/onlinedocs/gcc/Using-Assembly-Language-with-C.html
This should be more or less the same in C++ / g++.


i'm using visual studio C++
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 199

Joined: 25 Jan 2006
Posts: 8519
Location: 127.0.0.1

PostPosted: Sat Aug 19, 2023 12:15 am    Post subject: Reply with quote

Microsoft's compiler does not support inline assembly when compiling for x64 (or ARM).

You can, however, make use of their MASM build tooling while also compiling a C++ application to build .asm scripts into your application/module. With that, you can then use the scripts you create in asm directly within your C++ code, meaning you can make use of the functions in a similar manner as if you were calling a C/C++ function. Using that setup you can do hooks/detours, patches, etc. to jump to your asm function (assuming you're in an injected DLL etc.) which will mimic the setup of inline asm, just with a bit more work/steps.

You can see how to mix C++ and MASM usage here:
https://programminghaven.home.blog/2020/02/16/setup-an-assembly-project-on-visual-studio-2019/

The same setup works for pretty much all modern versions of Visual Studio, not just 2019.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites