Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetProcAddress returns wrong address for itself

GetProcAddress returns wrong address for itself

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FotisSs
    wrote on last edited by
    #1

    Hello everybody I have observed a strange behaviour in Win Vista and 7 when I call the GetProcAddress to resolve it self GetProcAddress(GetModuleHandle("kernel32.dll"),"GetProcAddress") returns wrong value. I compare the return value with the windbg and its way different (though in a valid 0x7000000-0x7ffffff range). I 've seen some reports on the web about it but I dont know how to overcome this problem. Any ideas? Thanx

    S 1 Reply Last reply
    0
    • F FotisSs

      Hello everybody I have observed a strange behaviour in Win Vista and 7 when I call the GetProcAddress to resolve it self GetProcAddress(GetModuleHandle("kernel32.dll"),"GetProcAddress") returns wrong value. I compare the return value with the windbg and its way different (though in a valid 0x7000000-0x7ffffff range). I 've seen some reports on the web about it but I dont know how to overcome this problem. Any ideas? Thanx

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      What addresses are you seeing? In the VS debugger, I see my program enter the same address (0x76E81202) that both &GetProcAddress and GetProcAddress(GetModuleHandle(L"kernel32.dll"),"GetProcAddress") return - this is under Windows 7 x64.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      F 1 Reply Last reply
      0
      • S Stuart Dootson

        What addresses are you seeing? In the VS debugger, I see my program enter the same address (0x76E81202) that both &GetProcAddress and GetProcAddress(GetModuleHandle(L"kernel32.dll"),"GetProcAddress") return - this is under Windows 7 x64.

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        F Offline
        F Offline
        FotisSs
        wrote on last edited by
        #3

        Attach the Windbg and look for GetProcAddress it should be a different one. In my case it points to GetProcAddressStub instead of GetProcAddress. In some other examples I tried involving dll injection the address is far more out of the kernel32.dll range

        F 1 Reply Last reply
        0
        • F FotisSs

          Attach the Windbg and look for GetProcAddress it should be a different one. In my case it points to GetProcAddressStub instead of GetProcAddress. In some other examples I tried involving dll injection the address is far more out of the kernel32.dll range

          F Offline
          F Offline
          FotisSs
          wrote on last edited by
          #4

          Ok I managed to narrow it down. You where right about .exe it works fine. BUT in case of a dll run by rundll32.exe things change and GetProcAddress returns always wrong

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups