Network: WoW Gold | WoW Accounts | MPS Games | FPSowned
MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides
Homepage »      Register »      Hall of Fame »      Ranks And Awards »      Advertise »      Marketplace »
 
Sign up



Do you like this excellent information? Then Donate HERE to remove ads and support the MMOwned community.


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > World of Warcraft > Bots and Programs > WoW Memory Editing

WoW Memory Editing WoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwned Read the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post

Reply
 
LinkBack Thread Tools
  #1  
Old 09-19-2009
qjlex's Avatar
qjlex is offline.
Site Donator
  
 
Join Date: Oct 2007
Location: Russia
Posts: 21
Reputation: 1
Points: 639, Level: 1
Points: 639, Level: 1 Points: 639, Level: 1 Points: 639, Level: 1
Level up: 48%, 261 Points needed
Level up: 48% Level up: 48% Level up: 48%
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%

Lua Do String

This is my method for inject lua, but it is does not work for me.
Please me need your help.

Code:
public static object Lua_DoString(string Lua)
        {
            uint dwAddress = BotContro1l.mem.AllocateMemory(0x4096);
            BotContro1l.mem.WriteASCIIString(dwAddress + ((uint)0x200L), Lua);
            BotContro1l.mem.Asm.Clear();
            BotContro1l.mem.Asm.AddLine("mov EDX, [0x01132F60]");
            BotContro1l.mem.Asm.AddLine("mov EDX, [EDX+0x2C24]");
            BotContro1l.mem.Asm.AddLine("FS mov EAX, [0x2C]");
            BotContro1l.mem.Asm.AddLine("mov EAX, [EAX]");
            BotContro1l.mem.Asm.AddLine("add EAX, 0x10");
            BotContro1l.mem.Asm.AddLine("mov [EAX], EDX");
            BotContro1l.mem.Asm.AddLine("push {0}", new object[] { 0 });
            BotContro1l.mem.Asm.AddLine("mov eax, {0}", new object[] { dwAddress + 0x200L });
            BotContro1l.mem.Asm.AddLine("push eax");
            BotContro1l.mem.Asm.AddLine("push eax");
            BotContro1l.mem.Asm.AddLine("call {0}", new object[] { "0x7CE840" });
            BotContro1l.mem.Asm.AddLine("add esp, 0xC");
            BotContro1l.mem.Asm.AddLine("retn");
            BotContro1l.mem.SuspendThread(BotContro1l.wowmainthread);
            BotContro1l.mem.Asm.InjectAndExecute(dwAddress);
            BotContro1l.mem.FreeMemory(dwAddress);
            BotContro1l.mem.ResumeThread(BotContro1l.wowmainthread);
            return 0;
        }
Reply With Quote


Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx.

  #2  
Old 09-19-2009
Nesox's Avatar
Nesox is offline.
MaiN's Biatch
Legendary User
  
 
Join Date: Mar 2007
Location: VirtualAllocEx
Posts: 1,115
Nominated 26 Times in 3 Posts
Nominated TOTM/W Award(s): 1
Reputation: 727
Points: 36,171, Level: 28
Points: 36,171, Level: 28 Points: 36,171, Level: 28 Points: 36,171, Level: 28
Level up: 95%, 129 Points needed
Level up: 95% Level up: 95% Level up: 95%
Activity: 14.1%
Activity: 14.1% Activity: 14.1% Activity: 14.1%

Quote:
Originally Posted by qjlex View Post
This is my method for inject lua, but it is does not work for me.
Please me need your help.
Here you go mate

[Only registered and activated users can see links. ]
__________________
omg ive started a blog nao! what's wrong with MEH!? -> [Only registered and activated users can see links. ]
Reply With Quote
  #3  
Old 09-19-2009
MaiN is offline.
Contributor
  
 
Join Date: Sep 2006
Location: Jaedenar O.o
Posts: 569
Reputation: 162
Points: 3,264, Level: 5
Points: 3,264, Level: 5 Points: 3,264, Level: 5 Points: 3,264, Level: 5
Level up: 58%, 336 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 8.6%
Activity: 8.6% Activity: 8.6% Activity: 8.6%

