Author Topic: Refreshed MissionScanner Source Code  (Read 4101 times)

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1013
Refreshed MissionScanner Source Code
« on: October 25, 2019, 08:33:54 PM »
Back when I was working on the Outpost 2 wiki site, an old GUI written in Visual Basic (I think) was pretty useful. You can find it here: https://wiki.outpost2.net/doku.php?id=outpost_2:helper_programs:mission_scanner.

It depends on library dlls that supported Visual Basic programs that have long been removed from modern Windows computers. It also tends to crash if left open for an extended period of time. These DLLs can be installed into the registry, but there is some general security concerns since they are unsupported now.

I thought it would be a good project to practice pulling exported variables from DLLs and whipped up a console version over the last week. I was pleased how it came together so well. I stole a bit of library code from op2ext and it relies on OP2Utility and Outpost2DLL.

The upside is it doesn't require adding outdated DLLs to your registry and doesn't crash. The downside is you must use your command prompt, just like OP2Archive, and OP2MapImager.

If interested, you can check it out here: https://github.com/OutpostUniverse/MissionScanner

I should probably rename it MissionScanner2 or MissionScannerConsole to make it less confusing than using the previous project's exact name.

Also, I just realized it doesn't add the DLL name for the mission, which is really helpful. That should be pretty simple to add.

There is only a Visual Studio project file, so right now it cannot be compiled on Linux. However, I suspect it is fully or almost fully cross compatible as it stands. It does rely on C++17 features filesystem and string_view.

Any feedback is appreciated. I'll provide a Windows executable of it sometime in the future.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Re: Refreshed MissionScanner Source Code
« Reply #1 on: November 02, 2019, 02:50:45 PM »
I just wanted to add that with some recent updates by Vagabond, and a few minor tweaks, this project was able to be compiled and run on Linux. We don't currently have a Makefile setup to do this easily, but I'm sure that will come shortly.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1013
Re: Refreshed MissionScanner Source Code
« Reply #2 on: November 06, 2019, 07:34:30 PM »
In case anyone is following MissionScanner, Hooman has finished adding a makefile. It can easily be compiled for Linux via clang or gcc. There are also automated builds for Windows and Linux on GitHub.

I'll post a compiled executable soon as release 1.0.

MissionScanner now contains code to load exported information from a dll without loading the dll into memory. This approach is significantly faster than calling win32 LoadLibrary and then getting the exported data. More importantly, it allows pulling the exported data from a Windows dll on Linux or Windows. Sort of a niche thing to accomplish, but perhaps useful to someone else in a different project. Feel free to steal it out of MissionScanner if you find it interesting.

-Brett