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. Hello how to redirect the function's return address to your own function address?

Hello how to redirect the function's return address to your own function address?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • N Offline
    N Offline
    nah1337
    wrote on last edited by
    #1

    Any info example or link with tutorial is welcome i searched google and didnt find nothing good. I want to patch the call of the function so not do modify the original bytes of the function. I dunno if patching is same as redirection buth searched info for bouth didnt find anything. I want to redirect / patch a dll function return address to my addres ok thnx .

    T 1 Reply Last reply
    0
    • N nah1337

      Any info example or link with tutorial is welcome i searched google and didnt find nothing good. I want to patch the call of the function so not do modify the original bytes of the function. I dunno if patching is same as redirection buth searched info for bouth didnt find anything. I want to redirect / patch a dll function return address to my addres ok thnx .

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      I don't really get what you're trying to do. why don't you just get the original function's result, and add your calculation on its result then ?

      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      N 1 Reply Last reply
      0
      • T toxcct

        I don't really get what you're trying to do. why don't you just get the original function's result, and add your calculation on its result then ?

        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        N Offline
        N Offline
        nah1337
        wrote on last edited by
        #3

        Can ya do a example for me

        T N 2 Replies Last reply
        0
        • N nah1337

          Can ya do a example for me

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          nah1337 wrote:

          Can ya do a example for me

          you're kidding, right ?

          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          1 Reply Last reply
          0
          • N nah1337

            Can ya do a example for me

            N Offline
            N Offline
            nah1337
            wrote on last edited by
            #5

            No im not see this I want to redirect/ patch a call of the 10003DD7 function its addres is 0x0003DD7 and calls vsnprintf what addres is 0x0076533 int sub_10003DD7(char *Dest, size_t Count, char *Format, ...) { va_list va; // [sp+18h] [bp+10h]@1 int result; // eax@1 size_t v5; // esi@1 char *v6; // edi@1 va_start(va, Format); v5 = Count; v6 = Dest; result = _vsnprintf(Dest, Count, Format, va); v6[v5 - 1] = 0; return result; }

            B 1 Reply Last reply
            0
            • N nah1337

              No im not see this I want to redirect/ patch a call of the 10003DD7 function its addres is 0x0003DD7 and calls vsnprintf what addres is 0x0076533 int sub_10003DD7(char *Dest, size_t Count, char *Format, ...) { va_list va; // [sp+18h] [bp+10h]@1 int result; // eax@1 size_t v5; // esi@1 char *v6; // edi@1 va_start(va, Format); v5 = Count; v6 = Dest; result = _vsnprintf(Dest, Count, Format, va); v6[v5 - 1] = 0; return result; }

              B Offline
              B Offline
              Bram van Kampen
              wrote on last edited by
              #6

              I think your best bet is to look up Matt Pietreck's various books and articles. He does that soort of thing on a regular basis. :)

              Bram van Kampen

              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