PDA

View Full Version : God Bless Hex Editors !!



n2ize
10-11-2016, 06:56 PM
I run a flight simulator on Linux called "FlightGear". Normally I have it set to download METAR data so as I fly from one region to another it automatically downloads the METAR data so that I get real weather conditions. Recently the real weather feature stopped working giving the error "Cannot Find METAR Data". As it turns out NOAA.gov changed the URL for the location of the METAR files to a new URL. To make matters worst instead of having the URL in a configuration file the URL is hardcoded into the main executable file as well as an executable that is called from the main executable. Rather than download a new version or, downloading the source code and recompiling I decided to edit the executable binaries directly. I opened the executables in a hex editor, located the URL and changed it in the executable to the new URL, saved the edited binary files and replaced them in the run directory. The result...viola',my real weather is working perfectly again. Thank God for hex editors...they saved the day.

Incidentally the hex editor I used is called "GHex" a GNOME hex editor but it works just as well under KDE.

Of course the real question is why flightgear developers chose to hard code the URL into the executable binary files.It would make life easier if they set it up to be read from a config file. Particularly since it is not uncommon for URL's to change from time to time. Well, in any event it worked and I have my real weather back again.

KD8TUT
10-11-2016, 11:03 PM
Of course the real question is why flightgear developers chose to hard code the URL into the executable binary files.It would make life easier if they set it up to be read from a config file. Particularly since it is not uncommon for URL's to change from time to time. Well, in any event it worked and I have my real weather back again.

Maybe the programmer was an older person? That used to be pretty standard.

XE1/N5AL
10-11-2016, 11:42 PM
A few years ago, my Mother in Law bought a Sharp brand television, from a Sears store here in Mexico. Like most modern models it is Internet-enabled, with one button access to popular content providers, such as Netflix. The only problem is that these buttons are set for the United States websites of these content providers. These "hard-coded" URLs can't be reprogrammed to their Mexican counterparts (i.e., from "www.netflix.com" to "www.netflix.com.mx").

So, the convenient television Internet connectivity feature is totally useless: the content providers reject an account log-in arriving from the wrong region. Either Sharp goofed up with their product, or Sears was mistakenly importing the U.S. version of the television into Mexico.

n2ize
10-12-2016, 11:27 AM
Maybe the programmer was an older person? That used to be pretty standard.
Mostly young guys writing this stuff these days. Then again s project as extensive as FG has a large group of people writing and editing,adding/contributing features,etc. Maybe the guy who wrote this part of the software was an older person.So yeah you may be right. Hmmm...if I download the source code I can probably figure out how to get it to pull the URL from a config file.

n2ize
10-12-2016, 11:39 AM
A few years ago, my Mother in Law bought a Sharp brand television, from a Sears store here in Mexico. Like most modern models it is Internet-enabled, with one button access to popular content providers, such as Netflix. The only problem is that these buttons are set for the United States websites of these content providers. These "hard-coded" URLs can't be reprogrammed to their Mexican counterparts (i.e., from "www.netflix.com" to "www.netflix.com.mx").

So, the convenient television Internet connectivity feature is totally useless: the content providers reject an account log-in arriving from the wrong region. Either Sharp goofed up with their product, or Sears was mistakenly importing the U.S. version of the television into Mexico.
Interesting. Sounds like someone goofed. Maybe there is a way to hack into those things and change it but I sure wouldn't know where to begin.

XE1/N5AL
10-12-2016, 08:59 PM
Interesting. Sounds like someone goofed. Maybe there is a way to hack into those things and change it but I sure wouldn't know where to begin.

Since the TV can download new firmware over a WiFi connection, I was hoping that Sharp would issue an update to fix the problem. Alas, no fixes ever surfaced. After a few months had passed, Sharp had already abandoned this model and moved on to their next generation of televisions. The product life cycle of a new consumer electronic gadget can be so short!

KD8TUT
10-12-2016, 09:53 PM
Mostly young guys writing this stuff these days. Then again s project as extensive as FG has a large group of people writing and editing,adding/contributing features,etc. Maybe the guy who wrote this part of the software was an older person.So yeah you may be right. Hmmm...if I download the source code I can probably figure out how to get it to pull the URL from a config file.

Be sure to contribute the code change back to them :)

n2ize
10-13-2016, 12:26 AM
Be sure to contribute the code change back to them :)

Definitely will. But first thing is to see if it hasn't already been changed in newer versions.