Hello,
I have a binary file that is viewable with hex editors like Ultraedit. It has data of start and stop time in hex format of 3 bytes (hh, mm ,ss). I need to add a standard time of 12:56:28 to the start and stop times. The addition has to be made if the date value is 000000'H. While checking the date, if date is 000000'H, it has to converted into 090C1A'H and the times have to be added by 12:56:28 returning to Hex format. I found some logic but not able to proceed.
To find date, the date is always found between 88 03 and 93 data. FOr eg. 88 03 00 00 00 93. In this we need to change into 88 03 09 0C 1A 93. Similarly for start time the value is between 89 03 and 8A. For eg. 89 03 00 01 01 8A. We need to change into as 89 03 0D 39 1D 8A. Similar thing applied for stop time that is available between 8A 03 and 9F. Finally the file has to be saved into the original format.
I have some 6K records to be changed. Pls provide me the code to perform this process. I'm even ready to pay for it. Pls reply ASAP.
Re: Need help to find the logic and code using VB6
What you want should definitely be possible in VB6. It would probably take an experienced programmer an hour or two (to make sure they don't screw anything up, since editing binaries should be certainly correct). But, you might want to look at another language, say a flavor of C, if you're willing to pay for the work.
The time you enjoy wasting is not wasted time. Bertrand Russell
Re: Need help to find the logic and code using VB6
Hello jemidiah,
I have no problem in choosing the language. Am ready to pay for it. Pls let me know about the cost and the requirements for further processing. pl reach me in xpotentialram in google service of contacting. hope my contact is clear. If u have problem in understanding, let me know ur contact.
Re: Need help to find the logic and code using VB6
Originally Posted by duplexcom
Hello,
I have a binary file that is viewable with hex editors like Ultraedit. It has data of start and stop time in hex format of 3 bytes (hh, mm ,ss). I need to add a standard time of 12:56:28 to the start and stop times. The addition has to be made if the date value is 000000'H. While checking the date, if date is 000000'H, it has to converted into 090C1A'H and the times have to be added by 12:56:28 returning to Hex format. I found some logic but not able to proceed.
To find date, the date is always found between 88 03 and 93 data. FOr eg. 88 03 00 00 00 93. In this we need to change into 88 03 09 0C 1A 93. Similarly for start time the value is between 89 03 and 8A. For eg. 89 03 00 01 01 8A. We need to change into as 89 03 0D 39 1D 8A. Similar thing applied for stop time that is available between 8A 03 and 9F. Finally the file has to be saved into the original format.
I have some 6K records to be changed. Pls provide me the code to perform this process. I'm even ready to pay for it. Pls reply ASAP.
Are you trying to change someone's resources...????
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video) My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet Social Group:VBForums - Developers from India
Re: Need help to find the logic and code using VB6
Hi,
Due to a hardware problem, the date and time were resetted starting from 000000 for date and 00:00:00 for time. We need to change the date and time except changing the duration. Certainly we try to restore the original date and time.
Re: Need help to find the logic and code using VB6
Hi Duplexcom you have posted the same question on several forums.
I replied to you with this...
What happens when the added time rolls over to the next day? Do you then add a date of &H090C1B?
What do you have so far?
I think I would open the file as Binary and Get it into a byte array.
I would then cast the byte array directly to an ANSI (NOT unicode) string.
Once in string form I would then use InstrB() to search for the various sequences and MidB$() to make the replacements.
All the various sequences can be converted to ANSI string form by using byte arrays.
Once the changes are done the string would be cast back to an array and dumped to disk.
Make any sense to you?
Your reply appears to confirm that the date does have to roll over
<snip> when the final time exceeds beyond 23:59:59 the new date of 090C1B has be implemented.
Because of your responses so far it looks like you want someone to write this for you and you have no code of your own is this correct?
Can you post (one of) the binary file(s) in question.
Re: Need help to find the logic and code using VB6
Hi Milk,
I am not an expert in VB programming and i have used modified samples available in the internet. In this case also, i dont want to more time in coding and thus i expect help from professionals.
Find attached file. I was able to open it using Ultraedit's hex editor.
Re: Need help to find the logic and code using VB6
Originally Posted by jemidiah
What you want should definitely be possible in VB6. It would probably take an experienced programmer an hour or two (to make sure they don't screw anything up, since editing binaries should be certainly correct).
Not quite true. If, as he says, the string to look for is "always found between 88 03 and 93 data" and is 3 bytes long, then a simple search and replace for chr(88,03,00,00,00,93) (shortened rather than adding 6 CHRs there :-)) would do the job perfectly without causing any problems to the binary...AS LONG AS the binary is then saved properly and in exactly the same format as the file was loaded...doable easy enough using byte arrays and writing as binary/random. Even if the values aren't always 00/00/00 between 88/03 and 93 it's still easy enough to do a scan through the data and make the changes.
Where binary files should be CAREFULLY handled is when they are executables and you are modifying the actual working code within them rather than resource data from them...in this case, it looks like resource data is being modified and should be perfectly safe.
Also, although it probably doesn't matter in this case, you would be careful if the binary executable requires a certain hash value (used in protected EXEs where they'll only run if the data matches the hash value) as any change of bytes within will definitely change the hash for the file...as neither hash value or working code are a part of this, it's a simple task to do :-P
Originally Posted by duplexcom
and thus i expect help from professionals.
Assume he means "require" rather than "expect"...to expect help from people without paying them for it is going to get him nowhere :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Re: Need help to find the logic and code using VB6
Originally Posted by smUX
Not quite true.
Arguable . It usually takes longer to code something that one might think, which is why I made the estimate longer than you might expect.
Originally Posted by duplexcom
Hello jemidiah,
[...] Pls let me know about the cost and the requirements for further processing.
Sorry, I didn't mean to say that I'd be willing to write it. I just wanted to mention that if you have trouble finding a VB6 programmer doing it, you could look for another programmer. Since this is decently low-level (editing binary data) I suggested C and family.
The time you enjoy wasting is not wasted time. Bertrand Russell
Re: Need help to find the logic and code using VB6
Originally Posted by jemidiah
Arguable . It usually takes longer to code something that one might think, which is why I made the estimate longer than you might expect.
The "not quite true" is more to do with the difficulty and how careful you need to be with the binary data, as binary is just the same as any other data as long as you steer clear of editing the actual code, but I'd also say that it wouldn't take me an hour to write it so I am sure an experienced coder would take less time :-P
Originally Posted by jemidiah
Sorry, I didn't mean to say that I'd be willing to write it. I just wanted to mention that if you have trouble finding a VB6 programmer doing it, you could look for another programmer. Since this is decently low-level (editing binary data) I suggested C and family.
Editing binary, as I said before, is NOT low level. If it can be done in a *hex-editor* of all things, what makes any part of the C family of programming languages any better than VB for it? Hell, chuck me a copy of QBasic and *I* will write you the program in under an hour :-P
*ALL* a hex-editor does is change values for specific bytes in a file, it then saves it correctly to the hard drive to ensure it works as it should...using a simple get/put statement...this is not rocket science.
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Re: Need help to find the logic and code using VB6
Originally Posted by smUX
*ALL* a hex-editor does is change values for specific bytes in a file, it then saves it correctly to the hard drive to ensure it works as it should...using a simple get/put statement...this is not rocket science.
Yeah, I know what's required. How many VB programmers ever access binary data in a file? I suppose I was getting at the fact that C (type) programmers would have more experience doing low level manipulations, not that other languages are insufficient. Similarly you can multitask in VB6, but I'd *much* rather use another language. But I suppose a debate about language philosophy is unhelpful, so I'll stop.
The time you enjoy wasting is not wasted time. Bertrand Russell
Re: Need help to find the logic and code using VB6
I have done this more than a few times with data files from loggers. I am far more familiar with C++ than VB6 but I have always used VB for these types of projects. It is just plain quicker and easier, the code is much better to read and the bugs are far less obscure to find. Not to mention that you could do this in VB and still drink your VB (Victoria Bitter) at the same time. You only use C++ when it cannot possibly be done in VB.
Slower than a crippled Vista
More buggy than a fresh XP install
Look! Down the road, some 50 miles behind the drunken snail.
It's Ubuntu!