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# 64 bit Problem

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

Joined: 19 Jul 2015
Posts: 154

PostPosted: Sun Dec 18, 2016 12:15 am    Post subject: C# 64 bit Problem Reply with quote

Hello guys..

I am having a problem (as always) in attaching to a 64 bit process...Let me explain you...

Here is my Aobscan method :


http://image.prntscr.com/image/7e7b1573cf7640f6b551b0b5a6fc1ecd.png

Q)Why I think that the problem is in Aobscan ?
A)Check the highlighted text (By doing breakpoint I found that addr = 0)



The same problem is with Firefox but if I change the platform target to 32 bit ,"the project will work fine with FIREFOX only" and give an exception on chrome

If u didn't get my last sentence kindly check the second problem here :http://forum.cheatengine.org/viewtopic.php?t=597295&sid=8dfab3b1911cc2ef7a3b2843b4eb5321


Thanks In Advance
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Sun Dec 18, 2016 3:41 am    Post subject: Reply with quote

You do an aobscan on a 64 bit process and you store the found address in an int.
an int is most likely 32 bit large while an address on a 64 bit program will require 64 bits.
Try using uint64_t
Back to top
View user's profile Send private message
Matze500
Expert Cheater
Reputation: 8

Joined: 25 Jan 2012
Posts: 241
Location: Germany

PostPosted: Sun Dec 18, 2016 4:31 am    Post subject: Reply with quote

There is no uint64_t in C#.
Use IntPtr or UIntPtr instead it is much better.

Make sure every routine in your program uses Intptr, Int64 or long (same with unsigned types) to cover the 8bit length.

To use it with 32bit and 64bit you have to set building to any CPU and remove the prefere 32bit tick in project properties.

Greets Matze

_________________
Back to top
View user's profile Send private message
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Sun Dec 18, 2016 5:53 am    Post subject: Reply with quote

ulysse31 and Matze500 thanks for replying... But my problem is still not solved the addr is still 0 ...


Thanks In Advance Smile
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Dec 18, 2016 6:58 am    Post subject: Reply with quote

Does this return 0?
Code:
ProcessID = Chrome();

The previous ProcessID isn't static, is it? It's the same variable as
Code:
this.ProcessID

You never populate this list.
Code:
MemoryRegion = new List<MEMORY_BASIC_INFORMATION>();

Was this supposed to return the MemoryRegion?
Code:
MemInfo(handledproc.Handle);

Add debug print statements to see where it's getting.
Back to top
View user's profile Send private message
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Sun Dec 18, 2016 8:23 am    Post subject: Reply with quote

Hello Zanzer ,

thanks for replying again...

ProccessID is not returning 0 (It is working fine)

there is only one ProcessID and it is public int (I forgot to remove this.)


And Check Inbox!


Problem is still not solved...

Thanks In Advance Smile
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Dec 18, 2016 9:08 am    Post subject: Reply with quote

It's 64-bit, you can't use ToInt32.
Code:
Addy = new IntPtr(MemInfo.BaseAddress.ToInt32() + (long)MemInfo.RegionSize);

Code:
Addy = IntPtr.Add(MemInfo.BaseAddress, MemInfo.RegionSize);
Back to top
View user's profile Send private message
lolAnonymous
Expert Cheater
Reputation: 1

Joined: 19 Jul 2015
Posts: 154

PostPosted: Sun Dec 18, 2016 9:09 pm    Post subject: Reply with quote

Hey Zanzer thanks for replying and sorry for late reply...


I changed
Code:
Addy = new IntPtr(MemInfo.BaseAddress.ToInt32() + (long)MemInfo.RegionSize);


to

Code:
Addy = new IntPtr(MemInfo.BaseAddress.ToInt64() + (long)MemInfo.RegionSize);


But the problem is still not solved...

even I changed all Int32 to Int64 but no luck...


[img]http://image.prntscr.com/image/7e7b1573cf7640f6b551b0b5a6fc1ecd.png
[/img]


Thanks In Advance Smile
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