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 


[ERROR] __asm and Dev-C++

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

Joined: 14 Aug 2007
Posts: 372

PostPosted: Fri Jul 04, 2008 8:55 am    Post subject: [ERROR] __asm and Dev-C++ Reply with quote

Whenever I try to compile something (DLL) in my favorite compiler, Dev-C++, I get errors when I use __asm. Here is the line that gets the errors:

Code:

__asm mov byte ptr ds:[0x12345678],0x90


Here is the error:

Code:

Compiler: Default compiler
Building Makefile: "C:\ ... \Makefile.win"
Executing  make...
make.exe -f "C:\ ... \Makefile.win" all
g++.exe -c dllmain.cpp -o dllmain.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"  -DBUILDING_DLL=1

dllmain.cpp: In function `bool DllMain()':
dllmain.cpp:13: error: expected `(' before "mov"
dllmain.cpp:13: error: expected asm body before "mov"
dllmain.cpp:13: error: `mov' undeclared (first use this function)
dllmain.cpp:13: error: (Each undeclared identifier is reported only once for each function it appears in.)
dllmain.cpp:13: error: expected `;' before "byte"

make.exe: *** [dllmain.o] Error 1

Execution terminated


Nothing to helpful there... I am using 'windows.h' include file. Is the __asm function in another? Or is it the compiler?

TY!
Back to top
View user's profile Send private message
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Fri Jul 04, 2008 8:56 am    Post subject: Reply with quote

refer to this : http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

you basically have a GCC compiler, which the inline assembly syntax differ from Microsoft C++ Compiler.

_________________
I wanna hack, but I don't know how...
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Fri Jul 04, 2008 8:59 am    Post subject: Reply with quote

Yeah, I know. But are you saying that __asm is only for microsofts compiler? Because __asm becomes bolded in Dev-C++...
Back to top
View user's profile Send private message
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Fri Jul 04, 2008 9:02 am    Post subject: Reply with quote

i have no expperience handling GCC compiler before, I assume you have to do them like this :
Code:

 __asm__ ("movl %eax, %ebx\n\t"
          "movl $56, %esi\n\t"
          "movl %ecx, $label(%edx,%ebx,$4)\n\t"
          "movb %ah, (%ebx)"
);

taken from GCC-Inline-Assembly-Howto

Edited.

_________________
I wanna hack, but I don't know how...
Back to top
View user's profile Send private message
MegaForum
Grandmaster Cheater
Reputation: 0

Joined: 20 Aug 2007
Posts: 558

PostPosted: Fri Jul 04, 2008 9:04 am    Post subject: Reply with quote

Use Visual C++ 2008 from microsoft. Best compiler around I think atm.
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Fri Jul 04, 2008 9:07 am    Post subject: Reply with quote

I get it... I remember reading about that in my programming book. =)

And I hate microsoft, but sometimes you do need to use their stuff. But I like to go oldschool and not use the drag and drop stuff in microsofts compilers. =) But sometimes it is helpful...
Back to top
View user's profile Send private message
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Fri Jul 04, 2008 9:10 am    Post subject: Reply with quote

what suits you best chaosis Smile

i'm glad you understood.

plus, usually people uses GNU C Compiler for portability and cross-platform.

_________________
I wanna hack, but I don't know how...
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Fri Jul 04, 2008 9:18 am    Post subject: Reply with quote

Yeah, I use it on kubuntu. And I find the AT&T asm too hard to pick up, I am just going to use VC++ 2005. (They messed up 2008)
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Fri Jul 04, 2008 10:20 am    Post subject: Reply with quote

Under dev-cpp compiler options, go to "Ad the following commands when calling comiler" and put -masm=intel so you can use intel syntax instead of at&t.
Alos, it's just asm(), not __asm{}.
asm(mov [0x134643], 0x90); might work. for what you have, but there's no point in using ASM for that. (BYTE)*(0x265216) = 0x90.

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Jul 04, 2008 11:42 am    Post subject: Reply with quote

See, Dev-C++ is outdated, and is buggy, and not as intelligent. Microsoft Visual C++ Express Edition 2008 (yes I used the full name) is up to date, not buggy, intelligent, and has extra features to help you design as well as create your programs. It also has more options.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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