How much C# do you know?
Just skimming over your code, I noticed a few major flaws.
First hint, try checking what ToString returns from an object array.
__________________
http://www.main-dev.com/

I was here. ~Dragon[Sky]
I was here too. ~Kuiren
Reply With Quote
  #4  
Old 09-19-2009
maclone's Avatar
maclone is offline.
What would a pirate do?
  
 
Join Date: Nov 2007
Location: Deutschland
Posts: 786
Reputation: 490
Points: 7,315, Level: 9
Points: 7,315, Level: 9 Points: 7,315, Level: 9 Points: 7,315, Level: 9
Level up: 75%, 285 Points needed
Level up: 75% Level up: 75% Level up: 75%
Activity: 4.5%
Activity: 4.5% Activity: 4.5% Activity: 4.5%

Quote:
Originally Posted by Nesox View Post
Here you go mate

[Only registered and activated users can see links. ]
Nah, search doesn't work (atleast for me right now). It doesn't show any threads older than 2 weeks.
__________________
Zomfg. And no, don't ask.
Reply With Quote
  #5  
Old 10-04-2009
qjlex's Avatar
qjlex is offline.
Site Donator
  
 
Join Date: Oct 2007
Location: Russia
Posts: 21
Reputation: 1
Points: 639, Level: 1
Points: 639, Level: 1 Points: 639, Level: 1 Points: 639, Level: 1
Level up: 48%, 261 Points needed
Level up: 48% Level up: 48% Level up: 48%
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%

This is my method for inject Lua in WoW, but
pops Lua error:
Code:
Message: [string "self:SetCamera(0);"]:1: attempt to index global 'self' (a nil value)
Time: 10/04/09 19:52:05
Count: 5
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
[C]: ?
[string "self:SetCamera(0);"]:1: in main chunk

Locals: (*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'self' (a nil value)"
Code:
public static void Lua_DoString(string Lua)
        {

            uint dwAddress = BotContro1l.mem.AllocateMemory(0x4096);
            BotContro1l.mem.WriteASCIIString(dwAddress + ((uint)0x200L), Lua);

            BotContro1l.mem.Asm.Clear();
            BotContro1l.mem.Asm.AddLine("mov EDX, [0x012705B0]");
            BotContro1l.mem.Asm.AddLine("mov EDX, [EDX+0x2D94]");
            BotContro1l.mem.Asm.AddLine("FS mov EAX, [0x2C]");
            BotContro1l.mem.Asm.AddLine("mov EAX, [EAX]");
            BotContro1l.mem.Asm.AddLine("add EAX, 0x10");
            BotContro1l.mem.Asm.AddLine("mov [EAX], EDX");
            BotContro1l.mem.Asm.AddLine("push {0}", new object[] { 0 });
            BotContro1l.mem.Asm.AddLine("mov eax, {0}", new object[] { dwAddress + 0x200L });
            BotContro1l.mem.Asm.AddLine("push eax");
            BotContro1l.mem.Asm.AddLine("push eax");
            BotContro1l.mem.Asm.AddLine("call {0}", new object[] { "0x007CF6B0" });
            BotContro1l.mem.Asm.AddLine("add esp, 0xC");
            BotContro1l.mem.Asm.AddLine("retn");
            BotContro1l.mem.SuspendThread(BotContro1l.wowmainthread);
            BotContro1l.mem.Asm.InjectAndExecute(dwAddress);
            BotContro1l.mem.FreeMemory(dwAddress);
            BotContro1l.mem.ResumeThread(BotContro1l.wowmainthread);
        }
I can not understand where the error in my code.

Last edited by qjlex; 10-04-2009 at 01:01 PM.
Reply With Quote
  #6  
Old 10-04-2009
Robske's Avatar
Robske is offline.
Contributor
  
 
Join Date: May 2007
Location: Dragon Shores
Posts: 690
Reputation: 167
Points: 3,849, Level: 6
Points: 3,849, Level: 6 Points: 3,849, Level: 6 Points: 3,849, Level: 6
Level up: 28%, 651 Points needed
Level up: 28% Level up: 28% Level up: 28%
Activity: 10.8%
Activity: 10.8% Activity: 10.8% Activity: 10.8%

Quote:
Originally Posted by MaiN View Post
How much C# do you know?
Just skimming over your code, I noticed a few major flaws.
First hint, try checking what ToString returns from an object array.
It's copypasta, the new object[] { 0 } gives it away. I've seen it pop up in multiple threads already...
__________________
“Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders.”
“If Java had true garbage collection, most programs would delete themselves upon execution.”
Reply With Quote
  #7  
Old 10-04-2009
MaiN is offline.
Contributor
  
 
Join Date: Sep 2006
Location: Jaedenar O.o
Posts: 569
Reputation: 162
Points: 3,264, Level: 5
Points: 3,264, Level: 5 Points: 3,264, Level: 5 Points: 3,264, Level: 5
Level up: 58%, 336 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 8.6%
Activity: 8.6% Activity: 8.6% Activity: 8.6%

Yeah, but that was my bad. I think one of the overloads takes an object array as parameter.
__________________
http://www.main-dev.com/

I was here. ~Dragon[Sky]
I was here too. ~Kuiren
Reply With Quote
  #8  
Old 10-04-2009
lanman92 is offline.
Site Donator
  
 
Join Date: Mar 2007
Posts: 766
Reputation: 20
Points: 3,871, Level: 6
Points: 3,871, Level: 6 Points: 3,871, Level: 6 Points: 3,871, Level: 6
Level up: 31%, 629 Points needed
Level up: 31% Level up: 31% Level up: 31%
Activity: 6.3%
Activity: 6.3% Activity: 6.3% Activity: 6.3%

You really should deallocate that 4kb of memory after you're done with it. Also the TLS offset is 0x8 now. Change the "add eax, 0x10" to "add eax, 0x8". And don't use an array of objects for all you're parameters. Just putting the value in works fine, and I think it has better performance(not sure though). Your address that you're trying to call is a string? That probably won't work. It should be an IntPtr or uint.

Last edited by lanman92; 10-04-2009 at 01:55 PM.
Reply With Quote
  #9  
Old 10-05-2009
qjlex's Avatar
qjlex is offline.
Site Donator
  
 
Join Date: Oct 2007
Location: Russia
Posts: 21
Reputation: 1
Points: 639, Level: 1
Points: 639, Level: 1 Points: 639, Level: 1 Points: 639, Level: 1
Level up: 48%, 261 Points needed
Level up: 48% Level up: 48% Level up: 48%
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%

I changed my method. Here's a working version for me, but don't work Russian text.
Code:
 public static void Lua_DoString(string luaString)
        {
            uint cave = 0;
            try
            {
                while (BotContro1l.mem.ReadInt((uint)0x0133D5B0) != 0)
                {
                    Thread.Sleep(0);
                }
                BotContro1l.mem.SuspendThread(BotContro1l.wowmainthread);

                cave = BotContro1l.mem.AllocateMemory(0x2048);
                BotContro1l.mem.WriteASCIIString(cave + 0x1024, luaString);

                BotContro1l.mem.Asm.Clear();

                BotContro1l.mem.Asm.AddLine("mov EDX, [0x012705B0]");
                BotContro1l.mem.Asm.AddLine("mov EDX, [EDX+0x00002D94]");

                BotContro1l.mem.Asm.AddLine("FS mov EAX, [0x2C]");
                BotContro1l.mem.Asm.AddLine("mov EAX, [EAX]");
                BotContro1l.mem.Asm.AddLine("add EAX, 8");
                BotContro1l.mem.Asm.AddLine("mov [EAX], edx");

                BotContro1l.mem.Asm.AddLine("push 0");
                BotContro1l.mem.Asm.AddLine("mov eax, " + (cave + 0x1024));
                BotContro1l.mem.Asm.AddLine("push eax");
                BotContro1l.mem.Asm.AddLine("push eax");
                BotContro1l.mem.Asm.AddLine("call 0x007CF6B0");
                BotContro1l.mem.Asm.AddLine("add esp, 0xC");
                BotContro1l.mem.Asm.AddLine("retn");

                BotContro1l.mem.Asm.InjectAndExecute(cave);
                BotContro1l.mem.ResumeThread(BotContro1l.wowmainthread);

                BotContro1l.mem.FreeMemory(cave);
                BotContro1l.mem.Asm.Clear();
            }
            catch
            {
                BotContro1l.mem.ResumeThread(BotContro1l.wowmainthread);
                BotContro1l.mem.FreeMemory(cave);
                BotContro1l.mem.Asm.Clear();
            }
        }
Reply With Quote
  #10  
Old 10-05-2009
MaiN is offline.
Contributor
  
 
Join Date: Sep 2006
Location: Jaedenar O.o
Posts: 569
Reputation: 162
Points: 3,264, Level: 5
Points: 3,264, Level: 5 Points: 3,264, Level: 5 Points: 3,264, Level: 5
Level up: 58%, 336 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 8.6%
Activity: 8.6% Activity: 8.6% Activity: 8.6%

Holy crap that's ugly.
Why the hell do you use a codecave that's 0x2048 big and then use only from 0x1024 of it?
Also, learn to use
try {} finally {}
Also for russian text I think you need to write it in unicode.
__________________
http://www.main-dev.com/

I was here. ~Dragon[Sky]
I was here too. ~Kuiren
Reply With Quote
  #11  
Old 10-05-2009
flo8464's Avatar
flo8464 is offline.
Knight
  
 
Join Date: Apr 2009
Posts: 223
Reputation: 11
Points: 946, Level: 2
Points: 946, Level: 2 Points: 946, Level: 2 Points: 946, Level: 2
Level up: 10%, 454 Points needed
Level up: 10% Level up: 10% Level up: 10%
Activity: 16.0%
Activity: 16.0% Activity: 16.0% Activity: 16.0%

Quote:
Originally Posted by MaiN View Post
Also for russian text I think you need to write it in unicode.
Afaik lua functions have ASCII-Support only? I am using Lua in some of my apps and I failed to add Unicode-support.

Can anyone enlighten me how to make lua work with unicode files?
Reply With Quote
  #12  
Old 10-06-2009
qjlex's Avatar
qjlex is offline.
Site Donator
  
 
Join Date: Oct 2007
Location: Russia
Posts: 21
Reputation: 1
Points: 639, Level: 1
Points: 639, Level: 1 Points: 639, Level: 1 Points: 639, Level: 1
Level up: 48%, 261 Points needed
Level up: 48% Level up: 48% Level up: 48%
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%

How I can get Reply resulting LuaDoString?
Reply With Quote
  #13  
Old 10-06-2009
furang's Avatar
furang is offline.
Master Sergeant
  
 
Join Date: Jul 2009
Posts: 84
Reputation: 19
Points: 315, Level: 1
Points: 315, Level: 1 Points: 315, Level: 1 Points: 315, Level: 1
Level up: 79%, 85 Points needed
Level up: 79% Level up: 79% Level up: 79%
Activity: 5.1%
Activity: 5.1% Activity: 5.1% Activity: 5.1%

And here's my Lua_DoString function based on the above code
Code:
int Lua_DoString(char *luastr)
{
		int res;
		do
		{
			ReadProcessMemory( hProc, (LPVOID)(0x0133D5B0), (LPVOID)&res, sizeof(res), NULL );
		}
		while (res!=0);
		DWORD strmem;
		DWORD codemem;
		char shellcode[]=
		"\x8B\x15\xB0\x05\x27\x01\x8B\x92\x94\x2D\x00\x00"//MOV EDX,DWORD PTR DS:[12705B0], MOV EDX,DWORD PTR DS:[EDX+2D94]
		"\xA1\x2C\x00\x00\x00\x8B\x00\x83\xC0\x08"//MOV EAX,DWORD PTR DS:[2C],MOV EAX,DWORD PTR DS:[EAX],ADD EAX,8
		"\x89\x10\x6A\x00\xB8\x78\x56\x34\x12"//MOV DWORD PTR DS:[EAX],EDX,PUSH 0,MOV EAX,12345678 - luastr addr
		"\x50\x50\xFF\x15\xB0\xF6\x7C\x00\x83\xC4\x0C"//PUSH EAX,PUSH EAX,CALL 007CF6B0,ADD ESP,0C
		"\xC3";//retn
		SuspendThread(mThread);
		strmem=(DWORD)VirtualAllocEx(hProc,NULL,1024,MEM_COMMIT,PAGE_READWRITE);
		if (strmem==NULL)
		ShowMessage("Can't allocate memory");
		WriteProcessMemory(hProc, (LPVOID)(strmem),(LPVOID)&luastr[0],100,NULL);
				
		codemem=(DWORD)VirtualAllocEx(hProc,NULL,1024,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
		if (codemem==NULL)
		ShowMessage("Can't allocate memory");

		WriteProcessMemory(hProc, (LPVOID)(codemem),&shellcode[0],sizeof(shellcode),NULL);
		WriteProcessMemory(hProc, (LPVOID)(codemem+27),&strmem,4,NULL);
		
		CreateRemoteThread(hProc,NULL,0,(PTHREAD_START_ROUTINE)codemem,NULL,0,NULL);
		
		ResumeThread(mThread);
		if(!VirtualFreeEx(hProc,(LPVOID)strmem,NULL,MEM_RELEASE)) ShowMessage ("Can't free memory");
		if(!VirtualFreeEx(hProc,(LPVOID)codemem,NULL,MEM_RELEASE)) ShowMessage ("Can't free memory");
		
		return 0;
}
Does anyone have any idea why it crashes wow (Err 132)?
I tried it so and so, but the result is the same.
Am i doing anything wrong? Or maybe made a mess of shellcode?
PS. I know it's ugly and disgusting, but it can work.... i believe)
__________________
i did it 4 lulz

Last edited by furang; 10-06-2009 at 11:29 PM.
Reply With Quote
  #14  
Old 10-07-2009
lanman92 is offline.
Site Donator
  
 
Join Date: Mar 2007
Posts: 766
Reputation: 20
Points: 3,871, Level: 6
Points: 3,871, Level: 6 Points: 3,871, Level: 6 Points: 3,871, Level: 6
Level up: 31%, 629 Points needed
Level up: 31% Level up: 31% Level up: 31%
Activity: 6.3%
Activity: 6.3% Activity: 6.3% Activity: 6.3%

If you're using C++, is there ANY reason to be out of process? Anyway, I would say make an inline function and put an asm block in it. Much nicer. Then you can just copy the bytes out of that function into the process and execute it. I don't really see any problem with that asm, but you never know when it's in shellcode...
Reply With Quote
  #15  
Old 10-08-2009
furang's Avatar
furang is offline.
Master Sergeant
  
 
Join Date: Jul 2009
Posts: 84
Reputation: 19
Points: 315, Level: 1
Points: 315, Level: 1 Points: 315, Level: 1 Points: 315, Level: 1
Level up: 79%, 85 Points needed
Level up: 79% Level up: 79% Level up: 79%
Activity: 5.1%
Activity: 5.1% Activity: 5.1% Activity: 5.1%

I want as less intrusion, as it's possible. Maybe some day i inject dll...
You mean make an inline asm part? it'd be better, but how should i write it to other process? And shellcode is more suitable ait. I checked memstr addr is written at codestr+27 rewriting 12345678 ( MOV EAX,12345678). So it seems to be alright. But it's not(
Gonna try SEH.
__________________
i did it 4 lulz
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are On



All times are GMT -4. The time now is 02:43 AM.




Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493