Top

mIRC Hex Editor


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.8 (of 4 scores)
Date Added  Jan 04, 2006
Last Updated  Jan 04, 2006
Tags  editor  hex 

Introduction

Please read the commented section of the code for more information.

Grab the Code

/*
mIRC Hex-Editor Snippet
Type /hex to start
 
Author Notes:
- Short hex editor snippet, which uses a basic mIRC window, the script
is actually pretty short, but with limited functionality
- Leave a comment behind, also contact at mknobbout@gmail.com
 
KNOWN BUGS:
- If the scroll bar is used the script will think you clicked on a different byte, so dont use the scroll button. Cannot find a decent way to disable this.
 
Side Notes:
- If you do not know what a hex editor is or does, this snippet is not for you!
- The snippet writes directly to the file
*/
 
alias hex {
  set %hex 0 34 22 @Hex-Editor $$sfile($mircdir $+ *.*,Hex Editor)
  xhex %hex
}
menu @Hex-Editor {
  dclick:{
    tokenize 32 %hex
    if ($mouse.y isnum 585-600) {
      if (($mouse.x isnum 0-85) && ($calc($1 - $2 * $3) > 0)) set %hex $calc($1 - $2 * $3) $2-
      elseif (($mouse.x isnum 90-140) && ($calc($1 + $2 * $3) <= $file($+(",$$5-,")))) set %hex $calc($1 + $2 * $3) $2-
      xhex %hex
    }
    var &hex, %x = $int($calc($int($calc(($mouse.x - 56) / 8)) / 3 - 1)), %y = $int($calc(($mouse.y - 22) / 16)), %byte = $calc($1 + $3 * %y + %x)
    if ((%x !isnum $+(0-,$calc($3 - 1))) || (%y !isnum $+(0-,$calc($2 - 1)))) return
    bread $+(",$$5-,") %byte 1 &hex
    var %write = $$input(Replace byte $+(',$$base($bvar(&hex,1),10,16,2),') at address $+(',$base(%byte,10,16,8),') with?,e,Replacement)
    if ($base(%write,16,10) isnum 0-255) {
      bset &hex 1 $v1
      bwrite $+(",$5-,") %byte 1 &hex
      xhex $1-
    }
    else return $input($base($v1,10,16,2) Erronomous Hex,o,error)
  }
}
alias xhex {
  ;/xhex <N (start of file)> <N (loop)> <N (length)> <Window Name> <File>
  if (!$window($4)) window -aCdfk0 +l $4 -1 -1 800 600 Fixedsys 9 | clear $4
  echo $4 $chr(2) $+ Double-Click on a byte to edit, $chr(3) $+ 02Addresses are Blue, $chr(3) $+ 01Bytes are Black, $chr(3) $+ 04ASCII is Red
  var &hex, %a = $1, %b = 1, %c = $+(",$$5-,")
  if (!$isfile(%c)) return
  while (%b <= $2) {
    if (%a <= $file(%c)) {
      .bread %c %a $3 &hex
      echo $4 $+($chr(3),02,$base(%a,10,16,8),$chr(3)) $asc2(&hex).hex $+($chr(3),04,$asc2(&hex).chr)
    }
    else echo $4 $chr(160)
    inc %a $3 | inc %b
  }
  :error
  echo $4 $str(-,17)
  echo $4 $+($chr(3),00,$chr(44),01<<Previous,$chr(3)) $+($chr(3),00,$chr(44),01Next>>,$chr(3))
}
alias asc2 {
  var %a = 1, %b, %c = $chr(160)
  while (%a <= $bvar($$1,0)) {
    %b = $iif($prop = hex,%b $base($bvar($1,%a),10,16,2),%b $+ $iif($chr($bvar($1,%a)),$iif($v1 = $chr(32) || $v1 = $chr(9),%c,$v1),%c))
    inc %a
  }
  return %b
}

Comments

  (7)  RSS
KuTsuM
Comments: 141
 
mIRC Snippet:  mIRC Hex Editor
Posted on Jan 5, 2006 3:03 pm
Awesome, Quickstep. I've been lookin for one too ;p
vampslim
Comments: 31
 
mIRC Snippet:  mIRC Hex Editor
Posted on Jan 9, 2006 5:39 pm
Gj QuickStep. V. nice dude.
gesy
Comments: 1
 
mIRC Snippet:  mIRC Hex Editor
Posted on Jan 17, 2006 12:58 am
is the best
Jordyboy
Comments: 21
 
mIRC Snippet:  mIRC Hex Editor
Posted on May 15, 2006 10:42 am
Hmm...
Vengeance
Comments: 27
 
mIRC Snippet:  mIRC Hex Editor
Posted on Sep 19, 2007 3:40 pm


Suggestion's

1. some thing ultra simple have the filename of the file your messing with is the @window title bar


2. Is there anyway you could add compare file's ( for snapshot's to make finding the changing data a little easier? )
By that I mean just checking for the differences

3. It seems to be adding lines... ( the one I use cygnus stops at
2030
but your's seems to skip lines

2024 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
203A 00 00 00 00 00 00
Vengeance
Comments: 27
 
mIRC Snippet:  mIRC Hex Editor
Posted on Sep 19, 2007 3:43 pm
other than that very very nice
keep up the good work
Relurk_
Comments: 15
 
mIRC Snippet:  mIRC Hex Editor
Posted on Nov 11, 2008 5:31 pm
this is awesome but will you make it so we can search stuff and convert words to hex

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom