Jun 17, 2014 12:37 PM
(This post was last modified: Jun 18, 2014 10:57 AM by DragonHunter.)
Hey guys what's up,
I thought of sharing this as I'm quitting the RAT development and focussing at more useful projects.
So what is this StreamLibrary? Well it's a library which contains codecs (or so I call them atleast Codecs) that will convert any image/video into a smaller format
It will compress your video (or Remote Desktop if you will) to a smaller size so it will speed up your remote desktop by ALOT
PS: I'm just taking RAT development as a example because this is HF after all.
This can be used in either C# or VisualBasic .NET.
What most of the people do in RAT development really is sending the image over (compressed hopefully) and that's it,
Or they simply use some motion detection (which is used in the more advanced RAT's) in the hope that it will speedup, which it does.
The codecs I wrote are made for speed and support, you'll find a list below with the features and codecs you're able to use.
The codecs are made for EASY-TO-USE, which means with a stable network you're able to get amazing speed and performance.
Most codecs I wrote are able to handle easily 5760x1080 resolution (which I tested it at) with ~70FPS in speed.
The performance depends at the hardware you're running it at, note: this does not have hardware acceleration
Well ok, after all that talk let's go to the goodies,
Ok so this is just an example of an video running at ~30FPS, encoding it at ~80FPS and decoding it at ~100FPS
This is at a full resolution of 1920x800 !!
![[Image: edeffcb75f.png]](https://puu.sh/9xOyK/edeffcb75f.png)
Features:
[Driver supported] yes my Unsafe Codecs do support drivers!
[Unsafe Codec support] Use Pointers to gain more performance!
[Managed Codec support] use the managed Bitmap/Image classes
[Multiple Codecs to chose from] There are 5 Unsafe and 6 Managed Codecs
... will write down soon more
So where can you get this? Take a look at my GIT https://github.com/AnguisCaptor/StreamLibrary
Ok so.. you're having the codec library compiled, so now what ?
So first of all, what is the actual codec you want to use ?
If you want it plain and simple you could go for MJPG Codec, which is easy to use and manage but not really a good thing for Remote Desktop and compression but easy to use non the less
So what if I'm having a RAT and I want the best stability and performance ? use the "UnsafeStreamCodec" which I used personally and is really fast
Having a driver ? no problem the "UnsafeStreamCodec" even does support driver-level!
The Different Managed Codecs
DirectDriver Codec:
I barely used this as it was a long time ago, I would have to look at the code/debug again but I guess it does what the name says
MJPG Codec:
This is a very simple MJPG Codec which can even be used for real life situations, webbrowsers etc, It is using the exact same method
QuickCachedStream Codec:
This will cache all the image(s) and trying to quickly process it to keep the performance up, this codec will use cache in the hope to drop ALOT of data to gain higher performance over the internet
Keep in mind that this codec could be unstable or not working correctly, needs more testing
QuickStream Codec:
The name says what it will do, it will quickly stream your images (remote desktop, animations) so fast as possible with plain simple Motion Detection
SmallCachedStream Codec:
This codec is a modified version of the "QuickStreamCodec" but with caching in the hope it will gain performance over the internet
SmallStream Codec:
I don't know exactly what the SmallStream did, I have to look at it again
The Different Unsafe Codecs
UnsafeCache Codec:
I would need to look up what it does again but I'm pretty sure the name explains it all
UnsafeCachedStream Codec:
I would need to look up what it does again but I'm pretty sure the name explains it all
UnsafeOptimized Codec:
It could be stable or not need to test this completely,
But the idea behind this codec is to really optimize the performance for if there are any video's running for example in Remote Desktop
Or specific animations running in the video, it is able to detect multiple video's running in image(s) and to optimize and focus performance at those animation/video's in the image
It sounds complex perhaps, but it will speedup video a little bit if there is any running
UnsafeQuick Stream:
This is an unsafe codec version as the "QuickStreamCodec", I think
UnsafeStream Codec:
This is a very good choice and even RECOMMENDED to use for everything as this is the most stable codec and the most reliable codec I made which supports Drivers and more
It does not contain any caching but yet again, It is really recommended to use over any of the other codecs that are in the library
So how do I even use these codecs ?
The codecs are being made for EASY-TO-USE remember ? well the unsafe codecs are all using the exact same methods and same goes for the Managed codecs
An example of using the Unsafe codec (UnsafeStream Codec):
You really need to understand programming to understand calling a bunch of methods
Ok so this is a example to encode a image to bytes using a codec
Ok so the bytes are stored now in "stream" right, now what can be do with the data(bytes) in stream ?
The thing that pops to my mind atleast is sending it over the internet (like remote desktop does in RAT's right...)
And then let's decode the bytes to a image so we're able to see something again 😎
To decode bytes to a image is actually really simple, well how simple ? only 2 lines of code!
And that is how you decode from bytes which was provided by the Encoder, back to an Image again using the Decoder
More technical stuff to keep back in your head:
Ok so when using the Managed/Unsafe codecs you should remember that when using these you need a Encoder and Decoder variable (both initialized ofcourse)
And decoding and encoding in the order you encoded it in
So when doing Encode, you should decode
Wrong example: Don't decode twice the same data! like so
Encoded = Encode(...);
Decoded = Decode(Encoded);
Decoded = Decode(Encoded);
Decoding something twice in a row maybe could cause problem, I did not test this completely but It might will!
I hope I've wrote it detailed enough for people to understand otherwise I would be happy to answer questions,
And please don't bash this thread like "OH THIS COMPLETELY RUINED MY RAT SALE" or like "THE CODE IS HAVING SO MANY BUGS LOLOL"
Some codecs are simply not 100% stable and when you read above about the codecs you know which 1 to use >>UnsafeStream Codec<<
Some of the codecs are simply not 100% finished as it didn't worked out with performance or some other issue
Just enjoy the library and the features it's giving you
Find any bugs ? share them at GIT or simply PM me
Programs/Projects using my StreamLibrary:
Have a good one 🤝
I thought of sharing this as I'm quitting the RAT development and focussing at more useful projects.
So what is this StreamLibrary? Well it's a library which contains codecs (or so I call them atleast Codecs) that will convert any image/video into a smaller format
It will compress your video (or Remote Desktop if you will) to a smaller size so it will speed up your remote desktop by ALOT
PS: I'm just taking RAT development as a example because this is HF after all.
This can be used in either C# or VisualBasic .NET.
What most of the people do in RAT development really is sending the image over (compressed hopefully) and that's it,
Or they simply use some motion detection (which is used in the more advanced RAT's) in the hope that it will speedup, which it does.
The codecs I wrote are made for speed and support, you'll find a list below with the features and codecs you're able to use.
The codecs are made for EASY-TO-USE, which means with a stable network you're able to get amazing speed and performance.
Most codecs I wrote are able to handle easily 5760x1080 resolution (which I tested it at) with ~70FPS in speed.
The performance depends at the hardware you're running it at, note: this does not have hardware acceleration
Well ok, after all that talk let's go to the goodies,
Ok so this is just an example of an video running at ~30FPS, encoding it at ~80FPS and decoding it at ~100FPS
This is at a full resolution of 1920x800 !!
![[Image: edeffcb75f.png]](https://puu.sh/9xOyK/edeffcb75f.png)
Features:
[Driver supported] yes my Unsafe Codecs do support drivers!
[Unsafe Codec support] Use Pointers to gain more performance!
[Managed Codec support] use the managed Bitmap/Image classes
[Multiple Codecs to chose from] There are 5 Unsafe and 6 Managed Codecs
... will write down soon more
So where can you get this? Take a look at my GIT https://github.com/AnguisCaptor/StreamLibrary
Ok so.. you're having the codec library compiled, so now what ?
So first of all, what is the actual codec you want to use ?
If you want it plain and simple you could go for MJPG Codec, which is easy to use and manage but not really a good thing for Remote Desktop and compression but easy to use non the less
So what if I'm having a RAT and I want the best stability and performance ? use the "UnsafeStreamCodec" which I used personally and is really fast
Having a driver ? no problem the "UnsafeStreamCodec" even does support driver-level!
The Different Managed Codecs
DirectDriver Codec:
I barely used this as it was a long time ago, I would have to look at the code/debug again but I guess it does what the name says
MJPG Codec:
This is a very simple MJPG Codec which can even be used for real life situations, webbrowsers etc, It is using the exact same method
QuickCachedStream Codec:
This will cache all the image(s) and trying to quickly process it to keep the performance up, this codec will use cache in the hope to drop ALOT of data to gain higher performance over the internet
Keep in mind that this codec could be unstable or not working correctly, needs more testing
QuickStream Codec:
The name says what it will do, it will quickly stream your images (remote desktop, animations) so fast as possible with plain simple Motion Detection
SmallCachedStream Codec:
This codec is a modified version of the "QuickStreamCodec" but with caching in the hope it will gain performance over the internet
SmallStream Codec:
I don't know exactly what the SmallStream did, I have to look at it again
The Different Unsafe Codecs
UnsafeCache Codec:
I would need to look up what it does again but I'm pretty sure the name explains it all
UnsafeCachedStream Codec:
I would need to look up what it does again but I'm pretty sure the name explains it all
UnsafeOptimized Codec:
It could be stable or not need to test this completely,
But the idea behind this codec is to really optimize the performance for if there are any video's running for example in Remote Desktop
Or specific animations running in the video, it is able to detect multiple video's running in image(s) and to optimize and focus performance at those animation/video's in the image
It sounds complex perhaps, but it will speedup video a little bit if there is any running
UnsafeQuick Stream:
This is an unsafe codec version as the "QuickStreamCodec", I think
UnsafeStream Codec:
This is a very good choice and even RECOMMENDED to use for everything as this is the most stable codec and the most reliable codec I made which supports Drivers and more
It does not contain any caching but yet again, It is really recommended to use over any of the other codecs that are in the library
So how do I even use these codecs ?
The codecs are being made for EASY-TO-USE remember ? well the unsafe codecs are all using the exact same methods and same goes for the Managed codecs
An example of using the Unsafe codec (UnsafeStream Codec):
You really need to understand programming to understand calling a bunch of methods
Ok so this is a example to encode a image to bytes using a codec
PHP Code
<?php
IUnsafeCodec UnsafeCodec = new UnsafeStreamCodec(80); //initialize our Codec
Bitmap bmp = (Bitmap)Bitmap.FromFile("Some file"); // It's just an image, could be of RemoteDesktop, video, anything, it's a image
int width = bmp.Width;
int height = bmp.Height;
BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, bmp.PixelFormat); //since it's a unsafe codec we need the LockBits to grab the pointer
using (MemoryStream stream = new MemoryStream())
{
UnsafeCodec.CodeImage(bmpData.Scan0,
new Rectangle(0, 0, width, height), //the area of the image to use
new Size(width, height), //give the total size of the image
bmp.PixelFormat, //the format of the image
stream); //where the bytes will be stored in
}
Ok so the bytes are stored now in "stream" right, now what can be do with the data(bytes) in stream ?
The thing that pops to my mind atleast is sending it over the internet (like remote desktop does in RAT's right...)
And then let's decode the bytes to a image so we're able to see something again 😎
To decode bytes to a image is actually really simple, well how simple ? only 2 lines of code!
PHP Code
<?php
IUnsafeCodec UnsafeCodec = new UnsafeStreamCodec(80); //initialize our Codec
Bitmap DecodedImage = UnsafeCodec.DecodeData(new MemoryStream(YOUR_BYTES_OR_STREAM)); //where is "YOUR_BYTES_OR_STREAM" should be what it says
And that is how you decode from bytes which was provided by the Encoder, back to an Image again using the Decoder
More technical stuff to keep back in your head:
Ok so when using the Managed/Unsafe codecs you should remember that when using these you need a Encoder and Decoder variable (both initialized ofcourse)
And decoding and encoding in the order you encoded it in
So when doing Encode, you should decode
Wrong example: Don't decode twice the same data! like so
Encoded = Encode(...);
Decoded = Decode(Encoded);
Decoded = Decode(Encoded);
Decoding something twice in a row maybe could cause problem, I did not test this completely but It might will!
I hope I've wrote it detailed enough for people to understand otherwise I would be happy to answer questions,
And please don't bash this thread like "OH THIS COMPLETELY RUINED MY RAT SALE" or like "THE CODE IS HAVING SO MANY BUGS LOLOL"
Some codecs are simply not 100% stable and when you read above about the codecs you know which 1 to use >>UnsafeStream Codec<<
Some of the codecs are simply not 100% finished as it didn't worked out with performance or some other issue
Just enjoy the library and the features it's giving you
Find any bugs ? share them at GIT or simply PM me
Programs/Projects using my StreamLibrary:
Have a good one 🤝
ReadMe: http://pastebin.com/EscqLWyY




![[Image: eQhTFwh.gif]](https://i.imgur.com/eQhTFwh.gif)
![[Image: IQE6i8G.png]](https://i.imgur.com/IQE6i8G.png)
![[Image: 1zL3pDG.jpg]](https://i.imgur.com/1zL3pDG.jpg)