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 


C++ DLL

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

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Feb 09, 2008 11:26 pm    Post subject: C++ DLL Reply with quote

Im writing something in C++ dll wizard, and i was wonder exactly, how would i make an an address look to a script ie :

script:
blablabla

0x1023 jmp script

or w.e Question
Back to top
View user's profile Send private message AIM Address MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Feb 09, 2008 11:32 pm    Post subject: Reply with quote

push eax
mov eax,0x1023
jmp script

or

call script (i think its call...)

kinda guesing Wink dont know much ASM...

_________________
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sat Feb 09, 2008 11:49 pm    Post subject: Reply with quote

Try creating a method with the asm inside it, so you can do:

I forget the actual code, but Wiccaan has a nice tutorial on dlls with something about that on Extalia. I think Slovach even posted a link to it here, somewhere.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Feb 10, 2008 12:02 am    Post subject: Reply with quote

Written off the top of my head, probably doesn't work, but you get the idea.

Code:
BOOL PlaceJump(unsigned long to, unsigned long from)
{
    unsigned char jmp[5] = { 0xE9, 0, 0, 0, 0 };
    unsigned long lawl = to - from -5;
    __try {
        __movsb(jmp+1, &lawl, 4);
        __movsb(from, jmp, 5);
    } __except(EXCEPTION_EXECUTE_HANDLER) {
        return FALSE;
    }
    return TRUE;
}
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sun Feb 10, 2008 12:09 am    Post subject: Reply with quote

I have another question, lets say i want, 0x00100 <-addy

i want to set ZF[x][x], how do i convert that to Byte form>?
Back to top
View user's profile Send private message AIM Address MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Feb 10, 2008 12:12 am    Post subject: Reply with quote

Set/GetThreadContext and a breakpoint. You have to be attached as a debugger from outside the process, so that means no injected dll for you. Wink
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sun Feb 10, 2008 12:14 am    Post subject: Reply with quote

no wait flyte, other than get/setcontextthread, is there a way to convert it to DEFINE Bytes or anything?
Back to top
View user's profile Send private message AIM Address MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Feb 10, 2008 12:15 am    Post subject: Reply with quote

samuri25404 wrote:
Try creating a method with the asm inside it, so you can do:

I forget the actual code, but Wiccaan has a nice tutorial on dlls with something about that on Extalia. I think Slovach even posted a link to it here, somewhere.


http://www.extalia.com/forums/viewtopic.php?f=32&t=2795 Smile
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Feb 10, 2008 12:16 am    Post subject: Reply with quote

I think I've answered that for you before. =P

SZF/CZF

Just go stick those somewhere in a CE and check the bytes.

I think that ZF [X] [X] is turning off ZF when it gets to that point.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sun Feb 10, 2008 12:20 am    Post subject: Reply with quote

where on CE do i set it? In memory view? do i set SZF as the opcode?
Back to top
View user's profile Send private message AIM Address MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Feb 10, 2008 2:17 am    Post subject: Reply with quote

slippppppppp wrote:
no wait flyte, other than get/setcontextthread, is there a way to convert it to DEFINE Bytes or anything?


Somebody correct me if this is wrong but:

Code:
Clear ZF:
pushf
and byte [esp+2],  D
popf

Set ZF:
pushf
or byte [esp+2],  2
popf
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Feb 10, 2008 4:10 am    Post subject: Reply with quote

slippppppppp wrote:
I have another question, lets say i want, 0x00100 <-addy

i want to set ZF[x][x], how do i convert that to Byte form>?
If you can modify the code, you can use a cmp to set the flag.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Feb 10, 2008 11:17 am    Post subject: Reply with quote

slippppppppp wrote:
where on CE do i set it? In memory view? do i set SZF as the opcode?


Yeah, just like pop up minesweeper or something, attatch to it, and set some random address to be "SZF" or "CZF".

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Feb 10, 2008 2:19 pm    Post subject: Reply with quote

Flyte wrote:
slippppppppp wrote:
no wait flyte, other than get/setcontextthread, is there a way to convert it to DEFINE Bytes or anything?


Somebody correct me if this is wrong but:

Code:
Clear ZF:
pushf
and byte [esp+2],  D
popf

Set ZF:
pushf
or byte [esp+2],  2
popf


Not saying you are wrong but according to just about every site I've seen, ZF is offset 0x6. 0x2 is PF:

Code:
0 Carry
2 Parity
4 Auxiliary Carry
6 Zero
7 Sign
8 Trace
9 Interrupt
10 Direction
11 Overflow

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Feb 10, 2008 3:51 pm    Post subject: Reply with quote

Hmm, yes, looking back on that I used the wrong offset. Confused

My bad.

Code:
Clear ZF:
pushf
and byte [esp+3], 0xDF
popf

Set ZF:
pushf
or byte [esp+3],  0x20
popf
Back to top
View user's profile Send private message
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