The official way to get a Syrian visa is in your home country or at their embassy in Ankara, Turkey. The only issue is you will likely have to make a detour up to Ankara as a more common and scenic route would have you riding across the lower half of Turkey and Ankara isn't on your route.
A few people the last couple of years have been just showing up at the Turkey/Syria border and receiving their visa there. I haven't heard of anyone being turned back and having to ride back to Ankara, but until you get it there is that nagging fear in the back of your mind. Depends on your preferred approach, but if you can get it ahead of time probably would give you more piece of mind.
In regards to Sudan, ahead of time seems to be a crap shoot. Some have waited months to no avail. In Cairo the standard dance is to show up at the embassy and look forlorn. It depends on their mood, but visas can be issued within a day or two, but can also take up to a couple of weeks. A loose average would be about a week. This if course plays havoc with your ability to catch the once a week boat out of Aswan. So if you can get it ahead of time, even better. Hope that helps