| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 5:40 pm Post subject: hex editor question |
|
|
hello all
i have been playing with that hex editor that is in the explame folder my question is i see when you load a file its start at : 00000000 how can i chnages that is it would start like at 2000 then count. i also notice there is no colums up on top can that be added so you would have it start at 0? here is what i mean
| Code: |
0 1 2 3 4 5 6 7 8 9 A b c d e f
2000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
like that this way i could make a more powerfully serach button..can this be done? in colums like what i have?
edit - sorry about the explame the forum didn't show it right
[ Editted by moderator: Better this way? If so, use Notepad to align the text in the future. ]
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Apr 29, 2003 6:28 pm Post subject: |
|
|
The 00000000 that you see is the first 16 bytes of the file. To make it say the 2000 byte you would have to set the byte start location to 2000.
| Code: | %S = 0
binfile seek,1,%S |
Look for those lines in the example and change %S to 2000... I don't own a copy of VDS 4.5 and have never really used the BINFILE command but from what I can glean from the help file this should work for you. By changing the %S you are telling BINFILE to seek to BYTE 2000 in the file. If you want to change the display from hex to decimal you would need only to change this.
| Code: | List add,1,@Hex(%S,8)@tab()%D@tab()%T
|
to this below
| Code: | List add,1,%S@tab()%D@tab()%T
|
This change will show the decimal representation of the Hexadecimal byte offset in the file. Boy that was a mouth full  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 6:31 pm Post subject: |
|
|
mindpower
ahhhh kk i see what ya mean on the 2000....what about the having a row at the top like i was talking about? could that be done?
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 6:47 pm Post subject: |
|
|
right i thought of that but for a search/replace button how would you replace lets say 2002: 00 to 2002:01
humm i hope ya follow what i mean _________________ Have a nice day  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Apr 29, 2003 7:09 pm Post subject: |
|
|
tim,
Yes that can be done. You can add a item to the listbox before you view the file or just place a text box just above the listbox with the numbers and letters you want. If you put the line in the list box then you will have to freeze it at the top of the viewable part of the list box. Basicly everytime a user scrolls you would have to make this Item viewable by moving it in the list to the top most viewable item. You can use this API message to do this.
| Code: | | %A = @sendmsg(@win(~LIST1),$018E,0,0) |
This message is called LB_GETTOPINDEX and it will return the item number that is the top viewable item in the list box then insert the new item you want at that index. Naturally you would have to delete it from where it was before. I wish I had time to put together a little example for ya Anyway this method is alot harder than putting a text box above the list element  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Apr 29, 2003 7:14 pm Post subject: |
|
|
| tim6389 wrote: | right i thought of that but for a search/replace button how would you replace lets say 2002: 00 to 2002:01
humm i hope ya follow what i mean |
Just change %S to the byte offset of 2002 and call update again. This time it will move the file pointer to that particular byte and it will be Item 0 in the Listbox....or the first item in the list. This just select Item 0 in the list box for it to show up in the edit boxes at the bottom. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 7:19 pm Post subject: |
|
|
your first post i kind of follow you the second post yea i follow you on that BUT that will ony work if you have it defined..meaning a row at the top like what i was talking about.... _________________ Have a nice day  |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 7:23 pm Post subject: |
|
|
ohhhh yea that chnage it to 2000 works BUT when you chnage it to dec it changes the WHOLE line  _________________ Have a nice day  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Apr 29, 2003 7:26 pm Post subject: |
|
|
| tim6389 wrote: | | your first post i kind of follow you the second post yea i follow you on that BUT that will ony work if you have it defined..meaning a row at the top like what i was talking about.... |
You don't need to do anything but change %S and it will jump to that exact byte. You need to move %S out of the "Update" subroutine and place it before your "Evloop" this way your Search routine can change it as it wants to. The the user would only have to tell you the byte they want to start searching from in the file then call the update subroutine after the user has decided or allow the search routine start from the index that is choosen in the List box. If you want it to be more finely grained than this then you would really need a Grid element and not just a simple ListBox... The Hex numbers on the left hand side of the list is just showing you the byte number of the first byte in the middle column of the list box.
BTW have you ever worked with a Hex Editor before If not you might want to go and check out a few others and see how they work first. This is not the same as simply viewing a text file. You can actually mess up a Exe with a Hex editor. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 7:38 pm Post subject: |
|
|
i seee what ya mean on the %s
| Quote: |
BTW have you ever worked with a Hex Editor before If not you might want to go and check out a few others and see how they work first. This is not the same as simply viewing a text file. You can actually mess up a Exe with a Hex editor.
|
yes i have that is when i notice the vds didn't have the top row like the others ones out there..yup i messed up a few exe to
heheheheh _________________ Have a nice day  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Apr 29, 2003 7:54 pm Post subject: |
|
|
| tim6389 wrote: | yes i have that is when i notice the vds didn't have the top row like the others ones out there..yup i messed up a few exe to
heheheheh |
It really depends. If you want the Item like you Illustrated to always be a viewable Item in the ListBox then this would take a bit of coding to make happen. Basicly it would require you to keep moving that item to the top viewable location as the user scrolls through the list. It has to follow along with the Caret in the listbox... If you just wanted to have that line in the list box then that would be simple to do. Add these lines as the last lines in the update subroutine.
| Code: | List seek,list1,0
List insert,list1," "@tab() 0 1 2 3 4 5 6 7 8 9 A B C D E F@tab()
|
This will just insert the item and align it with the center row in the list box.
Oop forgot byte 9 in the item above...I always do that... _________________ Home of
Give VDS a new purpose!

Last edited by vdsalchemist on Tue Apr 29, 2003 8:15 pm; edited 1 time in total |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Apr 29, 2003 8:04 pm Post subject: |
|
|
yea i kind of figure that it would be alot of code to make the top row to be a colum to.... i will play with that you posted i have a few ideas i want to play with to
thanks mindpower for explaining it to me  _________________ Have a nice day  |
|
| Back to top |
|
 |
|