mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
134 stars 13 forks source link

[MJWMUT] Mutants! - Crashes when you load a registered copy of Mutants! #146

Closed tuday2 closed 4 years ago

tuday2 commented 4 years ago

Module Information

Describe the bug Crashes when you load a registered copy of Mutants!

To Reproduce Steps to reproduce the behavior:

  1. Add Mutants to moduleConfig.json and valid reg code to .msg file
  2. Load MBBSEmu
  3. See error

Expected behavior Game loads normally

Screenshots

Critical Exception has occurred:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Unknown Exported Function Ordinal in MAJORBBS: 432')
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.Invoke(UInt16 ordinal, Boolean offsetsOnly)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.ExternalFunctionDelegate(UInt16 ordinal, UInt16 functionOrdinal)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.Module.MbbsModule.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassSetState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.HostProcess.MbbsHost.AddModule(MbbsModule module)
   at MBBSEmu.Program.Run(String[] args)

Software Information:

enusbaum commented 4 years ago

Ordinal MAJORBBS.432 is NKYREC

void nkyrec(char *uid);

Looking at how it's used, this appears to create an empty key record in the user keys Btrieve File (BBSK.DAT). Looking at BBSK.DAT it appears the only key defined is the 30-character username.

image

Currently MBBSEmu returns TRUE for any key. We can probably stub this function out for the time being, but if we want to really enforce lock/key mechanics the same as MajorBBS/Worldgroup, we probably want to track these keys in the internal SQLite AccountKey table and have key verifications work from there.