Fatal Error : Access Violation

This is a discussion on Fatal Error : Access Violation within the Warcraft 3 forum board part of the Hot Games category; Originally Posted by Sky_King We are not psychic you arent... I am Gogo TNT!...

Page 2 of 9 FirstFirst 1234 ... LastLast
Results 11 to 20 of 84
  1. #11
    Malish's Avatar
    Malish is offline YAH


    Array
    Join Date
    Mar 2007
    Location
    If afk, at the pub.
    Posts
    4,853
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Rep Power
    20
    Reputation
    1434
    Quote Originally Posted by Sky_King View Post
    We are not psychic
    you arent... I am

    Gogo TNT!

    If you have any questions about posting or selling your hack here. Read this link.


  2. #12
    Chaos_Nick_1's Avatar
    Chaos_Nick_1 is offline Addict
    Array
    Join Date
    Feb 2008
    Location
    Montreal, Verdun
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    Ok well the only programs I'm using while warcraf, sometimes, is Skype, and Msn Messenger, and I ain't using any other programs, and by the way, I ain't the administrator of the computer, but in the past years, it never caused me any problems to play. Here's the error I got from the last game I played.

    Code:
    ==============================================================================
    Warcraft III (build 6352)
    
    Exe:      c:\warcraft iii\war3.exe
    Time:     Apr 16, 2009  9:34:02.312 PM
    User:     Nicolas
    Computer: NOM-4335C342C2C
    ------------------------------------------------------------------------------
    
    This application has encountered a critical error:
    
    FATAL ERROR!
    
    Program:    c:\warcraft iii\war3.exe
    Exception:    0xC0000005 (ACCESS_VIOLATION) at 001B:6F4E6503
    
    The instruction at '0x6F4E6503' referenced memory at '0x00000194'.
    The memory could not be 'read'.
    
    
    War3Build: 1.23.0.6352
    Played Maps\Download\DotA Allstars v6.59d.w3x
    Player  0 The Sentinel          Race Human    StartLoc -1
    Player  1 MonPtitLoup (Lycan)    Race NightElf    StartLoc  0
    Player  2 vcvwj (Mirana)        Race NightElf    StartLoc  1
    Player  3 Kirby_OwNer (Troll)    Race NightElf    StartLoc  2
    Player  4 KalS[T]eR (Knight Davion)    Race NightElf    StartLoc  3
    Player  5 kingperux (Slithice)    Race NightElf    StartLoc  4
    Player  6 The Scourge           Race Human    StartLoc -1
    Player  7 KennyQuynh (Nessaj)    Race Undead    StartLoc  5
    Player  8 n.d.g (Magina)        Race Undead    StartLoc  6
    Player  9 zanzidor (Razor)      Race Undead    StartLoc  7
    Player 10 Kream (Gondar)        Race Undead    StartLoc  8
    Player 11 NT_herb (Techies)     Race Undead    StartLoc  9
    ------------------------------------------------------------------------------
    
    ----------------------------------------
        x86 Registers
    ----------------------------------------
    
    EAX=0DCA4DF0  EBX=0013FAE0  ECX=00000000  EDX=027E05B0  ESI=00000000
    EDI=00000393  EBP=0013FA04  ESP=0013F998  EIP=6F4E6503  FLG=00010206
    CS =001B      DS =0023      ES =0023      SS =0023      FS =003B      GS =0000
    
    
    ----------------------------------------
        Stack Trace (Manual)
    ----------------------------------------
    
    Address  Frame    Logical addr  Module
    
    6F4E6503 0013FA04 0001:004E5503 c:\warcraft iii\Game.dll
    
    ----------------------------------------
        Stack Trace (Using DBGHELP.DLL)
    ----------------------------------------
    
    6F4E6503 Game.dll     <unknown symbol>+0 (0x450AF888,0x3F800000,0xB31BA487,0xB2EE500E)
    C4A2EA9A <unknown module> <unknown symbol>+0 (0x00000000,0x00000000,0x00000000,0x00000000)
    
    
    ----------------------------------------
        Loaded Modules
    ----------------------------------------
    
    0x00360000 - 0x00369000  Normaliz.dll
    0x00400000 - 0x0047D000  war3.exe
    0x09770000 - 0x09A4A000  xpsp2res.dll
    0x15000000 - 0x15061000  Storm.dll
    0x16080000 - 0x160A5000  mdnsNSP.dll
    0x21100000 - 0x2115F000  mss32.dll
    0x22600000 - 0x22616000  Mssfast.m3d
    0x22700000 - 0x22717000  Mssdolby.m3d
    0x22C00000 - 0x22C18000  Msseax2.m3d
    0x24600000 - 0x24611000  Reverb3.flt
    0x26F00000 - 0x26F2A000  Mp3dec.asi
    0x43E00000 - 0x43E45000  iertutil.dll
    0x44080000 - 0x44150000  WININET.dll
    0x4D5E0000 - 0x4D639000  WINHTTP.dll
    0x58B50000 - 0x58BEA000  COMCTL32.dll
    0x5B090000 - 0x5B0C8000  uxtheme.dll
    0x5D3F0000 - 0x5D491000  dbghelp.dll
    0x5F070000 - 0x5F13C000  OPENGL32.dll
    0x60000000 - 0x6005D000  ijl15.dll
    0x62E40000 - 0x62E99000  hnetcfg.dll
    0x68000000 - 0x68036000  rsaenh.dll
    0x68100000 - 0x68126000  dssenh.dll
    0x6CEF0000 - 0x6CF11000  GLU32.dll
    0x6DE60000 - 0x6DE66000  d3d8thk.dll
    0x6DE70000 - 0x6DF98000  d3d8.dll
    0x6F000000 - 0x6FBC2000  Game.dll
    0x6FEE0000 - 0x6FF35000  netapi32.dll
    0x71990000 - 0x719D0000  mswsock.dll
    0x719D0000 - 0x719D8000  wshtcpip.dll
    0x719E0000 - 0x719E8000  WS2HELP.dll
    0x719F0000 - 0x71A07000  WS2_32.dll
    0x71A10000 - 0x71A1A000  WSOCK32.dll
    0x71B50000 - 0x71B63000  SAMLIB.dll
    0x72220000 - 0x72225000  SensApi.dll
    0x72C60000 - 0x72C68000  msacm32.drv
    0x72C70000 - 0x72C79000  wdmaud.drv
    0x736B0000 - 0x736FB000  DDRAW.dll
    0x73B10000 - 0x73B16000  DCIMAN32.dll
    0x73E30000 - 0x73E34000  KsUser.dll
    0x73E60000 - 0x73EBC000  DSOUND.DLL
    0x74690000 - 0x746DC000  MSCTF.dll
    0x75140000 - 0x7516E000  msctfime.ime
    0x75ED0000 - 0x75EE3000  cryptnet.dll
    0x76320000 - 0x7633D000  IMM32.dll
    0x76340000 - 0x7638A000  comdlg32.dll
    0x76790000 - 0x767B7000  schannel.dll
    0x76960000 - 0x76A16000  userenv.dll
    0x76AE0000 - 0x76B0F000  WINMM.dll
    0x76BA0000 - 0x76BAB000  PSAPI.DLL
    0x76BE0000 - 0x76C0E000  WINTRUST.dll
    0x76C40000 - 0x76C68000  IMAGEHLP.dll
    0x76D10000 - 0x76D29000  Iphlpapi.dll
    0x76E30000 - 0x76E3E000  rtutils.dll
    0x76E40000 - 0x76E52000  rasman.dll
    0x76E60000 - 0x76E8F000  TAPI32.dll
    0x76E90000 - 0x76ECC000  RASAPI32.DLL
    0x76ED0000 - 0x76EF7000  DNSAPI.dll
    0x76F10000 - 0x76F3D000  WLDAP32.dll
    0x76F60000 - 0x76F68000  winrnr.dll
    0x76F70000 - 0x76F76000  rasadhlp.dll
    0x770E0000 - 0x7716B000  OLEAUT32.DLL
    0x77390000 - 0x77493000  comctl32.dll
    0x774A0000 - 0x775DD000  ole32.dll
    0x77650000 - 0x77671000  NTMARTA.DLL
    0x779E0000 - 0x77A77000  CRYPT32.dll
    0x77A80000 - 0x77A92000  MSASN1.dll
    0x77B50000 - 0x77B72000  apphelp.dll
    0x77BA0000 - 0x77BA7000  midimap.dll
    0x77BB0000 - 0x77BC5000  MSACM32.dll
    0x77BD0000 - 0x77BD8000  VERSION.dll
    0x77BE0000 - 0x77C38000  msvcrt.dll
    0x77C40000 - 0x77C64000  msv1_0.dll
    0x77DA0000 - 0x77E4C000  ADVAPI32.dll
    0x77E50000 - 0x77EE2000  RPCRT4.dll
    0x77EF0000 - 0x77F39000  GDI32.dll
    0x77F40000 - 0x77FB6000  SHLWAPI.dll
    0x77FC0000 - 0x77FD1000  Secur32.dll
    0x78130000 - 0x781CB000  MSVCR80.dll
    0x7C800000 - 0x7C906000  kernel32.dll
    0x7C910000 - 0x7C9C6000  ntdll.dll
    0x7C9D0000 - 0x7D1F5000  SHELL32.dll
    0x7E390000 - 0x7E421000  USER32.dll
    
    
    ----------------------------------------
        Memory Dump
    ----------------------------------------
    
    Code: 16 bytes starting at (EIP = 6F4E6503)
    
    6F4E6503: F6 86 94 01  00 00 40 75  0D D9 44 24  08 51 D9 1C  [email protected]$.Q..
    
    
    Stack: 1024 bytes starting at (ESP = 0013F998)
    
    * = addr                            **                                *       
    0013F990: 00 00 00 00  00 00 00 00  98 00 7A 03  0B 67 4D 6F  ..........z..gMo
    0013F9A0: CD CC 4C 3D  04 FA 13 00  E0 FA 13 00  00 00 00 00  ..L=............
    0013F9B0: 40 FA 13 00  19 32 01 6F  CD CC 4C 3D  04 FA 13 00  @....2.o..L=....
    0013F9C0: E0 FA 13 00  D4 77 01 6F  04 FA 13 00  E5 77 01 6F  .....w.o.....w.o
    0013F9D0: CD CC 4C 3D  E8 04 80 03  88 00 25 18  82 CF 39 6F  ..L=......%...9o
    0013F9E0: CD CC 4C 3D  1F 75 0E BB  88 00 25 18  DC 3E AD 6F  ..L=.u....%..>.o
    0013F9F0: 00 00 00 00  E4 3E AD 6F  6E C4 98 43  E8 04 80 03  .....>.on..C....
    0013FA00: 00 00 80 3F  03 8B 17 43  9A EA A2 C4  88 F8 0A 45  ...?...C.......E
    0013FA10: 00 00 80 3F  87 A4 1B B3  0E 50 EE B2  40 AA 43 33  [email protected]
    0013FA20: D0 3B 54 3F  42 27 0F 3F  76 03 3C B1  43 27 0F 3F  .;T?B'.?v.<.C'.?
    0013FA30: CE 3B 54 BF  FF 8A 17 C3  83 DF 22 C3  4C C3 20 45  .;T.......".L. E
    0013FA40: 05 4D C1 42  4F 20 9F C4  CC B5 04 45  05 4D C1 42  .M.BO .....E.M.B
    0013FA50: 05 BA 98 C4  51 DE 06 45  7C 6F 4E 43  05 BA 98 C4  ....Q..E|oNC....
    0013FA60: 51 DE 06 45  7C 6F 4E 43  4F 20 9F C4  CC B5 04 45  Q..E|oNCO .....E
    0013FA70: 5C 11 22 C5  6E B9 54 43  88 0F 2E C5  5C 11 22 C5  \.".n.TC....\.".
    0013FA80: CA 48 2D 45  25 4B 84 C4  BA 02 35 45  CB 48 2D 45  .H-E%K....5E.H-E
    0013FA90: 25 4B 84 C4  BB 02 35 45  7F B9 54 43  88 0F 2E C5  %K....5E..TC....
    0013FAA0: D4 2E E9 3F  00 00 00 00  00 00 00 00  00 00 00 00  ...?............
    0013FAB0: 00 00 00 00  11 46 4F 40  00 00 00 00  00 00 00 00  [email protected]
    0013FAC0: 00 00 00 00  00 00 00 00  78 39 85 3F  00 00 80 3F  ........x9.?...?
    0013FAD0: 00 00 00 00  00 00 00 00  E6 14 4C C3  00 00 00 00  ..........L.....
    0013FAE0: 00 8B 17 43  E0 54 BE C3  BF E7 55 44  03 8B 17 43  ...C.T....UD...C
    0013FAF0: 9A EA A2 C4  88 F8 0A 45  76 23 C6 44  C0 FC 13 00  .......Ev#.D....
    0013FB00: 7B 6C 82 6F  00 00 00 00  4B F5 5E 6F  6F 12 03 3D  {l.o....K.^oo..=
    0013FB10: 2F 00 3D BA  F4 3E AD 6F  DC 3E AD 6F  00 00 00 00  /.=..>.o.>.o....
    0013FB20: 14 37 FE 02  88 00 22 18  00 00 80 3F  00 00 00 00  .7...."....?....
    0013FB30: 01 00 00 00  00 00 00 00  01 00 00 00  00 00 00 00  ................
    0013FB40: 00 00 00 00  00 00 00 00  00 00 00 00  9A 99 19 3F  ...............?
    0013FB50: CD CC 4C 3F  00 00 00 00  00 00 00 00  9A 99 19 3F  ..L?...........?
    0013FB60: CD CC 4C 3F  00 00 00 00  B8 1E 05 3E  CD CC 4C 3F  ..L?.......>..L?
    0013FB70: E2 7A 14 3F  00 00 00 00  B8 1E 05 3E  CD CC 4C 3F  .z.?.......>..L?
    0013FB80: E2 7A 14 3F  8B F5 5E 6F  00 00 00 00  00 00 00 00  .z.?..^o........
    0013FB90: 00 00 00 00  B0 01 F0 00  98 00 D8 02  00 00 80 3F  ...............?
    0013FBA0: 00 00 00 00  01 00 00 00  00 00 00 00  01 00 00 00  ................
    0013FBB0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
    0013FBC0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
    0013FBD0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
    0013FBE0: CD CC 4C 3F  9A 99 19 3F  00 00 00 00  00 00 00 00  ..L?...?........
    0013FBF0: CD CC 4C 3F  9A 99 19 3F  38 03 5F 6F  00 00 00 00  ..L?...?8._o....
    0013FC00: 80 00 D8 02  00 00 00 00  4B FA 79 6F  98 00 D8 02  ........K.yo....
    0013FC10: 6F 12 03 3D  EF 70 0E BB  00 00 00 00  28 01 03 01  o..=.p......(...
    0013FC20: 00 00 80 3F  FA 8B FB 0A  00 00 00 00  00 00 80 3F  ...?...........?
    0013FC30: 00 00 00 00  00 00 80 3F  00 00 00 00  00 00 80 3F  .......?.......?
    0013FC40: 00 00 00 00  00 00 00 00  00 00 80 3F  00 00 80 3F  ...........?...?
    0013FC50: 00 00 20 40  00 00 00 00  00 00 00 00  00 00 00 00  .. @............
    0013FC60: 00 00 00 00  55 55 55 40  00 00 00 00  00 00 00 00  [email protected]
    0013FC70: 00 00 00 00  00 00 00 00  6F 12 83 3B  00 00 00 00  ........o..;....
    0013FC80: 00 00 80 BF  00 00 80 BF  00 00 80 BF  00 00 80 3F  ...............?
    0013FC90: 00 00 80 3F  00 00 00 00  00 00 00 00  00 00 00 00  ...?............
    0013FCA0: 00 00 80 3F  00 00 00 00  00 00 00 00  00 00 00 00  ...?............
    0013FCB0: 00 00 80 3F  00 00 00 00  00 00 00 00  00 00 00 00  ...?............
    0013FCC0: FC FC 13 00  6B FD 84 6F  FF FF FF FF  3D 42 62 6F  ....k..o....=Bbo
    0013FCD0: 23 70 0E BB  88 00 F0 00  88 00 F0 00  F8 24 F5 01  #p...........$..
    0013FCE0: 11 00 00 00  28 01 03 01  4B FE 0F FF  01 00 00 00  ....(...K.......
    0013FCF0: B0 FF 13 00  98 41 84 6F  01 00 00 00  B0 FF 13 00  .....A.o........
    0013FD00: 98 41 84 6F  00 00 00 00  0D F5 61 6F  00 00 00 00  .A.o......ao....
    0013FD10: 81 20 62 6F  7B 1D 80 7C  00 00 00 6F  6E AC 80 7C  . bo{..|...on..|
    0013FD20: 30 AE 80 7C  00 00 00 00  00 00 00 00  45 6E 67 69  0..|........Engi
    0013FD30: 6E 65 20 64  38 38 00 00  58 FD 13 00  EA 32 81 7C  ne d88..X....2.|
    0013FD40: 02 00 00 00  01 00 00 00  00 FC FD 7F  00 00 00 6F  ...............o
    0013FD50: FC DB 91 7C  DC CF 91 7C  FC DB 91 7C  B7 A0 80 7C  ...|...|...|...|
    0013FD60: E8 40 00 00  00 00 00 00  6E AC 80 7C  D3 71 0E BB  [email protected]|.q..
    0013FD70: 51 21 62 6F  01 00 00 00  E4 98 00 6F  63 3A 5C 77  Q!bo.......oc:\w
    0013FD80: 61 72 63 72  61 66 74 20  69 69 69 5C  4C 6F 67 73  arcraft iii\Logs
    0013FD90: 00 65 78 65  00 6B 45 00  00 00 00 6F  FF FF 00 00  .exe.kE....o....
    
    
    ------------------------------------------------------------------------------

  3. #13
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    That's really got me stumped man. :-( I have no idea. It doesn't really make sense why it's crashing. I tried to open OllyDbg and check out that offset. But, I couldn't really make anything of it. How often does this happen? Every day? I have *NO* clue what that offset does. I could write a small program that NOP's the operation. I don't know what it would do. I still need to get the latest Warden offsets to make sure you wouldn't get banned from NOPing those offsets. But I can't imagine you would. I played a test game with getting rid of that line and it worked fine...

    Code:
    CPU Disasm
    Address   Hex dump          Command                                  Comments
    6F5056AC      D956 08       FST DWORD PTR DS:[ESI+8]
    
    ...changed to...
    
    CPU Disasm
    Address   Hex dump          Command                                  Comments
    6F5056AC      90            NOP
    6F5056AD      90            NOP
    6F5056AE      90            NOP
    You could try that in OllyDbg or I could write a small program that would do that and you can test it. If this only happens once a month I wouldn't worry about it, but if it's happening every other game or every third game we could try that route. Sorry that's all I know. Clueless as to what this method actually does. :-(

  4. #14
    Sky_King's Avatar
    Sky_King is offline Hacker
    Array
    Join Date
    Mar 2009
    Location
    In the US now
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    143
    Before you test any higly complicated method try this:
    Do you have a downloaded or cracked warcraft III?
    Have you tried to reinstall?

  5. #15
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    @Sky_King: LoL. For me it is much more complicated/time consuming to reinstall than it is to NOP that statement. LoL. But, if you have not used OllyDbg much it might be more complicated. :-D

  6. #16
    Chaos_Nick_1's Avatar
    Chaos_Nick_1 is offline Addict
    Array
    Join Date
    Feb 2008
    Location
    Montreal, Verdun
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    First of all, what's OllyDbg ? It actually happens everyday, even twice or 3 times a day : everytime, every posible time I play a game, it crashes ! What is NOP ? and Warden ? I've reinstalled warcraft many times and nothing happened. My warcraft isn't downloaded or cracked. Now that you're asking that, me and my friends exchanged our cd-keys accidently, and one of them isn't playing anymore, and the cd-key I'm using might be the same as his, but I don't know. Could it be that ? Oh, and before opening this thread, I went ask Blizzard's technical support to help me, and they told me to install something that would stop it, but it didn't work. And I never used OllyDbg :S

  7. #17
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    LoL. What did blizzard have you install? Are you using windows or XP? Have you reinstalled warcraft since you installed whatever it was that blizzard had you run?

  8. #18
    Chaos_Nick_1's Avatar
    Chaos_Nick_1 is offline Addict
    Array
    Join Date
    Feb 2008
    Location
    Montreal, Verdun
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    Well Blizzard had me install registring things... I'm not exactly sure lol. There's one of those thing taht's named "soundmax.reg" and the other one "war3.reg" (I'm sure that doesn't help you a lot, but whatever ...). Both add informations to a register ... No clue what it is .. lol .. I feel noob xD. And hmm ... I have .. Windows XP ? Lol ..

  9. #19
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    Okay, well here's a patch if you want to try it. It simply NOP's that line that is giving you problems. Here's the entire code for the program too if you want to compile it yourself in C#!

    Code:
    using System;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.Threading;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Simple Patch v0.0 by Wynthar\nVisit www.D3Scene.com\n\nSearching for Warcraft 3 ...");
                bool detected = false;
                while (!detected)
                {
                    try
                    {
                        PatchWar3();
                        detected = true;
                    }
                    catch
                    {
                    }
                    Thread.Sleep(1000);
                }
                Console.WriteLine("Offset Patched. Goodbye.");
            }
    
            private static void PatchWar3()
            {
                Init();
    
                byte[] patch = new byte[] { 0x90, 0x90, 0x90 };
                uint offset = 0x005056AC;
                IntPtr writeAddress = new IntPtr(offset + gamedll);
                int bytesWritten;
                WriteProcessMemory(Warcraft3ProcessHandle, writeAddress, patch, (uint)patch.Length, out bytesWritten);
            }
    
            private static void Init()
            {
                War3 = GetWar3Process();
                if (War3 == null) throw new Exception("Open War3");
                War3Mod = GetWar3Module();
                EnableDebug();
                Warcraft3ProcessHandle = OpenProcess(ProcessAccessFlags.All, false, (uint)War3.Id);
                gamedll = (uint)War3Mod.BaseAddress.ToInt32();
            }
    
            #region Private Helper Methods
    
            static private void EnableDebug()
            {
                LUID luid = new LUID();
                TOKEN_PRIVILEGES tkp = new TOKEN_PRIVILEGES();
    
                IntPtr PHandle = OpenProcess(ProcessAccessFlags.All, false, (uint)Process.GetCurrentProcess().Id);
                IntPtr tHandle = IntPtr.Zero;
                OpenProcessToken(PHandle, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, out tHandle);
    
                LookupPrivilegeValue(null, "SeDebugPrivilege", out luid);
    
                tkp.Luid = luid;
                tkp.PrivilegeCount = 1;
                tkp.Attributes = SE_PRIVILEGE_ENABLED;
                unsafe
                {
                    uint sz = (uint)sizeof(TOKEN_PRIVILEGES);
                    AdjustTokenPrivileges(tHandle, false, ref tkp, sz, IntPtr.Zero, IntPtr.Zero);
                }
                CloseHandle(tHandle);
            }
    
            static private ProcessModule GetWar3Module()
            {
                ProcessModule war3Mod = null;
                foreach (ProcessModule pm in War3.Modules)
                {
                    if (pm.ModuleName != "Game.dll") continue;
                    war3Mod = pm;
                }
                if (war3Mod == null) { throw new Exception("Problem"); }
                return war3Mod;
            }
    
            static private Process GetWar3Process()
            {
                Process[] war3 = Process.GetProcessesByName("war3");
                if (war3.Length == 0) return null;
                return war3[0];
            }
    
            #endregion
    
            #region Private Vars
    
            static Process War3;
            static ProcessModule War3Mod;
            static IntPtr Warcraft3ProcessHandle;
            public static uint gamedll;
    
            #endregion
    
            #region DLL Stuff
    
            #region DLL Imports
    
            [DllImport("kernel32.dll")]
            static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
    
            [DllImport("kernel32.dll")]
            static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, bool bInheritHandle, int dwProcessId);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            static extern IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID);
    
            [DllImport("kernel32.dll")]
            static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out int lpNumberOfBytesWritten);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out()] byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead);
    
            [DllImport("user32.dll", SetLastError = true)]
            static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
    
            [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
            [DllImport("advapi32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle);
    
    
            [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, out LUID lpLuid);
    
            [DllImport("advapi32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool AdjustTokenPrivileges(IntPtr TokenHandle, [MarshalAs(UnmanagedType.Bool)]bool DisableAllPrivileges, ref TOKEN_PRIVILEGES NewState, UInt32 Zero, IntPtr Null1, IntPtr Null2);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool CloseHandle(IntPtr hObject);
    
            #endregion
    
            #region DLL Vars
    
            public const UInt32 SE_PRIVILEGE_ENABLED = 0x00000002;
            public const UInt32 TOKEN_QUERY = 0x0008;
            public const UInt32 TOKEN_ADJUST_PRIVILEGES = 0x0020;
    
            #endregion
    
            #region DLL Structs
    
            [StructLayout(LayoutKind.Sequential)]
            public struct LUID
            {
                public UInt32 LowPart;
                public Int32 HighPart;
            }
    
            [StructLayout(LayoutKind.Sequential)]
            public struct TOKEN_PRIVILEGES
            {
                public UInt32 PrivilegeCount;
                public LUID Luid;
                public UInt32 Attributes;
            }
    
            #endregion
    
            #region DLL Flags
    
            [Flags]
            public enum ProcessAccessFlags : uint
            {
                All = 0x001F0FFF,
                Terminate = 0x00000001,
                CreateThread = 0x00000002,
                VMOperation = 0x00000008,
                VMRead = 0x00000010,
                VMWrite = 0x00000020,
                DupHandle = 0x00000040,
                SetInformation = 0x00000200,
                QueryInformation = 0x00000400,
                Synchronize = 0x00100000
            }
    
    
    
            [Flags]
            public enum SnapshotFlags : uint
            {
                HeapList = 0x00000001,
                Process = 0x00000002,
                Thread = 0x00000004,
                Module = 0x00000008,
                Module32 = 0x00000010,
                Inherit = 0x80000000,
                All = 0x0000001F
            }
    
            #endregion
    
            #endregion
    
        }
    }
    Attached Files

  10. The Following User Says Thank You to Wynthar For This Useful Post:


  11. #20
    risker is offline Banned User Array
    Join Date
    Oct 2008
    Location
    Australia
    Posts
    2,734
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    673
    Quote Originally Posted by Wynthar View Post
    Okay, well here's a patch if you want to try it. It simply NOP's that line that is giving you problems. Here's the entire code for the program too if you want to compile it yourself in C#!

    Code:
    using System;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.Threading;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Simple Patch v0.0 by Wynthar\nVisit www.D3Scene.com\n\nSearching for Warcraft 3 ...");
                bool detected = false;
                while (!detected)
                {
                    try
                    {
                        PatchWar3();
                        detected = true;
                    }
                    catch
                    {
                    }
                    Thread.Sleep(1000);
                }
                Console.WriteLine("Offset Patched. Goodbye.");
            }
    
            private static void PatchWar3()
            {
                Init();
    
                byte[] patch = new byte[] { 0x90, 0x90, 0x90 };
                uint offset = 0x005056AC;
                IntPtr writeAddress = new IntPtr(offset + gamedll);
                int bytesWritten;
                WriteProcessMemory(Warcraft3ProcessHandle, writeAddress, patch, (uint)patch.Length, out bytesWritten);
            }
    
            private static void Init()
            {
                War3 = GetWar3Process();
                if (War3 == null) throw new Exception("Open War3");
                War3Mod = GetWar3Module();
                EnableDebug();
                Warcraft3ProcessHandle = OpenProcess(ProcessAccessFlags.All, false, (uint)War3.Id);
                gamedll = (uint)War3Mod.BaseAddress.ToInt32();
            }
    
            #region Private Helper Methods
    
            static private void EnableDebug()
            {
                LUID luid = new LUID();
                TOKEN_PRIVILEGES tkp = new TOKEN_PRIVILEGES();
    
                IntPtr PHandle = OpenProcess(ProcessAccessFlags.All, false, (uint)Process.GetCurrentProcess().Id);
                IntPtr tHandle = IntPtr.Zero;
                OpenProcessToken(PHandle, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, out tHandle);
    
                LookupPrivilegeValue(null, "SeDebugPrivilege", out luid);
    
                tkp.Luid = luid;
                tkp.PrivilegeCount = 1;
                tkp.Attributes = SE_PRIVILEGE_ENABLED;
                unsafe
                {
                    uint sz = (uint)sizeof(TOKEN_PRIVILEGES);
                    AdjustTokenPrivileges(tHandle, false, ref tkp, sz, IntPtr.Zero, IntPtr.Zero);
                }
                CloseHandle(tHandle);
            }
    
            static private ProcessModule GetWar3Module()
            {
                ProcessModule war3Mod = null;
                foreach (ProcessModule pm in War3.Modules)
                {
                    if (pm.ModuleName != "Game.dll") continue;
                    war3Mod = pm;
                }
                if (war3Mod == null) { throw new Exception("Problem"); }
                return war3Mod;
            }
    
            static private Process GetWar3Process()
            {
                Process[] war3 = Process.GetProcessesByName("war3");
                if (war3.Length == 0) return null;
                return war3[0];
            }
    
            #endregion
    
            #region Private Vars
    
            static Process War3;
            static ProcessModule War3Mod;
            static IntPtr Warcraft3ProcessHandle;
            public static uint gamedll;
    
            #endregion
    
            #region DLL Stuff
    
            #region DLL Imports
    
            [DllImport("kernel32.dll")]
            static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
    
            [DllImport("kernel32.dll")]
            static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, bool bInheritHandle, int dwProcessId);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            static extern IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID);
    
            [DllImport("kernel32.dll")]
            static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out int lpNumberOfBytesWritten);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out()] byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead);
    
            [DllImport("user32.dll", SetLastError = true)]
            static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
    
            [DllImport("user32.dll", SetLastError = true)]
            static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
            [DllImport("advapi32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle);
    
    
            [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, out LUID lpLuid);
    
            [DllImport("advapi32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool AdjustTokenPrivileges(IntPtr TokenHandle, [MarshalAs(UnmanagedType.Bool)]bool DisableAllPrivileges, ref TOKEN_PRIVILEGES NewState, UInt32 Zero, IntPtr Null1, IntPtr Null2);
    
            [DllImport("kernel32.dll", SetLastError = true)]
            [return: MarshalAs(UnmanagedType.Bool)]
            static extern bool CloseHandle(IntPtr hObject);
    
            #endregion
    
            #region DLL Vars
    
            public const UInt32 SE_PRIVILEGE_ENABLED = 0x00000002;
            public const UInt32 TOKEN_QUERY = 0x0008;
            public const UInt32 TOKEN_ADJUST_PRIVILEGES = 0x0020;
    
            #endregion
    
            #region DLL Structs
    
            [StructLayout(LayoutKind.Sequential)]
            public struct LUID
            {
                public UInt32 LowPart;
                public Int32 HighPart;
            }
    
            [StructLayout(LayoutKind.Sequential)]
            public struct TOKEN_PRIVILEGES
            {
                public UInt32 PrivilegeCount;
                public LUID Luid;
                public UInt32 Attributes;
            }
    
            #endregion
    
            #region DLL Flags
    
            [Flags]
            public enum ProcessAccessFlags : uint
            {
                All = 0x001F0FFF,
                Terminate = 0x00000001,
                CreateThread = 0x00000002,
                VMOperation = 0x00000008,
                VMRead = 0x00000010,
                VMWrite = 0x00000020,
                DupHandle = 0x00000040,
                SetInformation = 0x00000200,
                QueryInformation = 0x00000400,
                Synchronize = 0x00100000
            }
    
    
    
            [Flags]
            public enum SnapshotFlags : uint
            {
                HeapList = 0x00000001,
                Process = 0x00000002,
                Thread = 0x00000004,
                Module = 0x00000008,
                Module32 = 0x00000010,
                Inherit = 0x80000000,
                All = 0x0000001F
            }
    
            #endregion
    
            #endregion
    
        }
    }
    Nice !
    Very helpful Wynthar

    +Rep

Page 2 of 9 FirstFirst 1234 ... LastLast

Similar Threads

  1. Warcraft 3 Fatal Error (FUCKING TIRED OF IT)
    By Chaos_Nick_1 in forum Warcraft 3 forum
    Replies: 42
    Last Post: 03-08-2009, 01:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •