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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Help needed !!!!

Help needed !!!!

Scheduled Pinned Locked Moved C#
helptutorial
2 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.
  • A Offline
    A Offline
    Ahmad Mahmoud candseeme
    wrote on last edited by
    #1

    Hi I want to know how to open an executable for reading like those hexeditors out there and how then i can jumb to specific offset and change it any help please !! Ahmad Shaban

    M 1 Reply Last reply
    0
    • A Ahmad Mahmoud candseeme

      Hi I want to know how to open an executable for reading like those hexeditors out there and how then i can jumb to specific offset and change it any help please !! Ahmad Shaban

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Hi! Try this code:

      FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.ReadWrite);
      BinaryReader br = new BinaryReader(fs);
      BinaryWriter bw = new BinaryWriter(fs);
      fs.Seek(123, SeekOrigin.Begin); // start reading with 123 bytes offset
      byte[] buf = br.ReadBytes(16);
      for (int i=0; i<buf.Length; i++)
      buf[i] ^= 128;
      fs.Seek(123, SeekOrigin.Begin);
      bw.Write(buf);
      bw.Close(); // the underlying stream is closed as well
      MessageBox.Show("Congratulations, you have ruined '"+filePath+"'!");

      ;) Regards, mav -- Black holes are the places where god divided by 0...

      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