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. Embed - Assembly VC++

Embed - Assembly VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 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.
  • S Offline
    S Offline
    Sameer Maggon
    wrote on last edited by
    #1

    Hi, I have a small problem, a question - don't know whether possible or not. I have an application (MFC) in VC++, i want to change the execution of that application. I want that whenever my Windows machine runs that appl, on start of the application, I place a Long jump to a position from where my actual code is executed. (I want a 16 byte empty space) at the begining of the file (but some fixed sized code can occur before that 16 byte) Can nebody help Sameer

    J 1 Reply Last reply
    0
    • S Sameer Maggon

      Hi, I have a small problem, a question - don't know whether possible or not. I have an application (MFC) in VC++, i want to change the execution of that application. I want that whenever my Windows machine runs that appl, on start of the application, I place a Long jump to a position from where my actual code is executed. (I want a 16 byte empty space) at the begining of the file (but some fixed sized code can occur before that 16 byte) Can nebody help Sameer

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Something like this:

      int main(void)
      {
      goto end_nop_block;

      __asm{
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      nop
      }

      end_nop_block:

      ...
      }

      Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      S 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        Something like this:

        int main(void)
        {
        goto end_nop_block;

        __asm{
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        }

        end_nop_block:

        ...
        }

        Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        S Offline
        S Offline
        Sameer Maggon
        wrote on last edited by
        #3

        Thanx but actually i'll tell you the whole story... I have a pogram that takes offset as an input and write 16 bytes of data (character) to the .exe file (like we do in HexDump or neother thing). So now i want that whenever i compile my .exe the 16 bytes are free at the same offset, so that i can write my own data there. like if i define char array[16]; So i have to write on this 16 byte Manually what i am doing is, i am assigning some value to this 16 byte initially and when the program is compiled, i open up my HEX editor and search for this string and write what i want to write. So, did you understand what i mean, and is this possible Thanx again Sameer

        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