elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


  Mostrar Temas
Páginas: 1 2 3 4 5 6 7 8 [9] 10 11 12 13 14 15 16 17
81  Programación / .NET (C#, VB.NET, ASP) / VB.NET Overlay in Games Full Screen en: 22 Octubre 2018, 16:27 pm
Hola, Bueno mi duda es como haría yo para Sobreponer Un formulario encima de un juego Direcx En pantalla Completa, El compañero @Elektro lo logro con la api de SharpDX, Bueno yo he logrado casi lo mismo pero Con una api Direxc , he logrado hasta ahora sobreponer texto y dibujar en juegos en pantalla completa que usan direcx 9 ,  Ya puedo Simplemente dibujar un menu d3d y listo creo las funciones y hago un hack, pero no logro ni tengo idea de como sobreponer el Formulario. Necesito ayuda en eso.

La api que estoy usando :

DX9-Overlay-API

Documentación



Bueno y como siempre, yo no planteo nada sin algo de codigo :

Wrapper :

DX9Overlay.vb --- Clase


Código
  1. Imports System
  2. Imports System.Runtime.InteropServices
  3.  
  4. Namespace DX9OverlayAPI
  5.    Class DX9Overlay
  6.        Public Const PATH As String = "dx9_overlay.dll"
  7.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  8.        Public Shared Function TextCreate(ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean, ByVal x As Integer, ByVal y As Integer, ByVal color As UInteger, ByVal text As String, ByVal bShadow As Boolean, ByVal bShow As Boolean) As Integer
  9.        End Function
  10.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode)>
  11.        Public Shared Function TextCreateUnicode(ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean, ByVal x As Integer, ByVal y As Integer, ByVal color As UInteger, ByVal text As String, ByVal bShadow As Boolean, ByVal bShow As Boolean) As Integer
  12.        End Function
  13.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  14.        Public Shared Function TextDestroy(ByVal id As Integer) As Integer
  15.        End Function
  16.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  17.        Public Shared Function TextSetShadow(ByVal id As Integer, ByVal b As Boolean) As Integer
  18.        End Function
  19.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  20.        Public Shared Function TextSetShown(ByVal id As Integer, ByVal b As Boolean) As Integer
  21.        End Function
  22.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  23.        Public Shared Function TextSetColor(ByVal id As Integer, ByVal color As UInteger) As Integer
  24.        End Function
  25.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  26.        Public Shared Function TextSetPos(ByVal id As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  27.        End Function
  28.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  29.        Public Shared Function TextSetString(ByVal id As Integer, ByVal str As String) As Integer
  30.        End Function
  31.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode)>
  32.        Public Shared Function TextSetStringUnicode(ByVal id As Integer, ByVal str As String) As Integer
  33.        End Function
  34.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  35.        Public Shared Function TextUpdate(ByVal id As Integer, ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean) As Integer
  36.        End Function
  37.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Unicode)>
  38.        Public Shared Function TextUpdateUnicode(ByVal id As Integer, ByVal font As String, ByVal fontSize As Integer, ByVal bBold As Boolean, ByVal bItalic As Boolean) As Integer
  39.        End Function
  40.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  41.        Public Shared Function BoxCreate(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer, ByVal dwColor As UInteger, ByVal bShow As Boolean) As Integer
  42.        End Function
  43.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  44.        Public Shared Function BoxDestroy(ByVal id As Integer) As Integer
  45.        End Function
  46.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  47.        Public Shared Function BoxSetShown(ByVal id As Integer, ByVal bShown As Boolean) As Integer
  48.        End Function
  49.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  50.        Public Shared Function BoxSetBorder(ByVal id As Integer, ByVal height As Integer, ByVal bShown As Boolean) As Integer
  51.        End Function
  52.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  53.        Public Shared Function BoxSetBorderColor(ByVal id As Integer, ByVal dwColor As UInteger) As Integer
  54.        End Function
  55.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  56.        Public Shared Function BoxSetColor(ByVal id As Integer, ByVal dwColor As UInteger) As Integer
  57.        End Function
  58.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  59.        Public Shared Function BoxSetHeight(ByVal id As Integer, ByVal height As Integer) As Integer
  60.        End Function
  61.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  62.        Public Shared Function BoxSetPos(ByVal id As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  63.        End Function
  64.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  65.        Public Shared Function BoxSetWidth(ByVal id As Integer, ByVal width As Integer) As Integer
  66.        End Function
  67.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  68.        Public Shared Function LineCreate(ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer, ByVal width As Integer, ByVal color As UInteger, ByVal bShow As Boolean) As Integer
  69.        End Function
  70.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  71.        Public Shared Function LineDestroy(ByVal id As Integer) As Integer
  72.        End Function
  73.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  74.        Public Shared Function LineSetShown(ByVal id As Integer, ByVal bShown As Boolean) As Integer
  75.        End Function
  76.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  77.        Public Shared Function LineSetColor(ByVal id As Integer, ByVal color As UInteger) As Integer
  78.        End Function
  79.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  80.        Public Shared Function LineSetWidth(ByVal id As Integer, ByVal width As Integer) As Integer
  81.        End Function
  82.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  83.        Public Shared Function LineSetPos(ByVal id As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer) As Integer
  84.        End Function
  85.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  86.        Public Shared Function ImageCreate(ByVal path As String, ByVal x As Integer, ByVal y As Integer, ByVal rotation As Integer, ByVal align As Integer, ByVal bShow As Boolean) As Integer
  87.        End Function
  88.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  89.        Public Shared Function ImageDestroy(ByVal id As Integer) As Integer
  90.        End Function
  91.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  92.        Public Shared Function ImageSetShown(ByVal id As Integer, ByVal bShown As Boolean) As Integer
  93.        End Function
  94.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  95.        Public Shared Function ImageSetAlign(ByVal id As Integer, ByVal align As Integer) As Integer
  96.        End Function
  97.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  98.        Public Shared Function ImageSetPos(ByVal id As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  99.        End Function
  100.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  101.        Public Shared Function ImageSetRotation(ByVal id As Integer, ByVal rotation As Integer) As Integer
  102.        End Function
  103.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  104.        Public Shared Function DestroyAllVisual() As Integer
  105.        End Function
  106.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  107.        Public Shared Function ShowAllVisual() As Integer
  108.        End Function
  109.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  110.        Public Shared Function HideAllVisual() As Integer
  111.        End Function
  112.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  113.        Public Shared Function GetFrameRate() As Integer
  114.        End Function
  115.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  116.        Public Shared Function GetScreenSpecs(<Out> ByRef width As Integer, <Out> ByRef height As Integer) As Integer
  117.        End Function
  118.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  119.        Public Shared Function SetCalculationRatio(ByVal width As Integer, ByVal height As Integer) As Integer
  120.        End Function
  121.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  122.        Public Shared Function SetOverlayPriority(ByVal id As Integer, ByVal priority As Integer) As Integer
  123.        End Function
  124.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  125.        Public Shared Function Init() As Integer
  126.        End Function
  127.        <DllImport(PATH, CallingConvention:=CallingConvention.Cdecl)>
  128.        Public Shared Sub SetParam(ByVal _szParamName As String, ByVal _szParamValue As String)
  129.        End Sub
  130.    End Class
  131. End Namespace
  132.  

En el Form1, Un ejemplo de como Dibujar texto, Cuadro o linea :

Código
  1. Imports System
  2. Imports DX9OverlayAPI
  3.  
  4. Public Class Form1
  5.  
  6.    Shared overlayText As Integer = -1
  7.    Shared overlayBox As Integer = -1
  8.    Shared overlayLine As Integer = -1
  9.  
  10.    Private Sub texto()
  11.        DX9Overlay.SetParam("process", "hl2.exe")
  12.        DX9Overlay.DestroyAllVisual()
  13.        overlayText = DX9Overlay.TextCreateUnicode("Arial", 12, False, False, 200, 200, 4278255615, "Hello world!", True, True)
  14.    End Sub
  15.  
  16.    Private Sub linea()
  17.        DX9Overlay.SetParam("process", "hl2.exe")
  18.        DX9Overlay.DestroyAllVisual()
  19.        overlayLine = DX9Overlay.LineCreate(0, 0, 300, 300, 5, 4294967295, True)
  20.    End Sub
  21.  
  22.    Private Sub caja()
  23.        DX9Overlay.SetParam("process", "hl2.exe")
  24.        DX9Overlay.DestroyAllVisual()
  25.        overlayBox = DX9Overlay.BoxCreate(200, 200, 100, 100, 1358889215, True)
  26.    End Sub
  27.  
  28.    Private Sub eliminarTodo()
  29.        DX9Overlay.TextDestroy(overlayText)
  30.        DX9Overlay.BoxDestroy(overlayBox)
  31.        DX9Overlay.LineDestroy(overlayLine)
  32.    End Sub
  33.  
  34. End Class




Y bueno la .DLL no la agregan a referencias, solo la colocan en donde esta su .exe . osea en la carpeta .\bin\Debug\  DLL

Gracias de antemano, solo quiero superponer el Formulario no dibujar y no se como hacer eso.


PD : @Elektro Pasaste de Mod. Global a Colaborador? como @Shell Root? Colaborador no es un rango menor al q tenias? , que paso? tu eres el que mas ayuda al foro y te bajan de rango. están bien pendejos.

82  Programación / .NET (C#, VB.NET, ASP) / Convertir Cadena Hex a Bytes y compararlos Con Bytes de un archivo en: 13 Octubre 2018, 19:57 pm
Bueno hola foro, Como dice el titulo, tengo un Escanear Hexadecimal para identificar archivos, Pero es lento y segun me he documentado se puede mejorar si :

1) Convierto la cadena Hex a Bytes.

2) Obtengo los Bytes del archivo .

4) Comparo la Cadena Hex convertida a Bytes con los Bytes del archivo.




Bueno ahora lo que tengo hecho hasta ahora :


Cadena Hex Almacenada en una variable XML:

Código
  1. Dim xml = <?xml version="1.0"?>
  2.              <signatures>
  3.                  <signature>
  4.                      <name>Archivo1</name>
  5.                      <hex>58354f2150254041505b345c505a58353428505e2937434329377d2445494341522d5354414e4441</hex>
  6.                  </signature>
  7.                  <signature>
  8.                      <name>Archivo2</name>
  9.                      <hex>f649e7cc1e00d37e7f3bc85fff3486ac6de91433aa3a39ef1b114d37b534b8323f6ff67132638a3fe2f2afb4aaf9b7e3b4669bb3cab028298aab533c5d73546cdd396fd58c2c7734c50bca68eb709b889a086fb3db5f8ae533a4d5816e8c5f560983695efa14e291c204b1316e657773</hex>
  10.                  </signature>
  11.              </signatures>

Aquí el código para leer el XML y Convertirlo a Bytes:

Código
  1. Private Sub hexttoBytes()
  2.        Dim Str As New StringBuilder
  3.        For Each signature As XElement In xml.Root.Elements
  4.  
  5.            stringToByteArray(signature.<hex>.Value)
  6.  
  7.        Next
  8.  
  9.    End Sub
  10.  
  11.    Public Shared Function stringToByteArray(text As String) As Byte()
  12.        Dim bytes As Byte() = New Byte(text.Length \ 2 - 1) {}
  13.  
  14.        For i As Integer = 0 To text.Length - 1 Step 2
  15.            bytes(i \ 2) = Byte.Parse(text(i).ToString() & text(i + 1).ToString(), System.Globalization.NumberStyles.HexNumber)
  16.        Next
  17.  
  18.        Return bytes
  19.    End Function


Aquí el código para Obtener los Bytes del archivo a comparar

Código
  1.  ' Opendia IS OPENFILEDIALOG
  2.        Dim result As DialogResult = OpenDia.ShowDialog()
  3.  
  4.  
  5.        If result = Windows.Forms.DialogResult.OK Then
  6.  
  7.  
  8.            Dim path As String = OpenDia.FileName
  9.            Try
  10.  
  11.                Dim bytesFile As Byte() = File.ReadAllBytes(path)
  12.  
  13.                ' BytesFile es donde se almacenan Los Bytes del archivo a comparar
  14.                ' Necesito saber Como los Comparo con los Otros Bytes que antes eran HEX
  15.  
  16.            Catch ex As Exception
  17.  
  18.                MsgBox(ex.Message)
  19.  
  20.            End Try
  21.        End If
  22.  




AHORA LAS DUDAS, SEGÚN LO QUE TENGO ECHO ,  No logro Como hacer Para Comparar los Bytes que antes eran HEX con los Bytes del archivo. Lo que quiero lograr seria algo como esto :

Código
  1. 'Donde BytesFiles es el Archivo y BytesHex eran la Cadena Hex que ahora son Bytes
  2. ' En caso de que los Bytes sean Iguales. lanza el mensaje de que encontró el archivo o no.
  3. If bytesFile = BytesHex then
  4. Msgbox("Archivo Coincide")
  5. else
  6. Msgbox("Archivo No Coincide")
  7. end if

Gracias De Antemano

83  Programación / .NET (C#, VB.NET, ASP) / [Ayuda] Agrego el paquete NuGet "SharpDX" pero me da error. en: 3 Octubre 2018, 17:18 pm
En internet encontré  el sig código : 


Clase : "SharpDXRenderer"

Código
  1. Imports System
  2. Imports System.Windows.Forms
  3. Imports SharpDX
  4. Imports SharpDX.DXGI
  5. Imports SharpDX.Direct3D
  6. Imports SharpDX.Direct3D11
  7. Imports SharpDX.Direct2D1
  8. Imports SharpDX.Windows
  9. Imports SharpDX.Mathematics
  10. Imports Device = SharpDX.Direct3D11.Device
  11. Imports FactoryD2D = SharpDX.Direct2D1.Factory
  12. Imports FactoryDXGI = SharpDX.DXGI.Factory1
  13.  
  14.  
  15. Public Class SharpDXRenderer
  16.  
  17. #Region "Properties"
  18.  
  19. Private _showFPS As Boolean = False
  20. Public Property ShowFPS() As Boolean
  21. Get
  22. Return _showFPS
  23. End Get
  24. Set(ByVal value As Boolean)
  25. _showFPS = value
  26. End Set
  27. End Property
  28.  
  29. Private _renderWindow As New RenderForm
  30. Public Property RenderWindow As RenderForm
  31. Get
  32. Return _renderWindow
  33. End Get
  34. Set(value As RenderForm)
  35. _renderWindow = value
  36. End Set
  37. End Property
  38.  
  39. Private _renderWindowTitle As String = ""
  40. Public Property RenderWindowTitle As Integer
  41. Get
  42. Return Nothing
  43. End Get
  44. Set(value As Integer)
  45. End Set
  46. End Property
  47.  
  48. Private _renderWindowWidth As Integer = 800
  49. Public Property RenderWindowWidth() As String
  50. Get
  51. Return _renderWindowWidth
  52. End Get
  53. Set(ByVal value As String)
  54. _renderWindowWidth = value
  55. End Set
  56. End Property
  57.  
  58. Private _renderWindowHeight As Integer = 600
  59. Public Property RenderWindowHeight() As Integer
  60. Get
  61. Return _renderWindowHeight
  62. End Get
  63. Set(ByVal value As Integer)
  64. _renderWindowHeight = value
  65. End Set
  66. End Property
  67.  
  68. Private _isWindowed As Boolean = True
  69. Public Property IsWindowed() As Boolean
  70. Get
  71. Return _isWindowed
  72. End Get
  73. Set(ByVal value As Boolean)
  74. _isWindowed = value
  75. End Set
  76. End Property
  77.  
  78. Private _refreshRate As Integer = 60
  79. Public Property RefreshRate() As Integer
  80. Get
  81. Return _refreshRate
  82. End Get
  83. Set(ByVal value As Integer)
  84. _refreshRate = value
  85. End Set
  86. End Property
  87.  
  88. #End Region
  89.  
  90. ' **** Operational class level vars
  91. Dim device As Device
  92. Dim swapChain As SwapChain
  93. Dim renderTarget As RenderTarget
  94.  
  95.  
  96. Public Sub New()
  97.  
  98. 'nuttin atm
  99.  
  100. End Sub
  101.  
  102. Public Sub Initialize()
  103.  
  104. ' Create render target window
  105. _renderWindow.Text = _renderWindowTitle
  106.  
  107. ' Create swap chain description
  108. Dim swapChainDesc = New SwapChainDescription() With {
  109. .BufferCount = 2,
  110. .Usage = Usage.RenderTargetOutput,
  111. .OutputHandle = _renderWindow.Handle,
  112. .IsWindowed = _isWindowed,
  113. .ModeDescription = New ModeDescription(0, 0, New Rational(_refreshRate, 1), Format.R8G8B8A8_UNorm),
  114. .SampleDescription = New SampleDescription(1, 0),
  115. .Flags = SwapChainFlags.AllowModeSwitch,
  116. .SwapEffect = SwapEffect.Discard
  117. }
  118.  
  119. ' Create swap chain And Direct3D device
  120. ' The BgraSupport flag Is needed for Direct2D compatibility otherwise RenderTarget.FromDXGI will fail!
  121. Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.BgraSupport, swapChainDesc, device, swapChain)
  122.  
  123. ' Get back buffer in a Direct2D-compatible format (DXGI surface)
  124. Dim backBuffer As Surface = Surface.FromSwapChain(swapChain, 0)
  125.  
  126. 'Create Direct2D factory
  127. Using factory = New FactoryD2D()
  128. 'Get desktop DPI
  129. Dim dpi = factory.DesktopDpi
  130. 'Create bitmap render target from DXGI surface
  131. renderTarget = New RenderTarget(factory, backBuffer, New RenderTargetProperties() With {
  132. .DpiX = dpi.Width,
  133. .DpiY = dpi.Height,
  134. .MinLevel = SharpDX.Direct2D1.FeatureLevel.Level_DEFAULT,
  135. .PixelFormat = New PixelFormat(Format.Unknown, Direct2D1.AlphaMode.Ignore),
  136. .Type = RenderTargetType.[Default],
  137. .Usage = RenderTargetUsage.None
  138. })
  139. End Using
  140.  
  141. 'Disable automatic ALT+Enter processing because it doesn't work properly with WinForms
  142. Using factory = swapChain.GetParent(Of FactoryDXGI)()
  143. factory.MakeWindowAssociation(_renderWindow.Handle, WindowAssociationFlags.IgnoreAltEnter)
  144. End Using
  145.  
  146. ' Add event handler for ALT+Enter
  147. AddHandler _renderWindow.KeyDown, Sub(o, e)
  148.  If e.Alt AndAlso e.KeyCode = Keys.Enter Then
  149.  swapChain.IsFullScreen = Not swapChain.IsFullScreen
  150.  End If
  151.  End Sub
  152.  
  153. ' Set window size
  154. _renderWindow.Size = New System.Drawing.Size(_renderWindowWidth, _renderWindowHeight)
  155.  
  156. ' Prevent window from being re-sized
  157. _renderWindow.AutoSizeMode = AutoSizeMode.GrowAndShrink
  158.  
  159. End Sub
  160.  
  161. Public Sub RunRenderLoop()
  162.  
  163. Dim clock = New System.Diagnostics.Stopwatch()
  164. Dim clockFrequency = CDbl(System.Diagnostics.Stopwatch.Frequency)
  165. clock.Start()
  166. Dim deltaTime = 0.0
  167. Dim fpsTimer = New System.Diagnostics.Stopwatch()
  168. fpsTimer.Start()
  169. Dim fps = 0.0
  170. Dim fpsFrames As Integer = 0
  171.  
  172. RenderLoop.Run(_renderWindow, Function()
  173.  renderTarget.BeginDraw()
  174.  renderTarget.Transform = Matrix3x2.Identity
  175.  renderTarget.Clear(Color.DarkBlue)
  176.  
  177.  ' FPS display
  178.  Dim totalSeconds = clock.ElapsedTicks / clockFrequency
  179.  fpsFrames += 1
  180.  If fpsTimer.ElapsedMilliseconds > 1000 Then
  181.  fps = 1000 * fpsFrames / fpsTimer.ElapsedMilliseconds
  182.  If _showFPS Then
  183.  ' Update window title with FPS once every second
  184.  _renderWindow.Text = String.Format("D3DRendering D3D11.1 - FPS: {0:F2} ({1:F2}ms/frame)", fps, CSng(fpsTimer.ElapsedMilliseconds) / fpsFrames)
  185.  End If
  186.  ' Restart the FPS counter
  187.  fpsTimer.Reset()
  188.  fpsTimer.Start()
  189.  fpsFrames = 0
  190.  End If
  191.  
  192.  'Draw the frame
  193.  DrawFrame(renderTarget)
  194.  
  195.  renderTarget.EndDraw()
  196.  
  197.  swapChain.Present(0, PresentFlags.None)
  198.  
  199.  ' Determine the time it took to render the frame
  200.  deltaTime = (clock.ElapsedTicks / clockFrequency) - totalSeconds
  201.  
  202.  End Function)
  203.  
  204. renderTarget.Dispose()
  205. swapChain.Dispose()
  206. device.Dispose()
  207.  
  208. End Sub
  209.  
  210. Private Function DrawFrame(renderTarget As RenderTarget) As RenderTarget
  211.  
  212. renderTarget.DrawRectangle(New RectangleF(renderTarget.Size.Width / 2 - (Form1.WidthTB.Value / 2),
  213.  renderTarget.Size.Height / 2 - (Form1.HeightTB.Value / 2),
  214.  Form1.WidthTB.Value,
  215.  Form1.HeightTB.Value), New SolidColorBrush(renderTarget, Color.CornflowerBlue))
  216.  
  217. Return renderTarget
  218.  
  219. End Function
  220.  
  221. End Class



Bueno entonces abro mi VS he instalo la referencia de SharpDX . pero como verán me sale esto:



Entonces intento buscar por ejemplo la referencia que me sale que no tengo , por ejemplo : "SharpDX.Direct2D1" y me dice que ya tengo esa referencia en SharpDX que agregue, pero entonce por que me sale como si no la tuviera?




Gracias de Antemano!


84  Seguridad Informática / Análisis y Diseño de Malware / [BATCH] [APORTE] Virus . (Te hace pensar que agarraste ramsomware) en: 2 Octubre 2018, 19:13 pm
 YO Hice un virus simple que confunde los formatos por medio del registro. la cual causaba q no pudieras correr ningún formato .msi .exe .mp4 . no corría nada ni siquiera el administrador de tareas , ni siquiera el antivirus.



Bueno me desvíe del tema al que me refería :V . Bueno el virus del que hablaba es este:

Source code (ATENCION :  este virus puede llegar a ser peligroso , si le ponen una linea debilitando el registro y otra linea confundiendo los formatos .bat y otros formatos de ejecución puede a llegar a ser peligroso. (sin reparacion) ):

Código
  1. --- cura removida

Bueno cuando abran el Parche les pedirá una contraseña que es : 2111995 , Como ven el Ofusque el codigo fuente del Parche con la herramienta BatchCrypt , Perdon por no proporcionar el codigo desofuscado pero lo perdi y me da flojera ponerme a desofuscarlo . :v  :P

85  Programación / .NET (C#, VB.NET, ASP) / [SOURCE-CODE] RDYou - Radio, Youtube (Search) (Player) en: 11 Septiembre 2018, 00:44 am
Hola foro , ando perdido  ;D es que andaba de vacaciones :v y ahorita es que Empieza la universidad .

Bueno esto lo hice hace unos dias espero que les guste (Alfin aprendi a subir proyectos a Github wii  :D) :



La aplicación te permite escuchar música de Emisoras en línea, también tiene un sistema que te permite escuchar y mirar videos YOUTUBE.

caracteristicas:

* Poco consumo de RAM

* No causa retraso mientras juegas o trabajas.

* GUI comprensible y moderna

*Totalmente libre






Imagenes:








PD: A los amantes del Rock , Kpop, Pop y mas le gustara la radio! tiene exelente musica

PD: Porfa Comenten : "Duda", "Criticas Constructuvas" (Elektro) XD, lo que quieran!
86  Programación / .NET (C#, VB.NET, ASP) / [Ayuda] Descarga de personalización EO.Total en: 6 Septiembre 2018, 15:47 pm
Hola como dice en el titulo , ando trabajando con la sig. libreria :

https://www.essentialobjects.com/Download.aspx

y quiero costumizar una descarga, osea es un web control y al navegar y descargar algo se abre automáticamente un savefiledialog.

lo que quiero es costumizarlo y yo mismo obtener la informacion de  la descarga etc...




aka esta la documentación para hacerlo pero no entiendo :

https://www.essentialobjects.com/doc/webbrowser/customize/download.aspx

Necesito ayuda con algún código para guiarme . si algún guro de vb.net me puede ayudar! Gracias de antemano.  ;D

87  Programación / .NET (C#, VB.NET, ASP) / Ayuda con Scaneer Hexadecimal en: 3 Agosto 2018, 02:12 am
Bueno como dice el titulo. necesito ayuda con un escaner hex. Bueno pondré el code y de ultimo mis preguntas!

Bueno tengo un Listbox con el sig directorio de archivos:

Código:
C:\Users\S4LXenox\Desktop\Ransomware Wannacry - copia.exe
C:\Users\S4LXenox\Desktop\eicartest.exe
C:\Users\S4LXenox\Desktop\parite.exe

y con un boton escaneo cada archivo  del listbox :

code del boton:

Código
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.        listv.Items.Clear()
  3.        For abc = 0 To ListBox1.Items.Count - 1
  4.  
  5.             Scan(ListBox1.Items(a).ToString)
  6.  
  7.        Next abc
  8.    End Sub


Y aquí la Función de scaneo hex:

Código
  1.  
  2.  
  3. Dim xml = <?xml version="1.0"?>
  4.              <signatures>
  5.                  <signature>
  6.                      <name>Eicar-Test-Signature</name>
  7.                      <hex>58354f2150254041505b345c505a58353428505e2937434329377d2445494341522d5354414e4441</hex>
  8.                  </signature>
  9.                  <signature>
  10.                      <name>Hybris.Gen</name>
  11.                      <hex>f649e7cc1e00d37e7f3bc85fff3486ac6de91433aa3a39ef1b114d37b534b8323f6ff67132638a3fe2f2afb4aaf9b7e3b4669bb3cab028298aab533c5d73546cdd396fd58c2c7734c50bca68eb709b889a086fb3db5f8ae533a4d5816e8c5f560983695efa14e291c204b1316e657773</hex>
  12.                  </signature>
  13. </signatures>
  14.  
  15. Private Sub Scan(ByVal dir As String)
  16.  
  17.  
  18.        Dim myStreamReader As StreamReader = Nothing
  19.        myStreamReader = File.OpenText(dir)
  20.        InputString = myStreamReader.ReadToEnd()
  21.        ArrayHold = Encoding.Default.GetBytes(InputString)
  22.  
  23.        Do
  24.            IndexEnd = Index + 9
  25.  
  26.            For x As Integer = Index To IndexEnd
  27.  
  28.                If x > UBound(ArrayHold) Then
  29.                    tempStr = tempStr
  30.                Else
  31.                    tStr = UCase(Convert.ToString(ArrayHold(x), 16))
  32.  
  33.                    If tStr.Length < 2 Then tStr = "0" & tStr
  34.  
  35.                    Str.Append(tStr)
  36.                    tempStr = tempStr & Chr(ArrayHold(x))
  37.  
  38.                End If
  39.            Next
  40.  
  41.            Index = Index + 10
  42.        Loop While IndexEnd < UBound(ArrayHold)
  43.        For Each signature As XElement In xml.Root.Elements
  44.            If InStr(1, Str.ToString, signature.<hex>.Value, vbTextCompare) Then
  45.                listv.Items.Add(signature.<name>.Value)
  46.                If listv.Items.Count > 0 Then
  47.                    Label1.Text = "Virus"
  48.                Else
  49.                    Label1.Text = "No Virus"
  50.                End If
  51.            End If
  52.        Next
  53.  
  54.    End Sub



Bueno ahora mis dudas:

1) Cuando Utilizo el OPENFILEDIALOG En el botón y selecciono un virus el sacanner funciona y lo detecta! , Pero cuando coloco el directorio del virus en el listbox asi como puse arriba , el scanner no detecta nada! como corrigo eso?


2) Cuando intento escanear un archivo de mas de 10 mb tarda muchísimo! aunque eso se puede arreglar con un BackgrounWorker y asi no se pegue la app, pero no hay manera de hacer el escaneo hex mas rapido?

Bueno eso es todo, Gracias de antemano!
88  Programación / .NET (C#, VB.NET, ASP) / Buscar valores en el Registro de windows.... en: 21 Julio 2018, 03:11 am
Hola foro, Como dice el titulo quiero Buscar valores en el regedit,

Ejemplo :

Código:
Virus >> wscript.exe //B "C:\Users\S4LXenox\AppData\Local\Temp\VirusUSB.vbs"

agrego un virus que se auto inicio. por medio una app quiero Que si en el valor:

wscript.exe //B "C:\Users\S4LXenox\AppData\Local\Temp\VirusUSB.vbs"

sea detectado por mi app y me pregunte si quiere que elimine esa entrada, para el vbs no se ejecute.



Bueno lo primero que imagino es listar en un listbox mis app que se auto inician, Bueno eso es facil ya que es casi lo mismo que la duda que tenia hace tiempo de como verificar los programas instalados
(link).



1)   En-listo mis apps que se auto inician:

Código
  1. Imports Microsoft.Win32
  2.  
  3. Public Class Form1
  4.    Private Sub ListarHKCU()
  5.        Dim key As RegistryKey
  6.        Dim valueNames As String()
  7.        Dim currentUser As RegistryKey = Registry.CurrentUser
  8.        Dim name As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
  9.        Dim str2 As String = "Software\Microsoft\Windows\CurrentVersion\Runonce"
  10.        Try
  11.            key = currentUser.OpenSubKey(name, True)
  12.            valueNames = key.GetValueNames
  13.            Dim str3 As String
  14.            For Each str3 In valueNames
  15.                Try
  16.  
  17.                    ListBox1.Items.Add((str3 & " >> " & key.GetValue(str3).ToString))
  18.                Catch ex As Exception
  19.                End Try
  20.            Next
  21.        Catch ex As Exception
  22.        End Try
  23.        Try
  24.            key = currentUser.OpenSubKey(str2, True)
  25.            valueNames = key.GetValueNames
  26.            Dim str3 As String
  27.            For Each str3 In valueNames
  28.                Try
  29.                    ListBox1.Items.Add((str3 & " >> " & key.GetValue(str3).ToString))
  30.                Catch ex As Exception
  31.                End Try
  32.            Next
  33.        Catch ex As Exception
  34.        End Try
  35.    End Sub
  36.  
  37.  
  38.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  39.        ListBox1.Items.Clear()
  40.        ListarHKCU()
  41.    End Sub
  42. End Class


Lo segundo seria Buscar en ese listbox la cadena de texto "Wscript.exe"

Bueno en esta parte ya he intentado con : FindMyString pero no logra reconocer ese string.

Busque una solución algo floja, osea use un textbox en vez de el Listbox. y para detectar el virus use el siguiente codigo:

Código
  1. Dim APP_string As String() = {"wscript", "Cmd"}
  2.        For Each elemento As String In APP_string
  3.            If TextBox1.Text.Contains(elemento) Then
  4.                'AQUI VA EL CODIGO DEL MENSAJE Y LA OPCION PARA BORRAR EL VIRUS DEL REGISTRO
  5.            End If
  6.        Next

Ahora Es la parte en la que necesito ayuda, es en la que borra el auto inicio del vbs, osea borra esa entrada del regedit.



Bueno he puesto como lo he intentado haber si me pueden echar una mano.

Basicamente lo que quiero es Buscar en donde inician las app por medio del regedit :

Código:
SOFTWARE\Microsoft\Windows\CurrentVersion\Run

y hay busca archivos script , Que por lo general usan en los valores : "CMD /C" o "wscript.exe //B" para ejecutarse y cuando encuentre ese string en el regedit elimine esa entrada.

Gracias de antemano. si logro hacerlo lo posteare.


PD: Si se preguntan para que estoy haciendo esto , es por que llevo ya un tiempo desarrollando un motor de antiviurs . y apenas he logrado esto :
https://ibb.co/geS69J Cuando lo termine , (si es q lo termino subire el codigo fuente aqui)


89  Programación / Scripting / [BATCH] [APORTE] Batch Auto Hide Start [BAHS] en: 20 Julio 2018, 20:15 pm
Hola foro, Bueno les traigo un simple codigo que se me ocurrio al leer el siguiente post:

Una pregunta sencilla de BATCH

Bueno este simple código les sirve para  ejecutar su código batch Invisible. bueno aqui el batch :

Código
  1. @echo off
  2.  
  3. :Comandline
  4. IF ["%~1"]==["-e"] goto o
  5.  
  6. :Crear vbs
  7. set Batch=%~dpnx0
  8. (
  9. echo set objshell ^= createobject^("wscript.shell"^)
  10. echo objshell^.run "%Batch% -e"^,vbhide ) > %temp%\bas.vbs
  11. start %temp%\bas.vbs
  12. exit
  13.  
  14. :o
  15. ::::::::::::::::::::::::::::::::
  16. :: Tu código aquí...           :
  17. ::::::::::::::::::::::::::::::::

Bueno a decir verdad se abre la consola cuando crea el vbs, pero el vbs se encargara de ejecutar tu codigo invisible.



Aunque la mejor opción para hacer un batch invisible es convertirlo a .EXE , Les recomiendo mi sencilla app:

Posee:
*Ofuscacion del Batch
*Convertor bat to vbs y viceversa
*Convertor a .exe y mas


link: Link

Bueno espero que les sirva de algo este sencillo aporte.  :xD
90  Programación / .NET (C#, VB.NET, ASP) / Como detectar USB , Memorias SD y mostrar un aviso? en: 29 Junio 2018, 04:33 am
Buenas, Estoy intentando hacer una app que cuando alguien introduzca un Pendrive o Adaptador SD el programa lo detecte y te muestre un form 2 con un label que contenga la ruta del mismo. pero no logro hacerlo.

Me inmagino que debería definir las letras desde la A hasta la Z en un string saltándome las letras del dico local C y la D. que nunca son de algún dispositivo extraible.

en pocas palabras tengo 2 formularios, el primero detectara si algún dispositivo de almacenamiento extraible es conectado y cuando detecte alguno mostrara el formulario 2 que contendrá la ruta en un label. eso es lo que no logro hacer . :-\  si alguien tiene algún code que me facilite.

Gracias de antemano.
Páginas: 1 2 3 4 5 6 7 8 [9] 10 11 12 13 14 15 16 17
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines