|
293
|
Programación / .NET (C#, VB.NET, ASP) / [Ayuda] Crear Archivo .asi (.dll) para GTA:SA | ASILOADER
|
en: 17 Octubre 2019, 18:09 pm
|
Un archivo .asi es una .dll solo con la extensión cambiada. el Juego GTA San Andrea tiene un complemento llamado ASILOADER que basicamente lee todos los archivos .asi en el directorio del juego y los injecta o algo asi. (recordando q un .asi es un .dll)los ejemplos de como crear un .asi para GTA SA estan en C++ estoy intentando pasarlo a vb.net pero no se si se podra. .-. Siguiendo este tutorial uno puede crear fácilmente un .asi para el juego : [ C++ ] Создание мода для GTA SA codigo c++ =#define _CRT_SECURE_NO_WARNINGS #include <Windows.h> #include <stdio.h> void Debug(char* text); BOOL WINAPI DllMain(HINSTANCE dllHistance, DWORD callReason, void* reserved) { switch (callReason) { case DLL_PROCESS_ATTACH: { Debug("Loading"); break; } case DLL_PROCESS_DETACH: { break; } default: { break; } } return TRUE; } void Debug(char* text) { FILE* fichier = fopen("debug.txt", "a"); if (fichier == 0) fichier = fopen("debug.txt", "w"); fwrite(text, strlen(text), 1, fichier); fputs("\r\n", fichier); fclose(fichier); }
Lo que he intentado : Public Const DLL_PROCESS_ATTACH = 1 Public Const DLL_PROCESS_DETACH = 0 Public Function DllMain(ByVal dllHistance As IntPtr, ByVal callReason As Integer, ByVal reserved As Object) As Boolean Select Case callReason Case DLL_PROCESS_ATTACH Return True Case DLL_PROCESS_DETACH Return False End Select Return False End Function Public Sub Debug(ByVal texto As String) System. IO. File. WriteAllText("debug.txt", texto ) End Sub
Obviamente estos 2 son ejemplos de una dll , solo que se le cambia la extensión después de compilar. Entonces , por que no me funciona mi código en vb.net y si el de c++? / que estoy haciendo mal? / Tiene algo que ver con el punto de entrada a la dll en vb que no esta siendo llamada?Gracias de antemano...
|
|
|
294
|
Programación / Scripting / Re: Evitar que SET /P cierre el script
|
en: 2 Julio 2019, 14:46 pm
|
si no ingreso nada al set /p, cuando le doy enter el script se cierra y quiero que si no se incresa nada y se da enter el "if" me devuelva a :menu1
@echo off :menu1 set /p tipo= Ingresa opcion y enter: if not defined tipo (goto:menu1) >NUL
bueno te dejo un menu base en batch : @echo off & Title Batch Menu Base & Color b :menu1 cls echo/ echo/ echo/ set /p tipo= Ingresa opcion y enter: if not defined tipo (goto:menu1) >NUL If ["%tipo%"]==["help"] goto Help >NUL If ["%tipo%"]==["1"] goto 1 >NUL If ["%tipo%"]==["2"] goto 2 >NUL :1 cls Echo/ Echo opcion 1 Echo/ pause End :2 cls Echo/ Echo opcion 2 Echo/ pause End :Help cls Echo/ Echo/ Echo Ingrese Opciones : 1 - 2 - 3 - 4 y presione enter Echo/ Echo Batch Menu Base Echo/ Echo/ Echo/ Echo/ & pause goto :menu1
|
|
|
295
|
Programación / .NET (C#, VB.NET, ASP) / Re: [Ayuda] [Error] la operación aritmética ha provocado un desbordamiento
|
en: 22 Junio 2019, 23:40 pm
|
Ocurre con todos los .exe, el error aritmetico se produce . ************** Texto de la excepción ************** System.OverflowException: La operación aritmética ha provocado un desbordamiento. en MainNamespace.MainClass.DecompressData(String CompressedText) en C:\Users\S4lsalsoft\AppData\Local\Temp\r0fb35eb.0.vb:línea 302 en MainNamespace.MainClass.InicialLoader() en C:\Users\S4lsalsoft\AppData\Local\Temp\r0fb35eb.0.vb:línea 237 en MainNamespace.MainClass.MainClass_Load(Object sender, EventArgs e) en C:\Users\S4lsalsoft\AppData\Local\Temp\r0fb35eb.0.vb:línea 36 en System.Windows.Forms.Form.OnLoad(EventArgs e) en System.Windows.Forms.Form.OnCreateControl() en System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) en System.Windows.Forms.Control.CreateControl() en System.Windows.Forms.Control.WmShowWindow(Message& m) en System.Windows.Forms.Control.WndProc(Message& m) en System.Windows.Forms.ScrollableControl.WndProc(Message& m) en System.Windows.Forms.Form.WmShowWindow(Message& m) en System.Windows.Forms.Form.WndProc(Message& m) en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Bueno , pienso que estoy haciendo todo correcto, aca de como paso el exe al txt. Private Sub Inicio() Dim FileCrypt As String = ConverexetohexandCompress("Ca.exe", "PutoElQueloLea") File. WriteAllText("Digital_Signature.txt", FileCrypt ) End Sub Public Shared Function ConverexetohexandCompress(ByVal FilePath As String, ByVal PasswordtoCrypt As String) As String Dim input As New FileStream(FilePath, FileMode.Open, FileAccess.Read) Dim reader As New BinaryReader(input) Dim bytes() As Byte bytes = reader.ReadBytes(CInt(input.Length)) 'leemos los bytes Dim hexCompress As String = CompressedData(BytesToHex(bytes)) ' Pasamos los bytes a Hex y Comprimimos. Dim exefilestringenc As String = String.Empty exefilestringenc = Rijndaelcrypt(hexCompress, PasswordtoCrypt) 'Encryptamos (Rijndael) Return exefilestringenc End Function Public Shared Function CompressedData(ByVal Text As String) As String 'Funcion para Comprimir String Dim Buffer As Byte() = System.Text.Encoding.Unicode.GetBytes(Text) Dim mStream As New MemoryStream() Using GZipStream As New IO.Compression.GZipStream(mStream, IO.Compression.CompressionMode.Compress, True) GZipStream.Write(Buffer, 0, Buffer.Length) End Using mStream.Position = 0 Dim outStream As New MemoryStream() Dim Compressed As Byte() = New Byte(mStream.Length - 1) {} mStream.Read(Compressed, 0, Compressed.Length) Dim GZipBuffer As Byte() = New Byte(Compressed.Length + 3) {} System.Buffer.BlockCopy(Compressed, 0, GZipBuffer, 4, Compressed.Length) System.Buffer.BlockCopy(BitConverter.GetBytes(Buffer.Length), 0, GZipBuffer, 0, 4) Return Convert.ToBase64String(GZipBuffer) End Function Public Shared Function BytesToHex(ByVal Input As Byte()) As String 'Funcion para convertir los bytes en hex Dim Result As New System.Text.StringBuilder(Input.Length * 2) Dim Part As String For Each b As Byte In Input Part = Conversion.Hex(b) If Part.Length = 1 Then Part = "0" & Part Result.Append(Part) Next Return Result.ToString() End Function Public Shared Function Rijndaelcrypt (ByVal File As String, ByVal Key As String) ' Funcion para Encryptar. Dim oAesProvider As New System.Security.Cryptography.RijndaelManaged Dim btClear() As Byte Dim btSalt() As Byte = New Byte() {1, 2, 3, 4, 5, 6, 7, 8} Dim oKeyGenerator As New Rfc2898DeriveBytes(Key, btSalt) oAesProvider.Key = oKeyGenerator.GetBytes(oAesProvider.Key.Length) oAesProvider.IV = oKeyGenerator.GetBytes(oAesProvider.IV.Length) Dim ms As New IO.MemoryStream Dim cs As New CryptoStream(ms, _ oAesProvider.CreateEncryptor(), _ CryptoStreamMode.Write) btClear = System. Text. Encoding. UTF8. GetBytes(File) cs.Write(btClear, 0, btClear.Length) cs.Close() File = Convert. ToBase64String(ms. ToArray) End Function
En Si es esto :
|
|
|
296
|
Programación / .NET (C#, VB.NET, ASP) / [Ayuda] [Error] la operación aritmética ha provocado un desbordamiento
|
en: 22 Junio 2019, 17:12 pm
|
Hola, bueno vengo con un pequeño problema. bueno Tengo un .exe que fue Pasado a Hex y Comprimido después Encryptado (Rijndael). Pero al momento de volverlo a la normalidad osea Desencryptar --- Descomprimir el string ---- pasar hex a bytes me produce el error: Bueno este es el archivo que fue , Pasado a Hex , Comprimido el estring y encryptado : https://anonfile.com/0aI5lbw1n5/Digital_Signature_txtBueno para revertirlo a .exe :Primero Desencryptamos, Segundo Descomprimimos el String, Tercero el String hex lo pasamos a Bytes : Dim FileCompressC As String = File. ReadAllText("Digital_Signature.txt") Dim MasterKey As String = "PutoElQueloLea" Public Sub InicialLoader() Dim ExtractApp As String = "Ca.exe" Dim FileCoD As String = DecryptS(FileCompressC, MasterKey) ' Desencrytamos Dim DesFile As String = DecompressData(FileCoD) ' Descomprimimos el String Hex File. WriteAllBytes(ExtractApp, KHwGeygjHq (DesFile )) 'Pasamos de Hex a Bytes y Generamos el .exe End Sub Public Shared Function RijndaelDecrypt(ByVal UDecryptU As String, ByVal UKeyU As String) ' Desencryptamos Dim XoAesProviderX As New System.Security.Cryptography.RijndaelManaged Dim XbtCipherX() As Byte Dim XbtSaltX() As Byte = New Byte() {1, 2, 3, 4, 5, 6, 7, 8} Dim XoKeyGeneratorX As New System.Security.Cryptography.Rfc2898DeriveBytes(UKeyU, XbtSaltX) XoAesProviderX.Key = XoKeyGeneratorX.GetBytes(XoAesProviderX.Key.Length) XoAesProviderX.IV = XoKeyGeneratorX.GetBytes(XoAesProviderX.IV.Length) Dim XmsX As New IO.MemoryStream Dim XcsX As New System.Security.Cryptography.CryptoStream(XmsX, XoAesProviderX.CreateDecryptor(), _ System.Security.Cryptography.CryptoStreamMode.Write) Try XbtCipherX = Convert.FromBase64String(UDecryptU) XcsX.Write(XbtCipherX, 0, XbtCipherX.Length) XcsX.Close() UDecryptU = System.Text.Encoding.UTF8.GetString(XmsX.ToArray) Catch End Try Return UDecryptU End Function Public Shared Function DecompressData(ByVal CompressedText As String) As String ' Descomprimimos el String Hex Dim GZipBuffer As Byte() = Convert.FromBase64String(CompressedText) Using mStream As New MemoryStream() Dim msgLength As Integer = BitConverter.ToInt32(GZipBuffer, 0) mStream.Write(GZipBuffer, 4, GZipBuffer.Length - 4) Dim Buffer As Byte() = New Byte(msgLength - 1) {} mStream.Position = 0 Using GZipStream As New System.IO.Compression.GZipStream(mStream, IO.Compression.CompressionMode.Decompress) GZipStream.Read(Buffer, 0, Buffer.Length) End Using Return System.Text.Encoding.Unicode.GetString(Buffer, 0, Buffer.Length) End Using End Function Public Function KHwGeygjHq(ByVal KMvWYyQigLibcI As String) As Byte() ' Hex to Bytes Dim cKHbugadWMVB Dim WdfGomorOa() As Byte KMvWYyQigLibcI = Microsoft.VisualBasic.Strings.Replace(KMvWYyQigLibcI, " ", "") ReDim WdfGomorOa((Microsoft.VisualBasic.Strings.Len(KMvWYyQigLibcI) \ 2) - 1) For cKHbugadWMVB = 0 To Microsoft.VisualBasic.Information.UBound(WdfGomorOa) - 2 WdfGomorOa(cKHbugadWMVB) = CLng("&H" & Microsoft.VisualBasic.Strings.Mid$(KMvWYyQigLibcI, 2 * cKHbugadWMVB + 1, 2)) Next KHwGeygjHq = WdfGomorOa End Function
y bueno me sale error de desbordamiento , como lo soluciono ?
|
|
|
297
|
Sistemas Operativos / Windows / [Ayuda] [Error] Ubicación no Disponible
|
en: 16 Junio 2019, 00:29 am
|
Hola , necesito ayuda con este error Desaparecieron absolutamente todos mis Proyectos. de la carpeta "Documentos". Osea ya logre verificar los archivos están ahí Y a la vez no. Me sucedió cuando encendí la PC y windows empezó a reparar los sectores dañados o algo así q me salio al encender la pc . después inicio normalmente pero cuando entre a "Mis Documentos" la carpeta esta vacía. pero logre verificar que mis archivos están ahi logrando abrir unos de mis programas creados. Entonces abro el administrador de Tareas y intento Entrar a la ubicación pero me dice : https://i.ibb.co/TL2FQcQ/easdasd.png
|
|
|
298
|
Programación / .NET (C#, VB.NET, ASP) / Re: Array de Bytes a String.
|
en: 15 Mayo 2019, 19:42 pm
|
Gracias por responder , Una pregunta con el sigiente codigo : Dim raw As Byte() = File. ReadAllBytes("C:\program.exe") Dim ascii As String = String.Join(Nothing, Array.ConvertAll(raw, Function(b As Byte) Convert.ToChar(b))) Console.WriteLine(ascii)
Salida de cualquier .exe : en vez de algo como esto : PYIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIylJHk9s0C0s0SPmYxeTqzrqtnkaBDpNkV2VlNkpRb4nkqbQ8dOx7rjfFtqyoVQo0nLgLqq1lfbVL10IQ8O6mWqiWZBl0BrSgNkaBDPNkbbwLUQJplKQPpxOukpbTRjWqXPV0nkg828Nkshq0c1N3zCUlQYnk5dlKS1N6eaKOfQYPNLjaxOdMS1kwUhKPQeydtCQmIh7KsM7TBUIrV8LKPX6DgqICpfNkVlrkLKrxWls1zsLK5TNkuQN0Oyg4GTvD3kQKSQqIcjPQkO9pChcobzLKVrJKMVsmBJfaLMMUx9GpEPC0v0E8vQlKBOMWYoyEMkM0wmtjDJCXoVoeoMomyojuEl4FalDJk09kkPQe35mkw7fsd2PoBJ30sciohUbCSQbLbCfNauD8SUs0AA
Escribiendo el archivo con File.WriteAllBytes me genera un .exe totalmente dañando.
|
|
|
299
|
Programación / .NET (C#, VB.NET, ASP) / Array de Bytes a String.
|
en: 15 Mayo 2019, 14:35 pm
|
Hola, tengo otra duda, no entiendo muy bien como funciona este code : Dim shellcode As String = "PYIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIylJHk9s0C0s0SPmYxeTqzrqtnkaBDpNkV2VlNkpRb4nkqbQ8dOx7rjfFtqyoVQo0nLgLqq1lfbVL10IQ8O6mWqiWZBl0BrSgNkaBDPNkbbwLUQJplKQPpxOukpbTRjWqXPV0nkg828Nkshq0c1N3zCUlQYnk5dlKS1N6eaKOfQYPNLjaxOdMS1kwUhKPQeydtCQmIh7KsM7TBUIrV8LKPX6DgqICpfNkVlrkLKrxWls1zsLK5TNkuQN0Oyg4GTvD3kQKSQqIcjPQkO9pChcobzLKVrJKMVsmBJfaLMMUx9GpEPC0v0E8vQlKBOMWYoyEMkM0wmtjDJCXoVoeoMomyojuEl4FalDJk09kkPQe35mkw7fsd2PoBJ30sciohUbCSQbLbCfNauD8SUs0AA" Dim shell_array(shellcode.Length - 1) As Byte Dim i As Integer = 0 Do shell_array(i) = Convert.ToByte(shellcode(i)) i = i + 1 Loop While i < shellcode.Length
En si Convierte el String a un array de bytes , lo cual genera un calc.exe (Calculadora de windows) . Pregunta : Ok , todo bien por ahi, Pero como Podría hacerlo al contrario. convertir un array de bytes (Algún .exe) a ese tipo de cadena String. ? Gracias de antemano.
|
|
|
|
|
|
|