Raised This Month: $12 Target: $400
 3% 

Module: MemHack


Post New Thread Reply   
 
Thread Tools Display Modes
Blackhawk
Member
Join Date: Apr 2005
Old 02-10-2006 , 17:12  
Reply With Quote #21

Thanks, Thanks, Thanks,Thanks, Thanks, Thanks,Thanks, Thanks, Thanks,....... ^^
__________________
Outpost 104 - last hope for teamplay
Blackhawk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-10-2006 , 19:52  
Reply With Quote #22

Tell me if this one fixes the problem:
Attached Files
File Type: dll memhack_amxx.dll (85.0 KB, 474 views)
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Blackhawk
Member
Join Date: Apr 2005
Old 02-10-2006 , 20:11  
Reply With Quote #23

Jepp, works correctly.

Where was it? Where did you found my cute little bug?
__________________
Outpost 104 - last hope for teamplay
Blackhawk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-10-2006 , 22:03  
Reply With Quote #24

I messed up the writing protocals. My bad ^^

So, wanna make me an example plugin? ^^
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 02-11-2006 , 08:58  
Reply With Quote #25

Yay, example plugin!
Now i can use this to mess width startmoney and bombtimer instead of cshack
__________________
Sig(h)!
Obbin is offline
Blackhawk
Member
Join Date: Apr 2005
Old 02-11-2006 , 18:19  
Reply With Quote #26

If I'll do an example plugin,it won't be for CS - im a Natural Selection Server admin only ^^

Twilight, another question: Do i need to mess around with the Base Adresses? Or is MEm_DLLBASE the only thing i need to define?

2nd, how is memhack_get_base used?
4rd How memhack_get_realaddr?

And thank you again for your continued support!
__________________
Outpost 104 - last hope for teamplay
Blackhawk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-11-2006 , 19:09  
Reply With Quote #27

MemHack was not originally written to be an AMXx module. It was repurposed for AMXx use.

As such, there are some features you will almost never find a use for.

MEM_DLLBASE allows mod .dll hacking.
MEM_ENGBASE allows HL1 engine hacking.
MEM_NULLBASE allows for total memory hacking.

These two natives are only useful for total memory hacking:
Code:
native memhack_get_base(func_addr,&success);
native memhack_get_realaddr(address,baseaddress,memtype = MEMTYPE_DATA);
memhack_get_base will return the base pointer (the starting address) of a program, based on an address that belongs to that program.

In order to hack the memory of a program, you need its base address. Then you can hack offsets of the base address. This native lets you do that.

memhack_get_realaddr isn't useful at all really; all it does is return the current full address of the memory at this offset. When hacking programs, we use offsets from base; this will return the actual address, instead of the partial offset we give it.

The only true use of this native is that we can get the actual address of the base. The real address of an offset - the offset = the address of the base address.

Using these natives, one could concievably hack any programs in the memory, or even create ones own program, or inject one program into another.

However, no one will ever use these natives, or have a need to, besides debugging ^^
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Blackhawk
Member
Join Date: Apr 2005
Old 02-11-2006 , 23:29  
Reply With Quote #28

Then we have maybe anoter bug in this module.....

Ok, i'll show what i think:

The Editor shows the base of the MOD dll running at Hex 01050000
The pointer to the value in question is now at Hex 0127B4E8 +134
So the offset should be Hex(127B4E8 +134 -01050000), giving Hex 22B4E8 or decimal 2274844.

Now it apears the the code below actually works, and the code that should work crashes the server.
Code:
new Pointer = memhack_get_pointer(19379432,MEM_DLLBASE,MEMTYPE_DATA)     new Target  = Pointer + 308     server_print("Memhack get float: %.2f",memhack_get_float(Target,MEM_DLLBASE,MEMTYPE_DATA))

On the other hand, this returns 0:

Code:
    server_print("Memory offset: %d",memhack_get_base(19379432))
Where it should return the base of code. But i am very sure it shouldn't be 0.

So it looks like MEM_DLLBASE, MEM_CODEBASE etc are not accounted correctly, because in this line
Code:
new Pointer = memhack_get_pointer(19379432,MEM_DLLBASE,MEMTYPE_DATA)
MEM_DLLBASE is changeable with MEM_ENGBASE without an effect, meaning the base is always returned as 0.......

I hope you get my point.
__________________
Outpost 104 - last hope for teamplay
Blackhawk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-12-2006 , 01:32  
Reply With Quote #29

In order for getbase to work, you need the pointer of a valid function. I don't think you have the pointer of a valid function. ^^

ENG was also added as an afterthought, and never tested extensively, though it did return a different full address, so I assumed it worked.

In addition, all calculations should be done in hex, for standardization.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Blackhawk
Member
Join Date: Apr 2005
Old 02-12-2006 , 08:42  
Reply With Quote #30

19379432 is 127B4E8 and that is correct, whatsoever when the dllbase is 01050000, this code example shouldn't work if MEM_DLLBASE would be valid.
127B4E8 is the exact adress WITH DLLBASE.

If i understand it right,
Code:
new Pointer = memhack_get_pointer(19379432,MEM_DLLBASE,MEMTYPE_DATA)
would calculate as follows: Add the offset Parameter 1 to the base address of MEM_DLLBASE and get the pointer adress back. As this sample above already is Base + offset, if MEM_DLLBASE is something other than 0 (as base address), i would never get an correct pointer back.....

But this sample works!
__________________
Outpost 104 - last hope for teamplay
Blackhawk is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode