| View previous topic :: View next topic |
| Author |
Message |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Thu Dec 11, 2008 5:12 pm Post subject: [C++] Inline ASM |
|
|
what kind of template should i use? I'm using CLR Windows Form Application. I doubt that should be the one to use. Which one is better?
Oh i'm using VC++ Microsoft.
thanks.
_________________
|
|
| Back to top |
|
 |
BirdsEye Advanced Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 94
|
Posted: Thu Dec 11, 2008 5:24 pm Post subject: |
|
|
...Dont use C++.NET... Ever... Stick with Win32 and before you start API learn basic C++ [Here]. Once you can make medium applications on your own, go to Win32. This is what got me started. After that you, you incorporate new APIs (Use MSDN) as your move through projects.
EDIT: noz3001 is right... What does this have to do with inline assembly?
Last edited by BirdsEye on Thu Dec 11, 2008 5:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Thu Dec 11, 2008 5:27 pm Post subject: |
|
|
| Inline ASM?
|
|
| Back to top |
|
 |
FerrisBuellerYourMyHero Master Cheater
Reputation: 0
Joined: 14 Feb 2007 Posts: 401 Location: Inside your <kernel>
|
Posted: Thu Dec 11, 2008 5:39 pm Post subject: |
|
|
I believe CLR is for writing managed code...
If you want to write unmanaged native code create a Win32 project. If you want to make a console app select Win32 Console Application, for a DLL, or Win32 GUI select Win32 Project...
And I always just select blank project, and create the main file myself, as I think the pre-compiled header + the default projects contain unnecessary things that just bloat your code...
There is a way to create forms and controls with a resource editor, but I don't like doing it that way and just use CreateWindowEx to create every window/control
anyway what does this have to do with inline asm? lol
inline asm in MSVC++ is very nicely done... Dev C++ on the other hand, I don't like, by default it uses att&t syntax(which i hate) and you have to use quotes "" and its just a mess!!
But since your using VC++ you don't have to worry about that...
Some things that I should point out though about using it...
Ok you know like in auto assembler (with CE)
say Value is a 4 byte allocated value.
if you write it like this
it moves the address of Value instead of the actual value of Value into eax...
and doing this
will move the value of it into eax...
well in MSVC++ if you write it like this
| Code: |
DWORD Value = 0x539;
_asm
{
mov eax, Value
}
|
No matter if you put the brackets([]) around 'Value' or not, it still moves the value of it into eax instead of the address!!
So to overcome that, I just use lea
| Code: |
DWORD Value = 0x539;
_asm
{
lea eax, [Value]
}
|
you could also write it like
| Code: |
DWORD Value = 0x539;
_asm
{
mov eax, offset Value
}
|
I think? or maybe I'm just thinking of masm32...
also you cannot mov a hard coded address like this for example
| Code: |
_asm
{
mov eax, [0x974EE8]
}
|
It just won't let you!
so instead you have to put that address into a 4 byte variable and then moving the value of that into a register, then moving the value of that register will give you the intended result
| Code: |
DWORD address = 0x974EE8;
_asm
{
mov eax, [address]
mov eax, [eax]
}
|
So those are some things you should be aware of, that I had to figure out when using inline assembly in MSVC++
_________________
You know, life moves pretty fast. If you don't stop and look around once in a while, You could miss it!
 |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Thu Dec 11, 2008 6:03 pm Post subject: |
|
|
for poiunters,
| Code: | | mov eax,dword ptr ds:[0x400000] |
will also work.
_________________
|
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Thu Dec 11, 2008 9:46 pm Post subject: |
|
|
soo... you're saying... don't use vc++? but i like it D:
_________________
|
|
| Back to top |
|
 |
FerrisBuellerYourMyHero Master Cheater
Reputation: 0
Joined: 14 Feb 2007 Posts: 401 Location: Inside your <kernel>
|
Posted: Fri Dec 12, 2008 2:05 am Post subject: |
|
|
When did I say that?
I never said don't use it! In fact that's what I use! I use MSVC++ 2008 express edition.
I also use dev c++ but only when I'm away from my computer. I have the portable version on a flash drive.
But I like VC++ alot more! especially since the inline asm syntax.
So DO use it, I recommend it.
What I wouldn't recommend is an old version like VC++ 6.0, its too old skool. 2008 is probably the best to use.
However there seems to be a problem with it. Can anyone else confirm that its not just my computer and it happens to everyone?
Sometimes when trying to create a new project, the first window that pops up, I select Win32 Project for example, name it, then press okay. Sometimes the next window doesn't popup and it says project creation failed in the status window of the IDE. Then other times the next window comes up, but kind of freezes, and stays blank white, until you hit x. The whole IDE doesn't freeze just the window. I close it and try again. And some other times I even get farther than that, and the window pops up and I hit next, which takes it to the next screen where you select between, "Windows Application", "Console Application", "DLL", "Static Library" and the checkbox for "Empty Project"
at any point in between getting to that window or clicking finish, it could say project creation failed in the status window again!!
Its really annoying and sometimes I have to make several attempts when creating new projects...
So has anyone else encountered the same? or am I special?
_________________
You know, life moves pretty fast. If you don't stop and look around once in a while, You could miss it!
 |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Dec 12, 2008 2:08 am Post subject: |
|
|
| I've never had that problem
|
|
| Back to top |
|
 |
sloppy Expert Cheater
Reputation: 0
Joined: 17 Aug 2008 Posts: 123
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Dec 12, 2008 7:05 am Post subject: |
|
|
I remember something similar happened to me too...
Try starting MVC++ through the command prompt:
VCExpress /resetskippkgs
|
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Fri Dec 12, 2008 4:55 pm Post subject: |
|
|
umm... so you want me to use empty win32 ?
_________________
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Fri Dec 12, 2008 5:14 pm Post subject: |
|
|
| hacksign23 wrote: | | umm... so you want me to use empty win32 ? |
yes...then program the bot/thing from there.
_________________
|
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Sat Dec 13, 2008 12:06 am Post subject: |
|
|
k thx
edit: what's the difference between managed and not?
_________________
|
|
| Back to top |
|
 |
|