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 10-07-2009
Cypher's Avatar
Cypher is offline.
Kynox's sister's pimp
Legendary User
  
 
Join Date: Apr 2006
Location: ntdll.dll
Posts: 4,185
Nominated 63 Times in 4 Posts
Nominated TOTM/W Award(s): 1
Reputation: 1085
Points: 55,512, Level: 35
Points: 55,512, Level: 35 Points: 55,512, Level: 35 Points: 55,512, Level: 35
Level up: 14%, 3,188 Points needed
Level up: 14% Level up: 14% Level up: 14%
Activity: 43.9%
Activity: 43.9% Activity: 43.9% Activity: 43.9%

PeLib - A PE File Format Wrapper

Project:
PeLib

Purpose:
To wrap the PE file format in its entirety, for both read and write operations, and for both files in memory and on disk.

Architectures:
IA-32 (x86)
AMD64 (x64)
IA-64 (Itanium) <-- Compiles fine but needs testing.

Languages:
Written in C++. Sorry, but the API is not C-compatible.
Provided is a solution and project file for VS2008. However you should be able to get it working in your particular compiler with little-to-no work.

Notes:
If you want to use this you need to be prepared for breaking API changes in future versions (meaning, APIs may not be backwards compatible so it will require you to update your source code). If you are not comfortable with this than you may want to wait a while (possibly a long time) until these changes are over.

Reason being, the library is still in very early stages and I need to make some large architectural changes in order to implement certain functionality.

I would love to hear comments/suggestions/criticisms/etc if you have them.

Releases:
[Only registered and activated users can see links. ]
First release. Very basic functionality. Currently wraps NT header, DOS header, TLS dir, Import dir, and Export dir. Only supports files in-memory. Only supports operating on files with the same architecture that the lib is compiled as. Still lots of potential bugs and unchecked pointers.
[Only registered and activated users can see links. ]
Maintenance release. Fixes some critical bugs, some minor bugs, and introduces an example usage project.
__________________
[Only registered and activated users can see links. ] Back online!

"Science is interesting, and if you don't agree you can **** off."
[Only registered and activated users can see links. ]

"I can write very coherent things when I try that sound very good" -- Styles

Last edited by Cypher; 10-12-2009 at 04:33 AM.
Reply With Quote


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

  #2  
Old 10-07-2009
Mirror's Avatar
Mirror is offline.
Contributor
  
 
Join Date: Nov 2006
Location: 48°N 5' 32" 16°S 1'
Posts: 2,483
Reputation: 255
Points: 9,837, Level: 12
Points: 9,837, Level: 12 Points: 9,837, Level: 12 Points: 9,837, Level: 12
Level up: 4%, 1,163 Points needed
Level up: 4% Level up: 4% Level up: 4%
Activity: 1.5%
Activity: 1.5% Activity: 1.5% Activity: 1.5%

Not sure if I can use this (probably can't I'm too stupid), but you spent lots of time on this I'm guessing so, +5.
__________________
Reply With Quote
  #3  
Old 10-08-2009
Apoc's Avatar
Apoc is offline.
MMOwned WebDev
Legendary User
  
 
Join Date: Jan 2008
Posts: 1,915
Nominated 5 Times in 1 Post
Reputation: 1029
Points: 22,671, Level: 21
Points: 22,671, Level: 21 Points: 22,671, Level: 21 Points: 22,671, Level: 21
Level up: 17%, 1,329 Points needed
Level up: 17% Level up: 17% Level up: 17%
Activity: 35.7%
Activity: 35.7% Activity: 35.7% Activity: 35.7%

Why must you do this to me?!?!

Now I have to go port this to C#
__________________
[Only registered and activated users can see links. ]
Reply With Quote
  #4  
Old 10-08-2009
wraithZX is offline.
Site Donator
  
 
Join Date: May 2007
Posts: 63
Reputation: 19
Points: 1,186, Level: 2
Points: 1,186, Level: 2 Points: 1,186, Level: 2 Points: 1,186, Level: 2
Level up: 58%, 214 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 0.7%
Activity: 0.7% Activity: 0.7% Activity: 0.7%

I'll see if I can have a play with it on an IA64 machine here at work.
Reply With Quote
  #5  
Old 10-08-2009
ggg898 is offline.
Corporal
  
 
Join Date: Jan 2009
Posts: 33
Reputation: 10
Points: 348, Level: 1
Points: 348, Level: 1 Points: 348, Level: 1 Points: 348, Level: 1
Level up: 87%, 52 Points needed
Level up: 87% Level up: 87% Level up: 87%
Activity: 1.1%
Activity: 1.1% Activity: 1.1% Activity: 1.1%

Wow, many thanks for once again sharing a very useful software lib. Have no time to look at it now right now. Does it do rebasing?
Reply With Quote
  #6  
