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. Kernel32.dll

Kernel32.dll

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 3 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.
  • H Offline
    H Offline
    hph
    wrote on last edited by
    #1

    i have no more ideas, i lodge! Here's what i want to do: Every time the kernel32.dll is loaded, it should load a arbitrary dll, which then should create a log file to capture the name and the process id of the process which has loaded the kernel32.dll (and so the injected dll). Here's a brief summary of what my code does: It searches for the section which can be executed, copies my code to the end of this section and changes the entry point in order to jump to my code, and after my code has been executed (and the dll has been loaded - which only should happen if the dllmain retrieves DLL_PROCESS_DETACH) it jumps back to the original entry point (which has been saved before). The difference between a normal dll and the kernel32.dll is the calculation of the address of the LoadLibraryA function! I have tried this whole thing with Windows 98, and if someone now says that i am crazy and the stuff mentioned before won't work, even not if a miracle happens, i can say you are wrong. Windows 98 executes my infected kernel32.dll like it does with the original one, without a sinlge error. And YES, my code is executed too, BUT and that's my problem, the injected code doesn't load the DLL, and I DON'T KNOW WHY!!!!!!!!!!!! Can someone help me ? Thanks in advance!

    D A 2 Replies Last reply
    0
    • H hph

      i have no more ideas, i lodge! Here's what i want to do: Every time the kernel32.dll is loaded, it should load a arbitrary dll, which then should create a log file to capture the name and the process id of the process which has loaded the kernel32.dll (and so the injected dll). Here's a brief summary of what my code does: It searches for the section which can be executed, copies my code to the end of this section and changes the entry point in order to jump to my code, and after my code has been executed (and the dll has been loaded - which only should happen if the dllmain retrieves DLL_PROCESS_DETACH) it jumps back to the original entry point (which has been saved before). The difference between a normal dll and the kernel32.dll is the calculation of the address of the LoadLibraryA function! I have tried this whole thing with Windows 98, and if someone now says that i am crazy and the stuff mentioned before won't work, even not if a miracle happens, i can say you are wrong. Windows 98 executes my infected kernel32.dll like it does with the original one, without a sinlge error. And YES, my code is executed too, BUT and that's my problem, the injected code doesn't load the DLL, and I DON'T KNOW WHY!!!!!!!!!!!! Can someone help me ? Thanks in advance!

      D Offline
      D Offline
      Daniel1324
      wrote on last edited by
      #2

      Sounds like a virus.

      H 1 Reply Last reply
      0
      • D Daniel1324

        Sounds like a virus.

        H Offline
        H Offline
        hph
        wrote on last edited by
        #3

        Thanks for your help!

        D 1 Reply Last reply
        0
        • H hph

          Thanks for your help!

          D Offline
          D Offline
          Daniel1324
          wrote on last edited by
          #4

          Welcome!

          1 Reply Last reply
          0
          • H hph

            i have no more ideas, i lodge! Here's what i want to do: Every time the kernel32.dll is loaded, it should load a arbitrary dll, which then should create a log file to capture the name and the process id of the process which has loaded the kernel32.dll (and so the injected dll). Here's a brief summary of what my code does: It searches for the section which can be executed, copies my code to the end of this section and changes the entry point in order to jump to my code, and after my code has been executed (and the dll has been loaded - which only should happen if the dllmain retrieves DLL_PROCESS_DETACH) it jumps back to the original entry point (which has been saved before). The difference between a normal dll and the kernel32.dll is the calculation of the address of the LoadLibraryA function! I have tried this whole thing with Windows 98, and if someone now says that i am crazy and the stuff mentioned before won't work, even not if a miracle happens, i can say you are wrong. Windows 98 executes my infected kernel32.dll like it does with the original one, without a sinlge error. And YES, my code is executed too, BUT and that's my problem, the injected code doesn't load the DLL, and I DON'T KNOW WHY!!!!!!!!!!!! Can someone help me ? Thanks in advance!

            A Offline
            A Offline
            Anand Paranjpe
            wrote on last edited by
            #5

            I hope u have gone through article below: "Three Ways to Inject Your Code into Another Process" By Robert Kuster The chosen One :)

            H 1 Reply Last reply
            0
            • A Anand Paranjpe

              I hope u have gone through article below: "Three Ways to Inject Your Code into Another Process" By Robert Kuster The chosen One :)

              H Offline
              H Offline
              hph
              wrote on last edited by
              #6

              Yes, i did! But my problem is that the LoadLibraryA function doesn't load the dll!!

              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