Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




5 posts

Wannabe Geek


Topic # 228872 26-Jan-2018 14:17
Send private message quote this post

Hi

 

I'm trying to modify hex code in a file that shows a date in a program.
I cannot figure out the code:

 

a5 c6 = 2017/04/05

 

3e c8 = 2017/08/14

 

7b c9 = 2017/11/31

 

 

 

What would be the hex code to display 2017/12/14

 

Any help greatly appreciated


Filter this topic showing only the reply marked as answer Create new topic
6448 posts

Uber Geek
+1 received by user: 3051

Subscriber

  Reply # 1947204 26-Jan-2018 15:11
Send private message quote this post

Your dates don't make sense. Assuming the last figure is the day, and the one before is the month, there are not 31 days in November so the date is impossible. It doesn't work the other way either, since there are not 14 months.

 

 





I reject your reality and substitute my own. - Adam Savage
 




5 posts

Wannabe Geek


  Reply # 1947216 26-Jan-2018 15:49
Send private message quote this post

Correct the date format is indeed YYYY/MM/DD

The 7b c9 was the result of me changing the code and the software displaying 2017/11/31

7a c9 would indeed show 2017/11/30

 
 
 
 


1422 posts

Uber Geek
+1 received by user: 168


  Reply # 1947218 26-Jan-2018 15:52
Send private message quote this post

Can you post the results of some sequential dates eg

 

2017/04/01

 

2017/04/02

 

2017/04/03

 

etc


1285 posts

Uber Geek
+1 received by user: 107




5 posts

Wannabe Geek


  Reply # 1947230 26-Jan-2018 16:13
Send private message quote this post

MurrayM

Ive had a read on a few posts from that google search but unfortunately it's way over my head! Anyway you could help out to give me the hex values to display 2017/12/14

401 posts

Ultimate Geek
+1 received by user: 51


  Reply # 1947233 26-Jan-2018 16:30
Send private message quote this post

Youre going to need to give us some more examples/data so we can reverse engineer the formula.

 

I'm going to guess that 5 bits store the day (32 values possible with 5 bits). 4 bits for the month.  You then have 7 bits left over for the year.  There'd be some epoc date/year for this too.  1950 maybe (you have up to 127 years you could store).  Could be 1970. Could be something else entirely.

 

We know its not storing days since an epoc date and using function to calculate the date from that.  Otherwise your single bit change would not have yielded an invalid date.  You could try incrementing a bit at a time and see what dates come out.  Probably find one or two more increments and either the month or the year would change (it may not be stored as day, month year.  Could be day, year, month or any combination of!)


6448 posts

Uber Geek
+1 received by user: 3051

Subscriber

  Reply # 1947238 26-Jan-2018 16:39
Send private message quote this post

This link might help you.





I reject your reality and substitute my own. - Adam Savage
 


300 posts

Ultimate Geek
+1 received by user: 122

Subscriber

  Reply # 1947246 26-Jan-2018 17:00
Send private message quote this post

Is this some date the program displays when it runs, or are you trying to change some property the program uses?




5 posts

Wannabe Geek


  Reply # 1947251 26-Jan-2018 17:08
Send private message quote this post

This is a date the program displays when it runs

401 posts

Ultimate Geek
+1 received by user: 51


  Reply # 1948013 29-Jan-2018 08:04
2 people support this post
Send private message quote this post

Did a little bit more experimenting....

 

If you're running Windows open your calculater and set it to programming mode.  Then type in the dates in YYYYMMDD format.

 

The values you gave us earlier then show these "decimal" to hex values:

 

2017/04/05 => 20170405 = 0x133C6A5

 

2017/08/14 => 20170814 = 0x133C83E

 

2017/11/31 => 20171131 = 0x133C97B

 

2017/11/30 => 20171130 = 0x133C97A

 

 

 

Those are the 4 dates you gave us with corresponding hex values.  Observe that the last two bytes are month and day values, with the bytes simply swapped.  I think your programme is storing the values as 4 bytes you've only been giving us the last two.

 

I would then guess your required value for 2017/12/14 is CEC9

 

Here's the working...

 

2017/12/14 => 20171214 => 0x133C9CE.  Take the last two bytes (C9CE) and swap them to CEC9




5 posts

Wannabe Geek


  Reply # 1948031 29-Jan-2018 09:15
Send private message quote this post

nzkc:

 

Did a little bit more experimenting....

 

If you're running Windows open your calculater and set it to programming mode.  Then type in the dates in YYYYMMDD format.

 

The values you gave us earlier then show these "decimal" to hex values:

 

2017/04/05 => 20170405 = 0x133C6A5

 

2017/08/14 => 20170814 = 0x133C83E

 

2017/11/31 => 20171131 = 0x133C97B

 

2017/11/30 => 20171130 = 0x133C97A

 

 

 

Those are the 4 dates you gave us with corresponding hex values.  Observe that the last two bytes are month and day values, with the bytes simply swapped.  I think your programme is storing the values as 4 bytes you've only been giving us the last two.

 

I would then guess your required value for 2017/12/14 is CEC9

 

Here's the working...

 

2017/12/14 => 20171214 => 0x133C9CE.  Take the last two bytes (C9CE) and swap them to CEC9

 

 

 

 

You are bang on nzkc, it worked!! I remember experimenting with first byte values with C9 but must not have made it up to CE!

 

Thank you very much for taking the time to figure that out it will be a huge help both now and in the future, if you were around Wellington I would gladly buy you a beer, cheers!


Filter this topic showing only the reply marked as answer Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

CPTPP text and National Interest Analysis released for public scrutiny
Posted 21-Feb-2018 19:43


Foodstuffs to trial digitised shopping trolleys
Posted 21-Feb-2018 18:27


2018: The year of zero-login, smart cars & the biometrics of things
Posted 21-Feb-2018 18:25


Intel reimagines data centre storage with new 3D NAND SSDs
Posted 16-Feb-2018 15:21


Ground-breaking business programme begins in Hamilton
Posted 16-Feb-2018 10:18


Government to continue search for first Chief Technology Officer
Posted 12-Feb-2018 20:30


Time to take Appleā€™s iPad Pro seriously
Posted 12-Feb-2018 16:54


New Fujifilm X-A5 brings selfie features to mirrorless camera
Posted 9-Feb-2018 09:12


D-Link ANZ expands connected smart home with new HD Wi-Fi cameras
Posted 9-Feb-2018 09:01


Dragon Professional for Mac V6: Near perfect dictation
Posted 9-Feb-2018 08:26


OPPO announces R11s with claims to be the picture perfect smartphone
Posted 2-Feb-2018 13:28


Vocus Communications wins a place on the TaaS panel
Posted 26-Jan-2018 15:16


SwipedOn raises $1 million capital
Posted 26-Jan-2018 15:15


Slingshot offers unlimited gigabit fibre for under a ton
Posted 25-Jan-2018 13:51


Spark doubles down on wireless broadband
Posted 24-Jan-2018 15:44



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.