[GH-ISSUE #716] Protobuf isn't built into client.bin #459

Closed
opened 2026-02-27 15:50:27 +03:00 by kerem · 3 comments
Owner

Originally created by @ooojustin on GitHub (Oct 16, 2018).
Original GitHub issue: https://github.com/quasar/Quasar/issues/716

Since the last release of the project, you've switched .NET serialization to protobuf.
The code to build assemblies in the Quasar.Client.csproj has not been adapted to this: https://github.com/quasar/QuasarRAT/blob/master/Quasar.Client/Quasar.Client.csproj#L150

The built stub in the server can only be used if it is stored in the same directory as protobuf-net.dll.
Theoretically, this could be fixed by changing the following:
"$(SolutionDir)packages\ILMerge.2.14.1208\tools\ILMerge.exe" /out:"$(TargetDir)$(TargetName).all.exe" "$(TargetPath)" "$(TargetDir)Gma.System.MouseKeyHook.dll" "$(TargetDir)Quasar.Common.dll" /target:WinExe /wildcards /internalize
to
"$(SolutionDir)packages\ILMerge.2.14.1208\tools\ILMerge.exe" /out:"$(TargetDir)$(TargetName).all.exe" "$(TargetPath)" "$(TargetDir)protobuf-net.dll" "$(TargetDir)Gma.System.MouseKeyHook.dll" "$(TargetDir)Quasar.Common.dll" /target:WinExe /wildcards /internalize

I rebuilt the project, and was able to confirm that protobuf was successfully merged into client.bin - but for some reason, after doing this, the connection would not work. So in one scenario, it can connect but crashes without the dll; in the other scenario it doesn't crash but it wont connect.

Originally created by @ooojustin on GitHub (Oct 16, 2018). Original GitHub issue: https://github.com/quasar/Quasar/issues/716 Since the last release of the project, you've switched .NET serialization to protobuf. The code to build assemblies in the Quasar.Client.csproj has not been adapted to this: https://github.com/quasar/QuasarRAT/blob/master/Quasar.Client/Quasar.Client.csproj#L150 The built stub in the server can only be used if it is stored in the same directory as protobuf-net.dll. Theoretically, this could be fixed by changing the following: `"$(SolutionDir)packages\ILMerge.2.14.1208\tools\ILMerge.exe" /out:"$(TargetDir)$(TargetName).all.exe" "$(TargetPath)" "$(TargetDir)Gma.System.MouseKeyHook.dll" "$(TargetDir)Quasar.Common.dll" /target:WinExe /wildcards /internalize` to `"$(SolutionDir)packages\ILMerge.2.14.1208\tools\ILMerge.exe" /out:"$(TargetDir)$(TargetName).all.exe" "$(TargetPath)" "$(TargetDir)protobuf-net.dll" "$(TargetDir)Gma.System.MouseKeyHook.dll" "$(TargetDir)Quasar.Common.dll" /target:WinExe /wildcards /internalize` I rebuilt the project, and was able to confirm that protobuf was successfully merged into client.bin - but for some reason, after doing this, the connection would not work. So in one scenario, it can connect but crashes without the dll; in the other scenario it doesn't crash but it wont connect.
kerem closed this issue 2026-02-27 15:50:27 +03:00
Author
Owner

@MaxXor commented on GitHub (Oct 16, 2018):

Oh, thanks I forgot the DLL.

<!-- gh-comment-id:430119209 --> @MaxXor commented on GitHub (Oct 16, 2018): Oh, thanks I forgot the DLL.
Author
Owner

@MaxXor commented on GitHub (Oct 16, 2018):

I think the crashes could be fixed by changing
github.com/quasar/QuasarRAT@1bc20d38c0/Quasar.Server/Build/Renamer.cs (L60)
to

if (!typeDef.Namespace.StartsWith("Quasar") || typeDef.HasInterfaces) 

Maybe you could report back and tell if it's working, I can only check this tomorrow.

<!-- gh-comment-id:430130996 --> @MaxXor commented on GitHub (Oct 16, 2018): I think the crashes could be fixed by changing https://github.com/quasar/QuasarRAT/blob/1bc20d38c0b2c73ae892cd7b171e19eedbbd7c1c/Quasar.Server/Build/Renamer.cs#L60 to ```csharp if (!typeDef.Namespace.StartsWith("Quasar") || typeDef.HasInterfaces) ``` Maybe you could report back and tell if it's working, I can only check this tomorrow.
Author
Owner

@ooojustin commented on GitHub (Oct 16, 2018):

I think the crashes could be fixed by changing
QuasarRAT/Quasar.Server/Build/Renamer.cs

Line 60 in 1bc20d3

if (typeDef.HasInterfaces)

to

if (!typeDef.Namespace.StartsWith("Quasar") || typeDef.HasInterfaces) 

Maybe you could report back and tell if it's working, I can only check this tomorrow.

The crashing is fixed by merging the protobuf assembly, and checking if the namespace starts with Quasar in renamer seemed to fix the connection issue. All seems to be working normally now, good job.

<!-- gh-comment-id:430136015 --> @ooojustin commented on GitHub (Oct 16, 2018): > I think the crashes could be fixed by changing > [QuasarRAT/Quasar.Server/Build/Renamer.cs](https://github.com/quasar/QuasarRAT/blob/1bc20d38c0b2c73ae892cd7b171e19eedbbd7c1c/Quasar.Server/Build/Renamer.cs#L60) > > Line 60 in [1bc20d3](/quasar/QuasarRAT/commit/1bc20d38c0b2c73ae892cd7b171e19eedbbd7c1c) > > if (typeDef.HasInterfaces) > > to > ```cs > if (!typeDef.Namespace.StartsWith("Quasar") || typeDef.HasInterfaces) > ``` > > Maybe you could report back and tell if it's working, I can only check this tomorrow. The crashing is fixed by merging the protobuf assembly, and checking if the namespace starts with Quasar in renamer seemed to fix the connection issue. All seems to be working normally now, good job.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Quasar#459
No description provided.