Old 10-08-2009
Cypher's Avatar
Cypher is offline.
Kynox's sister's pimp
Legendary User
  
 
Join Date: Apr 2006
Location: ntdll.dll
Posts: 4,185
Nominated 63 Times in 4 Posts
Nominated TOTM/W Award(s): 1
Reputation: 1085
Points: 55,512, Level: 35
Points: 55,512, Level: 35 Points: 55,512, Level: 35 Points: 55,512, Level: 35
Level up: 14%, 3,188 Points needed
Level up: 14% Level up: 14% Level up: 14%
Activity: 43.9%
Activity: 43.9% Activity: 43.9% Activity: 43.9%

Quote:
Originally Posted by ggg898 View Post
Wow, many thanks for once again sharing a very useful software lib. Have no time to look at it now right now. Does it do rebasing?
Relocations are something which I am in the process of adding.

You can't rebase a module on disk yet, but I want to be able to relocate a module in-memory. Reason being is I'm writing my own PE loader so I can do a DLL manual mapper and a EXE memory forker.

Rebasing on disk will come later, however the Windows SDK can do that for you already.
__________________
[Only registered and activated users can see links. ] Back online!

"Science is interesting, and if you don't agree you can **** off."
[Only registered and activated users can see links. ]

"I can write very coherent things when I try that sound very good" -- Styles
Reply With Quote
  #7  
Old 10-08-2009
wraithZX is offline.
Site Donator
  
 
Join Date: May 2007
Posts: 63
Reputation: 19
Points: 1,186, Level: 2
Points: 1,186, Level: 2 Points: 1,186, Level: 2 Points: 1,186, Level: 2
Level up: 58%, 214 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 0.7%
Activity: 0.7% Activity: 0.7% Activity: 0.7%

Quote:
Originally Posted by Cypher View Post
Reason being is I'm writing my own PE loader so I can do a DLL manual mapper and a EXE memory forker.
It seems I'm not the only one.
If you haven't done so, I'd suggest having a look at the ReactOS source on loading modules - it doesn't support everything but it's a nice base to work on the rest of it.
Reply With Quote
  #8  
Old 10-09-2009
Cypher's Avatar
Cypher is offline.
Kynox's sister's pimp
Legendary User
  
 
Join Date: Apr 2006
Location: ntdll.dll
Posts: 4,185
Nominated 63 Times in 4 Posts
Nominated TOTM/W Award(s): 1
Reputation: 1085
Points: 55,512, Level: 35
Points: 55,512, Level: 35 Points: 55,512, Level: 35 Points: 55,512, Level: 35
Level up: 14%, 3,188 Points needed
Level up: 14% Level up: 14% Level up: 14%
Activity: 43.9%
Activity: 43.9% Activity: 43.9% Activity: 43.9%

Quote:
Originally Posted by wraithZX View Post
It seems I'm not the only one.
If you haven't done so, I'd suggest having a look at the ReactOS source on loading modules - it doesn't support everything but it's a nice base to work on the rest of it.
Nah, I'm reversing the Windows PE loader. It's a longer process, but likely to be more accurate.
__________________
[Only registered and activated users can see links. ] Back online!

"Science is interesting, and if you don't agree you can **** off."
[Only registered and activated users can see links. ]

"I can write very coherent things when I try that sound very good" -- Styles
Reply With Quote
  #9  
Old 10-10-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%

Very nice work.

One of the things I ever wanted to do is a rewrite of CreateProcess so I can use it with data in Memory instead of having to set .exe-files on my hdd.
Reply With Quote
  #10  
Old 10-10-2009
Cypher's Avatar
Cypher is offline.
Kynox's sister's pimp
Legendary User
  
 
Join Date: Apr 2006
Location: ntdll.dll
Posts: 4,185
Nominated 63 Times in 4 Posts
Nominated TOTM/W Award(s): 1
Reputation: 1085
Points: 55,512, Level: 35
Points: 55,512, Level: 35 Points: 55,512, Level: 35 Points: 55,512, Level: 35
Level up: 14%, 3,188 Points needed
Level up: 14% Level up: 14% Level up: 14%
Activity: 43.9%
Activity: 43.9% Activity: 43.9% Activity: 43.9%

Quote:
Originally Posted by flo8464 View Post
Very nice work.

One of the things I ever wanted to do is a rewrite of CreateProcess so I can use it with data in Memory instead of having to set .exe-files on my hdd.
Thats what I was referring to when I said "EXE memory forker". It's a fairly big job if you want to do it in a stable and reliable manner though. Be prepared to invest a lot of time.
__________________
[Only registered and activated users can see links. ] Back online!

"Science is interesting, and if you don't agree you can **** off."
[Only registered and activated users can see links. ]

"I can write very coherent things when I try that sound very good" -- Styles
Reply With Quote
  #11  
