"Debug Assertion Failed"

07/02/2012 21:22 Nabot#1
Hey guys,

I was going to play Azgard SRO and downloaded their whole client, unfortunately the following error I get:

Debug Assertion Failed
Expression : 0
Line : 831
file: \vss-od\Silkroad\client\client\client.cpp (I don't even have that direction tho)

CallStack:



Any help?

Regards,
Nabot
12/25/2013 21:35 aviram3122#2
+1
05/27/2017 19:17 dovildas#3
+1 cus so many years and still none aswers to this problem....
12/04/2017 04:12 zsolti900#4
+1 waiting :D
12/04/2017 13:32 florian0#5
This is an issue with the "Silkroad.dat". The error is thrown when the Silkroad.dat is non-existent. Some servers tend to rename this file because its "cool". Try creating a file named "Silkload.dat". Yes. SilkLoad not SilkRoad. Maybe it works, maybe it got renamed.

Also make sure your path to the Silkroad folder is not longer than 256 - strlen("Silkload.dat") (= 243) characters. Because, as you can see in the code below, Silkroad only supports up to 256 characters in total.

Check address 0x00DD29B8 if you need to know which filename it is.

Related code of the init_xtrap function.
Code:
void __stdcall init_xtrap()
{
  FILE *File;
  DWORD ThreadId;
  string str;
  char v8[256];
  char fn_module[260];
  char filename[260];

  // Get Filepath of sro_client.exe
  GetModuleFileNameA(0, fn_module, sizeof(fn_module));
  std::string str;
  str.assign(fn_module);

  // We want to build a new path for the Silkload.dat
  // We need to remove the sro_client.exe from the path
  // C:\Program Files\Silkroad Online\sro_client.exe
  //                                 ^
  // Just terminate the string here by setting it to zero!
  // Thats what we do here
  ch = '\\';
  size_t pos = str.find_last_of(&ch, -1, 1);
  fn_module[pos] = 0;

  // Assemble new filename+path
  sprintf_s(filename, sizeof(filename), "%s\\Silkload.dat", fn_module);

  // Init buffer for weird data
  memset(&v8[0], 0, sizeof(v8));

  // Open file
  if ( fopen_s(&File, filename, "rt") )
  {
    // Throw error if file is not existing or non-accessable
    nullsub_1();
    assert(831, "D:\\vss-od\\Silkroad\\Client\\client\\Client.cpp", "0", "'xtrap.txt' Is not existing.. Using");
  }
  // Read data and close file
  fscanf_s(File, "%s", v8, sizeof(v8));
  fclose(File);

  // XTrap would start here, but i deleted it Kappa

  // We still need this thread, tho :(
  CreateThread(0, 0, &XTrapWatcherThread, 0, 0, &ThreadId);

  // No idea, sorry.
  if ( str.size() >= 0x10 )
    sub_402AE0(str.payload.pc_str, str.size + 1);
}