Jump to content
UBot Underground

[SELL] ►► Csharp Compiler Plugin◄◄ Run C# Code Inside Ubot


Recommended Posts

http://ubot-plugins.com/wp-content/uploads/2014/04/headline7.jpg


 


Video Tutorial + Demonstration



 


 


Source Codes In The Package


 


-TextBox Dialog


-TextArea Dialog


-Gzip Compress/Gzip Decompress


-Webclient Download file


-Get domain Ips


-Get Local Machine Names


-Get Local Machine Ips


-SmtpClient example (sending an email)


 


...More Source Codes will be added soon.


 


 


Get This for $77 $57


 


http://ubot-plugins.com/wp-content/themes/OptimizePress/images/addtocart-style2-nopp.png


Link to post
Share on other sites

quick question can we include the ubot api plugin so we can read tables lists etc from ubot. I will have a play myself just wondered if you had tried yet

Link to post
Share on other sites

quick question can we include the ubot api plugin so we can read tables lists etc from ubot. I will have a play myself just wondered if you had tried yet

 

i didn't try that yet , i'll have something like that implemented soon

 

This is great. Please post more example tutorials on this for us c# newbies.

 

Can it execute a ubot define/function when a button is clicked on the dialog?

 

i'm working on adding a function to allow you to do that !

Link to post
Share on other sites

Hello.

 

How would I add a simple command like:

ServiceController[] services = ServiceController.GetServices();

 
 
When I want the services to be added to a list within ubot for example?
 
Dan
Link to post
Share on other sites

 

Hello.

 

How would I add a simple command like:

ServiceController[] services = ServiceController.GetServices();

 
 
When I want the services to be added to a list within ubot for example?
 
Dan

 

Create a StringBuilder instance and append all the list items to it then convert the stringbuilder instance to string!

i'll post an example code later today

 

Great work Aymen, will this come with a scripting reference to take out a lot of the guess work?

 

this executes c#/vb code so your scripting reference is the C# language itself :)

Link to post
Share on other sites

Aymen,

Quick question.

Why should I use C# instead of Javascript/Jquery/JS libraries?

 

First there is things in C# that you can not do in either of what you mentioned!

Second it may freeze your bot if you are executing JavaScript extensively!

Third its easier to use if you know what you are doing !

Link to post
Share on other sites

First there is things in C# that you can not do in either of what you mentioned!

Second it may freeze your bot if you are executing JavaScript extensively!

Third its easier to use if you know what you are doing !

 

Are you going to add libraries eventually for owners of this plugin? I mean, some plugins here in Trade, Sell and Buy do some stuff that we could do using C#, for example:

Tray alerts, minimizing to tray, licensing and so on.

Do you think you will add libraries eventually for extra cost?

Link to post
Share on other sites

Are you going to add libraries eventually for owners of this plugin? I mean, some plugins here in Trade, Sell and Buy do some stuff that we could do using C#, for example:

Tray alerts, minimizing to tray, licensing and so on.

Do you think you will add libraries eventually for extra cost?

 

I'll add libraries for free as code examples for sure!

if you have something in mind , post here and i'll see about it!

Link to post
Share on other sites

I'll add libraries for free as code examples for sure!

if you have something in mind , post here and i'll see about it!

 

Thats great!

Im an absolutely buyer then. This will create great applications for UBot!

Hopefully we can also do it multiplatform in the future.

Link to post
Share on other sites
  • 3 weeks later...

Aymen,

 

I'm still looking for a solution to validate SSL certificates (certificate pinning).

 

I found some example codes:

public static void SetCertificatePolicy()
{
ServicePointManager.ServerCertificateValidationCallback
+= RemoteCertificateValidate;
}

 

If you really want to nail it down to one particular certificate, you can compare the certificate data (in DER format) to the byte[] in certificate.GetRawCertData().

 

You can also use GetCertHashString() and Subject on the certificate parameter in RemoteCertificateValidate to get the information you're after. The hostname ought to be in the subject alternative name of the certificate or, if there isn't a subject alternative name, in the CN of the subject (distinguished) name. Considering the way .NET formats the subject string, this ought to be the first CN= you find there.

 

Do you have an idea how this could be implemented with your plugin?

An example code would be highly appreciated.


Thanks
Dan

Link to post
Share on other sites
  • 2 weeks later...

Played around with the C# plugin a bit today. 

I have to say that my C# skills are not that great at the moment. So please excuse if I ask something stupid :-)

 

 

I have the following code working in Visual Studio 2013

 

 

  static void Main(string[] args)
        {
            DateTime StartingDate = DateTime.Parse("23.02.2007");
            DateTime EndingDate = DateTime.Parse("27.03.2007");
            foreach (DateTime date in GetDateRange(StartingDate, EndingDate))
            {
                Console.WriteLine(date.ToShortDateString());    
            }
            
            Console.ReadLine();
            
        }
 
        static private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)
        {
            if (StartingDate > EndingDate)
            {
                return null;
            }
            List<DateTime> rv = new List<DateTime>();
            DateTime tmpDate = StartingDate;
            do
            {
                rv.Add(tmpDate);
                tmpDate = tmpDate.AddDays(1);
            } while (tmpDate <= EndingDate);
            return rv;
        }
 
 
Now I try to do that with the plugin.
 
plugin command("CsharpCompiler.dll""csharp container") {
    plugin command("CsharpCompiler.dll""csharp add function""private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)
        \{
            if (StartingDate > EndingDate)
            \{
                return null;
            \}
            List<DateTime> rv = new List<DateTime>();
            DateTime tmpDate = StartingDate;
            do
            \{
                rv.Add(tmpDate);
                tmpDate = tmpDate.AddDays(1);
            \} while (tmpDate <= EndingDate);
            return rv;
        \}")
    set(#code$plugin function("CsharpCompiler.dll""$csharp compiler""return GetDateRange(\"1.01.2014\",\"10.01.2014\");"), "Global")
    alert(#code)
}
 
But he's telling me that the namespace list can't be found.
 
 
And I struggle a bit with the 
add .net assembly and add namespace thing. 
 
I tried it with:
plugin command("CsharpCompiler.dll""csharp add namespace""System.Collections.Generic.List")
 
But it tells me, that it requires a Type Argument. Which should be System.DateTime.
 
But
plugin command("CsharpCompiler.dll""csharp add namespace""System.DateTime")
 
also isn't working.
 
 
Would be great if someone could give me a hint how that works exactly.
 
Thanks in advance for your support
Dan
Link to post
Share on other sites

 

Played around with the C# plugin a bit today. 

I have to say that my C# skills are not that great at the moment. So please excuse if I ask something stupid :-)

 

 

I have the following code working in Visual Studio 2013

 

 

  static void Main(string[] args)
        {
            DateTime StartingDate = DateTime.Parse("23.02.2007");
            DateTime EndingDate = DateTime.Parse("27.03.2007");
            foreach (DateTime date in GetDateRange(StartingDate, EndingDate))
            {
                Console.WriteLine(date.ToShortDateString());    
            }
            
            Console.ReadLine();
            
        }
 
        static private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)
        {
            if (StartingDate > EndingDate)
            {
                return null;
            }
            List<DateTime> rv = new List<DateTime>();
            DateTime tmpDate = StartingDate;
            do
            {
                rv.Add(tmpDate);
                tmpDate = tmpDate.AddDays(1);
            } while (tmpDate <= EndingDate);
            return rv;
        }
 
 
Now I try to do that with the plugin.
 
plugin command("CsharpCompiler.dll""csharp container") {

    plugin command("CsharpCompiler.dll""csharp add function""private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)

        \{

            if (StartingDate > EndingDate)

            \{

                return null;

            \}

            List<DateTime> rv = new List<DateTime>();

            DateTime tmpDate = StartingDate;

            do

            \{

                rv.Add(tmpDate);

                tmpDate = tmpDate.AddDays(1);

            \} while (tmpDate <= EndingDate);

            return rv;

        \}")

    set(#code$plugin function("CsharpCompiler.dll""$csharp compiler""return GetDateRange(\"1.01.2014\",\"10.01.2014\");"), "Global")

    alert(#code)

}

 
But he's telling me that the namespace list can't be found.
 
 
And I struggle a bit with the 
add .net assembly and add namespace thing. 
 
I tried it with:
plugin command("CsharpCompiler.dll""csharp add namespace""System.Collections.Generic.List")
 
But it tells me, that it requires a Type Argument. Which should be System.DateTime.
 
But
plugin command("CsharpCompiler.dll""csharp add namespace""System.DateTime")
 
also isn't working.
 
 
Would be great if someone could give me a hint how that works exactly.
 
Thanks in advance for your support
Dan

 

 

 

try this code

plugin command("CsharpCompiler.dll", "csharp container") {
    plugin command("CsharpCompiler.dll", "csharp add namespace", "System.Globalization")
    plugin command("CsharpCompiler.dll", "csharp add namespace", "System.Collections.Generic")
    plugin command("CsharpCompiler.dll", "csharp add namespace", "System.Text")
    plugin command("CsharpCompiler.dll", "csharp Framework version", "v4.0")
    plugin command("CsharpCompiler.dll", "csharp platform", "anycpu")
    plugin command("CsharpCompiler.dll", "csharp add function", "private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)
        \{
            if (StartingDate > EndingDate)
            \{
                return null;
            \}
            List<DateTime> rv = new List<DateTime>();
            DateTime tmpDate = StartingDate;
            do
            \{
                rv.Add(tmpDate);
                tmpDate = tmpDate.AddDays(1);
            \} while (tmpDate <= EndingDate);
            return rv;
        \}")
    set(#code, $plugin function("CsharpCompiler.dll", "$csharp compiler", "DateTime StartingDate = DateTime.ParseExact(\"23/2/2007\", \"dd/M/yyyy\", CultureInfo.InvariantCulture);
            DateTime EndingDate = DateTime.ParseExact(\"25/3/2007\", \"dd/M/yyyy\", CultureInfo.InvariantCulture);
            StringBuilder sb = new StringBuilder();
            foreach (DateTime date in GetDateRange(StartingDate, EndingDate))
            \{
                sb.AppendLine(date.ToShortDateString());
            \}
return sb.ToString();"), "Global")
    alert(#code)
}

Link to post
Share on other sites

Awesome Aymen! Thanks a lot for that!

 

Ok I see.. I forgot to convert that array into a string. 

Stringbuilder ok.. note to self :-)

 

 

I'm still confused by the namespaces. I know what they are, but how do I know which ones I need to specify here?

When I have the code running in visual studio. Is there a way to show which ones are used? 

Do I have to add all of them all the time?

 

 
Dan
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...