Old 10-12-2009
Cypher's Avatar
Cypher is offline.
Kynox's sister's pimp
Legendary User
  
 
Join Date: Apr 2006
Location: ntdll.dll
Posts: 4,185
Nominated 63 Times in 4 Posts
Nominated TOTM/W Award(s): 1
Reputation: 1085
Points: 55,512, Level: 35
Points: 55,512, Level: 35 Points: 55,512, Level: 35 Points: 55,512, Level: 35
Level up: 14%, 3,188 Points needed
Level up: 14% Level up: 14% Level up: 14%
Activity: 43.9%
Activity: 43.9% Activity: 43.9% Activity: 43.9%

Post updated with latest revision.
__________________
[Only registered and activated users can see links. ] Back online!

"Science is interesting, and if you don't agree you can **** off."
[Only registered and activated users can see links. ]

"I can write very coherent things when I try that sound very good" -- Styles
Reply With Quote
  #12  
Old 2 Weeks Ago
wraithZX is offline.
Site Donator
  
 
Join Date: May 2007
Posts: 63
Reputation: 19
Points: 1,186, Level: 2
Points: 1,186, Level: 2 Points: 1,186, Level: 2 Points: 1,186, Level: 2
Level up: 58%, 214 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 0.7%
Activity: 0.7% Activity: 0.7% Activity: 0.7%

PeDump_IA64.exe:

Code:
Export Directory:
  Name: "?Exp1@@YAXXZ". Ordinal: 0000. Function: "00099FE0". 
  Name: "?Exp2@@YAHAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z". Ordinal: 0001. Function: "000998C8". 
  Name: "?Exp3@@YAXJ@Z". Ordinal: 0002. Function: "00099FE0". 

Import Directory:
  Module Name: "KERNEL32.dll".
    Name: "GetModuleHandleW". Function: 00000000000AE710.
    Name: "WideCharToMultiByte". Function: 00000000000AE732.
    Name: "MultiByteToWideChar". Function: 00000000000AE748.
    Name: "Sleep". Function: 00000000000AE75E.
    Name: "InitializeCriticalSection". Function: 00000000000AE766.
    Name: "DeleteCriticalSection". Function: 00000000000AE782.
    Name: "EnterCriticalSection". Function: 00000000000AE79A.
    Name: "LeaveCriticalSection". Function: 00000000000AE7B2.
    Name: "TerminateProcess". Function: 00000000000AE7CA.
    Name: "GetCurrentProcess". Function: 00000000000AE7DE.
    Name: "UnhandledExceptionFilter". Function: 00000000000AE7F2.
    Name: "SetUnhandledExceptionFilter". Function: 00000000000AE80E.
    Name: "IsDebuggerPresent". Function: 00000000000AE82C.
    Name: "RtlCaptureContext". Function: 00000000000AE840.
    Name: "GetLastError". Function: 00000000000AE854.
    Name: "HeapFree". Function: 00000000000AE864.
    Name: "RaiseException". Function: 00000000000AE870.
    Name: "RtlPcToFileHeader". Function: 00000000000AE882.
    Name: "RtlLookupFunctionEntry". Function: 00000000000AE896.
    Name: "RtlUnwindEx". Function: 00000000000AE8B0.
    Name: "RtlUnwind2". Function: 00000000000AE8BE.
    Name: "GetVersion". Function: 00000000000AE8CC.
    Name: "GetCPInfo". Function: 00000000000AE8DA.
    Name: "LCMapStringA". Function: 00000000000AE8E6.
    Name: "LCMapStringW". Function: 00000000000AE8F6.
    Name: "GetStringTypeW". Function: 00000000000AE906.
    Name: "RtlVirtualUnwind". Function: 00000000000AE918.
    Name: "HeapAlloc". Function: 00000000000AE92C.
    Name: "EncodePointer". Function: 00000000000AE938.
    Name: "DecodePointer". Function: 00000000000AE948.
    Name: "FlsGetValue". Function: 00000000000AE958.
    Name: "FlsSetValue". Function: 00000000000AE966.
    Name: "FlsFree". Function: 00000000000AE974.
    Name: "SetLastError". Function: 00000000000AE97E.
    Name: "GetCurrentThreadId". Function: 00000000000AE98E.
    Name: "FlsAlloc". Function: 00000000000AE9A4.
    Name: "HeapSetInformation". Function: 00000000000AE9B0.
    Name: "HeapCreate". Function: 00000000000AE9C6.
    Name: "WriteFile". Function: 00000000000AE9D4.
    Name: "GetStdHandle". Function: 00000000000AE9E0.
    Name: "GetModuleFileNameA". Function: 00000000000AE9F0.
    Name: "GetProcAddress". Function: 00000000000AEA06.
    Name: "ExitProcess". Function: 00000000000AEA18.
    Name: "GetModuleFileNameW". Function: 00000000000AEA26.
    Name: "FreeEnvironmentStringsW". Function: 00000000000AEA3C.
    Name: "GetEnvironmentStringsW". Function: 00000000000AEA56.
    Name: "GetCommandLineW". Function: 00000000000AEA70.
    Name: "SetHandleCount". Function: 00000000000AEA82.
    Name: "GetFileType". Function: 00000000000AEA94.
    Name: "GetStartupInfoA". Function: 00000000000AEAA2.
    Name: "QueryPerformanceCounter". Function: 00000000000AEAB4.
    Name: "GetTickCount". Function: 00000000000AEACE.
    Name: "GetCurrentProcessId". Function: 00000000000AEADE.
    Name: "GetSystemTimeAsFileTime". Function: 00000000000AEAF4.
    Name: "GetConsoleCP". Function: 00000000000AEB0E.
    Name: "GetConsoleMode". Function: 00000000000AEB1E.
    Name: "FlushFileBuffers". Function: 00000000000AEB30.
    Name: "GetStringTypeA". Function: 00000000000AEB44.
    Name: "ReadFile". Function: 00000000000AEB56.
    Name: "SetFilePointer". Function: 00000000000AEB62.
    Name: "CloseHandle". Function: 00000000000AEB74.
    Name: "HeapSize". Function: 00000000000AEB82.
    Name: "GetACP". Function: 00000000000AEB8E.
    Name: "GetOEMCP". Function: 00000000000AEB98.
    Name: "IsValidCodePage". Function: 00000000000AEBA4.
    Name: "GetUserDefaultLCID". Function: 00000000000AEBB6.
    Name: "GetLocaleInfoA". Function: 00000000000AEBCC.
    Name: "EnumSystemLocalesA". Function: 00000000000AEBDE.
    Name: "IsValidLocale". Function: 00000000000AEBF4.
    Name: "HeapReAlloc". Function: 00000000000AEC04.
    Name: "LoadLibraryA". Function: 00000000000AEC12.
    Name: "GetLocaleInfoW". Function: 00000000000AEC22.
    Name: "InitializeCriticalSectionAndSpinCount". Function: 00000000000AEC34.
    Name: "WriteConsoleA". Function: 00000000000AEC5C.
    Name: "GetConsoleOutputCP". Function: 00000000000AEC6C.
    Name: "WriteConsoleW". Function: 00000000000AEC82.
    Name: "SetStdHandle". Function: 00000000000AEC92.
    Name: "CreateFileA". Function: 00000000000AECA2.

Tls Directory:
Error! Tls directory invalid.

Sections:
Name: ".text".
Name: ".rdata".
Name: ".pdata".
Name: ".srdata".
Name: ".sdata".
Name: ".data".
Name: ".rsrc".
Name: ".reloc".
...aaand it stalls at that point. Which matches the x64 version, so I guess it's working fine.
Reply With Quote
  #13  
Old 2 Weeks Ago
Cypher's Avatar
Cypher is offline.
Kynox's sister's pimp
Legendary User
  
 
Join Date: Apr 2006
Location: ntdll.dll
Posts: 4,185
Nominated 63 Times in 4 Posts
Nominated TOTM/W Award(s): 1
Reputation: 1085
Points: 55,512, Level: 35
Points: 55,512, Level: 35 Points: 55,512, Level: 35 Points: 55,512, Level: 35
Level up: 14%, 3,188 Points needed
Level up: 14% Level up: 14% Level up: 14%
Activity: 43.9%
Activity: 43.9% Activity: 43.9% Activity: 43.9%

Awesome! Thanks.

I've actually added a whole bunch of features and started on the file-based access and platform-independent file manipulation. Hence the long gap before another release. Still a while off yet because I'm juggling so many different things at once, but it's getting there.
__________________
[Only registered and activated users can see links. ] Back online!

"Science is interesting, and if you don't agree you can **** off."
[Only registered and activated users can see links. ]

"I can write very coherent things when I try that sound very good" -- Styles
Reply With Quote
  #14  
Old 1 Week Ago
ramey is offline.
Knight-Lieutenant
  
 
Join Date: Jan 2008
Posts: 275
Reputation: 17
Points: 1,542, Level: 3
Points: 1,542, Level: 3 Points: 1,542, Level: 3 Points: 1,542, Level: 3
Level up: 21%, 558 Points needed
Level up: 21% Level up: 21% Level up: 21%
Activity: 5.8%
Activity: 5.8% Activity: 5.8% Activity: 5.8%

Thanks Cypher, looks great. Also using your new loader you posted on your blog with my new project, which is maybe the 4th rewrite... Don't really know why I keep doing this to myself, but the loader came in handy.

Thanks!
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:12 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