- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Edit Binary Files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 09:53 PM
03-04-2004 09:53 PM
Edit Binary Files
I just want play around with these files by modifying them.
Thanks,
Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 09:59 PM
03-04-2004 09:59 PM
Re: Edit Binary Files
Boy, am I glad you don't work on my systems!
;^)
Seriously, I'm unaware of such a tool (though there may well be one) and I would have to question the wisdom of doing such a thing anyway. I think you would be better off to follow the conventional methods.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:04 PM
03-04-2004 10:04 PM
Re: Edit Binary Files
why not alter the kernel while you are at it.. I would try it on other files.
Gideon
PS. A collegeu of mine did it with Perl, but i do not know how.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:07 PM
03-04-2004 10:07 PM
Re: Edit Binary Files
Like all above, you don't want to mess arround with these files by just filling in some data.
Or do you like to simulate system crashes.
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:09 PM
03-04-2004 10:09 PM
Re: Edit Binary Files
Don't worry .. I have no plans as of now to work for "Holstein Association, Inc" .. :-)) ..
I have got few test machines where I can afford to perform these kind of destructive things ...
Well, the reason why I need to edit the cmclconfig is to change the lock device path when the cluster is running (In a huge SAN env. the device files may change and it is not possible to update the cluster unless otherwise you stop the cluster and do a cmquery and cmapplyconf). I am not sure this way if it will work or not but no harm in giving it a try ..
Thanks,
Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:23 PM
03-04-2004 10:23 PM
Re: Edit Binary Files
same discussion in the past,
#vis -n /etc/lvmtab >/tmp/outfile
Make changes to outfile
#inv -n /tmp/outfile >/tmp/binaryoutfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:35 PM
03-04-2004 10:35 PM
Re: Edit Binary Files
You can use any hex editor, several of them exist even some versions of "vi" will do it.
I belive GXedit does too and this is available here
http://hpux.connect.org.uk/hppd/hpux/Editors/GXedit-1.23/
Careful now though Karthik :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:37 PM
03-04-2004 10:37 PM
Re: Edit Binary Files
That was a good command .. using that I recreated the lvmtab by changing the device file names for some VG. When tried any VG related commands it throws the following error,
The version of /etc/lvmtab file is not correct.
Remove /etc/lvmtab file and execute vgscan command to recreate the file.
vgdisplay: No volume group name could be read from "/etc/lvmtab".
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 10:41 PM
03-04-2004 10:41 PM
Re: Edit Binary Files
So, you want to change the lock device path on the fly, while the cluster is running? The repercussions from that are absolutely scary to even contemplate.
Make absolutely sure that you are doing this within your test environment. I think most of us have at least one incident in our past where we "thought" we were on the test machine . . .
Good luck,
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 11:02 PM
03-04-2004 11:02 PM
Re: Edit Binary Files
Still I think it's dangerous.
Goodluck,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2004 11:14 PM
03-04-2004 11:14 PM
Re: Edit Binary Files
Thanks,
Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2004 12:56 AM
03-05-2004 12:56 AM
Re: Edit Binary Files
For the fun only - I won't edit such a file
on a prod system-
# xd toto
0000000 0000 0000 0000 0000 0000 0000 0000 0000
0000010 0000 0001 0000 0000 0000 0000 0000 0000
0000020 0000 0000 0000 0000 0000 0000 0000 0000
*
0000100 0000 0010 0000 0000 0000 0000 0000 0000
0000110 0000 0000 0000 0000 0000 0000 0000 0000
0000120 0000 0002
0000124
# adb -w toto
PA-32 adb ($h help $q quit)
adb>10?W 10000
10: 1 = 10000
adb>140?W 2
140: = 2
# xd toto
0000000 0000 0000 0000 0000 0000 0000 0000 0000
0000010 0001 0000 0000 0000 0000 0000 0000 0000
0000020 0000 0000 0000 0000 0000 0000 0000 0000
*
0000100 0000 0010 0000 0000 0000 0000 0000 0000
0000110 0000 0000 0000 0000 0000 0000 0000 0000
0000120 0000 0002 0000 0000 0000 0000 0000 0000
0000130 0000 0000 0000 0000 0000 0000 0000 0000
0000140 0000 0002
0000144
adb>100,3?4Xa
100: 10 0 0 0
110: 0 0 0 0
120: 2 0 0 0
by default adb uses hexadecimal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2004 01:58 AM
03-05-2004 01:58 AM
Re: Edit Binary Files
http://hpux.connect.org.uk/hppd/hpux/Development/Tools/hexedit-0.9.7/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2004 01:58 PM
03-05-2004 01:58 PM
Re: Edit Binary Files
Now in perl it is relatively easy to construct any funky byte pattern through the 'pack' function. Here is an example to replace 'short' in lvmtab on line 0000400:
$ xd /etc/lvmtab | grep 0000400
0000400 0000 0000 0000 0000 0000 0000 b65a 8e24
$ cat zap
#!/bin/perl
while (<>){
$old = pack("S",0xb65a );
$new = pack("S",0x0123 );
s/$old/$new/;
print;
}
$ zap < /etc/lvmtab > x
$ xd x | grep 0000400
0000400 0000 0000 0000 0000 0000 0000 0123 8e24
$ ls -l x /etc/lvmtab
-rw------- 1 root sys 2094 Jul 22 2003 /etc/lvmtab
-rw-r--r-- 1 root sys 2094 Mar 5 21:53 x
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2004 07:07 PM
03-05-2004 07:07 PM
Re: Edit Binary Files
you can also ftp file to pc and use editor like ultraedit.
remember: only softies use sam for kernel rebuild. Real mean do use a hexeditor. ;-)
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 07:33 PM
03-07-2004 07:33 PM
Re: Edit Binary Files
I was able to edit the cmclconfig file and do some changes to the cluster lock PV but as expected the changes were not reflected to the running cluster. I have identified (with ITRC help) few work arounds for this problem and I have posted them at,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=493491
Pl. have a look and respond .. I am waiting for your inputs on this :-)
Thanks,
KarthiK S S