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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 128
61  Programación / Programación Visual Basic / Enumerar carpetas de una carpeta compartida en: 26 Noviembre 2012, 10:36 am
Me estoy volviendo loco... :huh:
Necesito extraer todas las carpetas que contenga la carpeta compartida "\\micarpeta\".
Tan sólo para saber si existe ya he tenido problemas puesto que devuelve false utilizando métodos tradicionales. Eso lo he solucionado con api PathIsNetworkPath().

En cambio puedo listar las carpetas de una subcarpeta suya:
Código
  1. Private Sub Form_Load()
  2.    Dim f As Object, s
  3.  
  4.    Set f = CreateObject("Scripting.FileSystemObject")
  5.  
  6.    For Each s In f.GetFolder("\\micarpeta\hola").SubFolders
  7.        MsgBox s
  8.    Next
  9. End Sub

He encontrado los apis WNetEnumResource(), WNetOpenEnum(), WNetCloseEnum(), WNetOpenEnum().
Código:
http://allapi.mentalis.org/apilist/2AA74BB4AC857C52AD4BC7FA9E4DB1B7.html

Pero es extremaaaaaadamente lento... :(
Así que me comprometo a levantar un monumento a quién me sepa guiar/dar una solución. :-*

DoEvents! :P
62  Programación / Programación Visual Basic / Re: Saber si tengo permisos carpeta en: 26 Noviembre 2012, 10:28 am
Solucionado:
Código:
http://foro.elhacker.net/programacion_visual_basic/como_saber_si_un_directorio_puede_se_modificado-t301478.0.html

DoEvents! :P
63  Programación / Programación Visual Basic / Saber si tengo permisos carpeta en: 24 Noviembre 2012, 22:57 pm
Necesito saber si tengo permisos de escritura en una carpeta.
Se me ocurrió solucionarlo creando un archivo y controlando los errores, pero me parece demasiado feo.  :silbar:
¿Alguna idea?

Gracias.

DoEvents! :P
64  Programación / Desarrollo Web / [SRC] [javascript] Calculadora básica estilo Windows en: 16 Octubre 2012, 11:42 am
Código
  1.  
Sí, lo sé, las calculadoras están muy vistas, pero como lo tuve que hacer para clase de paso lo pongo aquí.

Código
  1. <html>
  2. <head>
  3. <style>
  4. input{
  5. width: 42px;
  6. }
  7.  
  8. #logs, #res, #igual{
  9. text-align: right;
  10. width: 180px;
  11. }
  12.  
  13. .op, #igual{
  14. text-align: center;
  15. }
  16. </style>
  17.  
  18. <script language="javascript">
  19. function getLastchar(){
  20. var mylogs = document.calc.logs.value;
  21. var len = mylogs.length;
  22.  
  23. if (len){
  24. return mylogs[len - 1];
  25. }
  26.  
  27. return "";
  28. }
  29.  
  30. function anadir(x){
  31. var logstext = document.calc.logs;
  32. var restext = document.calc.res;
  33.  
  34. if (logstext.value == "" && restext.value != ""){
  35. restext.value = "";
  36. }
  37.  
  38. if ((". ".indexOf(getLastchar()) > -1 && isNaN(x)) == false){
  39. if (x.indexOf(" ") > -1){
  40. calcular();
  41. }
  42.  
  43. logstext.value += x;
  44. }
  45. }
  46.  
  47. function quitar(){
  48. var logstext = document.calc.logs;
  49. var num = (getLastchar() == " ") ? 3: 1;
  50.  
  51. logstext.value = logstext.value.substring(0, logstext.value.length - num);
  52. }
  53.  
  54. function calcular() {
  55. document.calc.res.value = eval(document.calc.logs.value);
  56. }
  57.  
  58. function getResult(){
  59. if (getLastchar() == " "){
  60. document.calc.res.value = "Syntax error";
  61. } else {
  62. calcular();
  63. document.calc.logs.value = "";
  64. }
  65. }
  66. </script>
  67. </head>
  68.  
  69. <body>
  70. <form name="calc">
  71. <input type="text" id="logs" readonly="true"/>
  72. <br />
  73. <input type="text" id="res" readonly="true"/>
  74. <br />
  75.  
  76. <input type="button" value="1" onclick="anadir('1')" />
  77. <input type="button" value="2" onclick="anadir('2')" />
  78. <input type="button" value="3" onclick="anadir('3')" />
  79. <input type="button" value="&larr;" onclick="quitar()" />
  80. <br />
  81.  
  82. <input type="button" value="4" onclick="anadir('4')" />
  83. <input type="button" value="5" onclick="anadir('5')" />
  84. <input type="button" value="6" onclick="anadir('6')" />
  85. <input type="button" value="-" onclick="anadir(' - ')" />
  86. <br />
  87.  
  88. <input type="button" value="7" onclick="anadir('7')" />
  89. <input type="button" value="8" onclick="anadir('8')" />
  90. <input type="button" value="9" onclick="anadir('9')" />
  91. <input type="button" value="+" onclick="anadir(' + ')" />
  92. <br />
  93.  
  94. <input type="button" value="0" onclick="anadir('0')" />
  95. <input type="button" value="." onclick="anadir('.')" />
  96. <input type="button" value="*" onclick="anadir(' * ')" />
  97. <input type="button" value="/" onclick="anadir(' / ')" />
  98. <br />
  99.  
  100. <input type="button" id="igual" value="=" onclick="getResult()" />
  101. </form>
  102. </body>
  103. </html>

DoEvents! :P
65  Programación / Programación Visual Basic / Re: StrConv Alternative Function en: 12 Octubre 2012, 17:49 pm
Thanks for this mate I'll try it tonight but it use two APIs which is not a good thing, possible to remove/replace them?

Yes I think it's possible. :rolleyes:
May be loading an array of the unicode numbers and using CharUpperBuffW() and CharUpperBuffA() apis.
Here are some examples: vbspeed.

DoEvents! :P
66  Programación / Programación Visual Basic / Re: StrConv Alternative Function en: 12 Octubre 2012, 15:17 pm
Hello mate!  :D
I've done this function some years ago, I don't know if it works... actually, I don't remember if it came to work. :silbar:
I can't test it because in this PC I have only installed Ubuntu... :-\

Código
  1. Option Explicit
  2.  
  3. '// kernel32.dll
  4. Private Declare Function MultiByteToWideChar Lib "kernel32.dll" (ByVal CodePage As Long, ByVal dwFlags As Long, ByRef lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
  5. Private Declare Function WideCharToMultiByte Lib "kernel32.dll" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long, ByRef lpMultiByteStr As Any, ByVal cchMultiByte As Long, ByVal lpDefaultChar As String, ByVal lpUsedDefaultChar As Long) As Long
  6.  
  7. '// Const
  8. Private Const CP_UTF8                           As Long = &HFDE9 '65001
  9.  
  10. '// Enum
  11. Public Enum CONV_TYPE
  12.    Unicode = vbUnicode
  13.    UTF8 = vbFromUnicode
  14. End Enum
  15.  
  16. '// Function
  17. Public Function StrConversion(ByRef vEntry As Variant, eConv As CONV_TYPE) As Variant
  18. Dim lRet                                        As Long
  19. Dim lLen                                        As Long
  20. Dim lBuffer                                     As Long
  21. Dim sBuffer                                     As String
  22. Dim bvOutput()                                  As Byte
  23.  
  24.    On Error GoTo Exit_
  25.  
  26.    If eConv = Unicode Then
  27.        lLen = LenB(vEntry) \ 2
  28.  
  29.        If lLen Then
  30.            lBuffer = lLen + lLen + lLen + 1
  31.            ReDim bvOutput(lBuffer - 1) As Byte
  32.  
  33.            lRet = WideCharToMultiByte(CP_UTF8, 0, StrPtr(vEntry), lLen, bvOutput(0), lBuffer, vbNullString, 0)
  34.  
  35.            If lRet Then
  36.                ReDim Preserve bvOutput(lRet - 1) As Byte
  37.                StrConversion = bvOutput
  38.            End If
  39.        End If
  40.    Else
  41.        lLen = UBound(vEntry) + 1
  42.  
  43.        If lLen > 1 Then
  44.            lBuffer = lLen + lLen
  45.            sBuffer = Space$(lBuffer)
  46.  
  47.            lRet = MultiByteToWideChar(CP_UTF8, 0, vEntry(0), lLen, StrPtr(sBuffer), lBuffer)
  48.  
  49.            If lRet Then
  50.                StrConversion = Left$(sBuffer, lRet)
  51.            End If
  52.        End If
  53.    End If
  54.  
  55. Exit_:
  56. End Function

I hope it works, or at least it helps you to make your own function.
Good luck! ;)

DoEvents! :P
67  Programación / Programación Visual Basic / Re: [RETO] Adivinador de MsgBox en: 3 Octubre 2012, 12:59 pm
Jajajajajajaja. :laugh:

Podéis olvidar el reto, el caso es que un amigo me dijo que era TOTALMENTE IMPOSIBLE crear una función que verifique si un código ejecutará un un print o un MsgBox (le es indiferente) con "Hola Mundo".

Yo creo que es posible... :rolleyes:
Al menos lo del print, con Eval() y Instr() se podría solucionar.



Pero explicó mal el reto, lo que me quería plantear era esto (primera página):
Código:
http://es.scribd.com/doc/12929250/Indecidibilidad

El cual, obviamente, sí es imposible. :silbar:

DoEvents! :P
68  Programación / Programación Visual Basic / [RETO/FAKE] Adivinador de MsgBox en: 2 Octubre 2012, 20:51 pm
A ver quien hace una función que devuelva true si en el código de vb introducido se ejecutará un MsgBox o un Print con "Hola Mundo".

Estructura:
Código:
Private Function AdivinarMsgBox(ByVal sVBcode As String) As Boolean

Ejemplo de llamadas:

TRUE
Código:
Private Form Load()
   If 1<4 Then
      Msgbox "Hola Mundo"
   End If
End Sub

FALSE
Código:
Private Form Load()
      'Msgbox "Hola Mundo"
End Sub

TRUE
Código:
Private Form Load()
      Me.Print "Hola Mundo"
End Sub

FALSE
Código:
Private Form Load()
Dim a As Long, b As Long
   a=23
   b=234
  
   If a>b and 234>45634 Then
   if "asd" = "aasdsd" then
      Msgbox "Hola Mundo"
   end if
   End If
End Sub

Vale todo!

Suerte!
69  Programación / Desarrollo Web / XMPP Chat Visitante-Servidor [Duda] en: 25 Septiembre 2012, 12:12 pm
Estoy intentando crear un chat visitante-administrador, algo similar a lo que podemos encontrar (abajo a la derecha) en esta web:
Código:
http://www.orbitadigital.com/
Ese en concreto es de ZOPIM
Código:
www.zopim.com
Un vídeo explicativo:


El caso es que el visitante envía un mensaje al administrador, quien los recibe y los contesta por medio de un cliente de mensajería XMPP, como por ejemplo GTalk, Skype, Msn...

Mi duda es... ¿cómo envía y recibe el visitante si no ingresa ninguna información para logearse a un cliente XMPP?
¿Conocéis algún ejemplo así de código abierto que sea (más o menos) sencillo de entender?
Si no es así... ¿Se os ocurre alguna alternativa a esto?

Gracias
DoEvents! :P
70  Programación / Programación Visual Basic / Re: Cliente Twitter en: 14 Septiembre 2012, 11:47 am
Del modo en el que lo hizo Karcrack ya no funcionará. Cambio el API de Twitter.

DoEvents! :P
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 128
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines