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

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Temas
Páginas: 1 ... 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 [94] 95 96 97 98 99 100 101 102 103 104 105
931  Sistemas Operativos / Windows / (Solucionado) Crear un archivo desde el menú contextual con contenido escrito? en: 21 Marzo 2012, 18:56 pm
Hola

Se me ha ocurrido que estaría muy bien por ejemplo para los que practicamos mucho scripting... Que al usar la opción del menú contextual "Nuevo > archivo de texto" se creara el archivo con un contenido de texto dentro (Personalizado)... Como si fuese una plantilla vamos.

Por ejemplo "Nuevo > Archivo bat" y dentro del bat por defecto:

Código
  1. @Echo off

Creo que debe haber alguna opción en el registro de Windows para poder hacerlo...

¿Alguien sabe algo?

EDITO:
Ya lo he conseguido, Solo hay que crear una clave de nombre "Data" y de valor "SZ" o "BINARY" y colocar el texto
Pero tiene una limitación, No se pueden agregar saltos de linea, me refiero a lineas vacías... Quizás si, pero no se hacerlo.

Un saludo
932  Programación / Scripting / [BATCH] [APORTE] MouseXY (Devuelve las coordenadas del mouse) en: 21 Marzo 2012, 13:39 pm
No es un Bat, Pero es una herramienta commandline para Windows que devuelve la posición del mouse. Sirve para usarla en un bat.



Hay 2 versiones:

1ª.
x64:
x86:
Esta versión devuelve la posición una sola vez.



http://www.mediafire.com/?koxk9r3tykf1tad
Esta versión devuelve la posición en un ciclo infinito.


EDITO: Los links me los borran de todos los servers, será mejor que lo conviertan a exe ustedes mismos.

Salu2


El script original desde el cual he compilado la versión x64 es este:

Código
  1. # Python
  2. # Script original: http://www.daniweb.com/software-development/python/code/230886/get-the-mouse-position-on-the-screen-on-linux
  3.  
  4. import ctypes as ct
  5. import os, time
  6.  
  7. class GetPoint(ct.Structure):
  8.    _fields_ = [("x", ct.c_ulong), ("y", ct.c_ulong)]
  9.  
  10. def get_mousepos():
  11.    pt = GetPoint()
  12.    ct.windll.user32.GetCursorPos(ct.byref(pt))
  13.    return int(pt.x), int(pt.y)
  14.  
  15. os.system('Title Mouse XY coordenates MOD by Elektro H@cker')
  16.  
  17. infinito = 1
  18. while infinito == 1 :
  19. time.sleep(0.10)
  20. os.system('cls')
  21. print( "x=%d, y=%d" % get_mousepos() )
  22. show()

- El script original desde el cual he compilado la versión x86 es este:

Código
  1. # Ruby
  2. # Script original: http://www.tobiasbraner.de/2011/07/04/windows-get-the-mouse-position-with-ruby/
  3.  
  4.  
  5. require 'Win32API'
  6. exit if Object.const_defined?(:Ocra)
  7.  
  8. infinito = 1
  9. getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
  10. lpPoint = " " * 8
  11. system('Title MouseXY MOD By Elektro H@cker')
  12.  
  13. while infinito == 1
  14.  system('cls')
  15.  getCursorPos.Call(lpPoint)
  16.  x, y = lpPoint.unpack("LL")
  17.  print "X:", x, " Y:", y,""
  18.  sleep 0.15
  19. end
  20.  
  21. # Fin
933  Programación / Scripting / [BATCH] [APORTE] BatOfuser Ofuscador/Desofuscador para bats. en: 21 Marzo 2012, 12:02 pm
BatOfuser
    By Elektro H@cker



Esto es un versión experimental, La he probado con varios scripts y funciona. También sirve para ofuscar texto plano y supongo que con otros formatos también debería funcionar.

Me ha costado bastante esfuerzo realizar un ofuscador sin usar la expansion (Todos los ofuscadores de bats que he visto la usan, Y eso conlleva incompatibilidad con algunos caracteres)

Este ofuscador soporta muchos, muchos más caracteres que otro ofuscador (Hecho en batch) convencional.

Errores conocidos:

        Si una linea del script contiene un número impar de comilals dobles (Debido a una mala sintaxis del usuario) esa línea no se llegará a ofuscar correctamente, Asegurense de cerrar las comillas en sus códigos.
        Elcaracter del escape ^ se desofusca 2 veces SI NO SE TRATA DE UN .BAT

Espero que lo disfruten.

Salu2

PD: En cuanto pueda, El proyecto lo codearé en Ruby para eliminar de golpe los errores y agregar una mejor compatibilidad sobre los caracteres utf-8, Y de paso lo compilaré para Windows para poder usar el ofuscador por linea de comandos, Como una herramienta más.



Test.bat

Código
  1. @echo off
  2. Title BatOfuser Test
  3. REM Elektro H@cker
  4. REM Visita: Foro.ElHacker.Net
  5. CHCP 1252 >NUL
  6. Echo: 0123456789
  7. Echo: abcdefghijklmnopqrstuvwxyz
  8. Echo: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  9. Echo: áéíóú àèìòù ÁÉÍÓÚ ÀÈÌÒÙ äëïöü ÄËÏÖÜ ñ Ñ ª º · ¿ ¡ '
  10. Echo: \|@#~!$%&/()=?<>:;,.-_+*[]{}`'^^ ""


BatOfuser.bat

Código:
@Echo OFF
Title BatOfuser

REM By Elektro H@cker
:: Visita: Foro.elhacker.net

Mode con cols=108 lines=25
NirCMD Win Center Ititle "BatOfuser" >NUL 2>&1
REM chcp 1252 >NUL

:Logo
Echo+
Echo: 88888888ba                          ,ad8888ba,       ad88
Echo: 88      "8b                ,d      d8"'    `"8b     d8"
Echo: 88      ,8P                88     d8'        `8b    88
Echo: 88aaaaaa8P'  ,adPPYYba,  MM88MMM  88          88  MM88MMM  88       88  ,adPPYba,   ,adPPYba,  8b,dPPYba,
Echo: 88""""""8b,  ""     `Y8    88     88          88    88     88       88  I8[    ""  a8P_____88  88P'   "Y8
Echo: 88      `8b  ,adPPPPP88    88     Y8,        ,8P    88     88       88   `"Y8ba,   8PP"""""""  88
Echo: 88      a8P  88,    ,88    88,     Y8a.    .a8P     88     "8a,   ,a88  aa    ]8I  "8b,   ,aa  88
Echo: 88888888P"   `"8bbdP"Y8    "Y888    `"Y8888Y"'      88      `"YbbdP'Y8  `"YbbdP"'   `"Ybbd8"'  88
Echo+
Echo: By Elektro H@cker
Echo+
Echo: ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
Goto :Menu

:Charlist
Set "Alpha=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Set "Numeric=0123456789"
Set "Special=\|@#~!$%&/()=?<>;,.-_+*[]{}`'^^":
Set "Special_UTF8=…‚¡¢£…ŠÖ•—µ‚Öàé·ÔÞã뎉‹”šŽÓØ™š¤¥¦§ú¨­ï"
Rem Special_UTF8= áéíóú àèìòù ÁÉÍÓÚ ÀÈÌÒÙ äëïöü ÄËÏÖÜ ñ Ñ ª º · ¿ ¡ '

:Menu
Echo+
Echo: Arrastra a la ventana el archivo que quieres ofuscar/desofuscar... | More
Set /P Archivo=^>^>^>
If not defined archivo (Goto :Menu)
Type %archivo%| Find "By Elektro H@cker" >NUL 2>&1
If %Errorlevel% EQU 0 (Goto :Desofuscador)
Cls




:::::::::::::::::
:Ofuscador
:::::::::::::::::

:Lineas
Set Linea=0
For /F "Tokens=*" %%a in ('Type %Archivo% ^| Find /V /C ""') do (Set Total=%%a)

:Leer_Ofuscador
If "%linea%" EQU "%total%" (Goto :Fin_Ofuscador)

For /F "Tokens=*" %%a in ('Type %Archivo% ^| MORE +%Linea%') do (
    Echo: Ofuscando: "%%a"
    Set /A Linea+=1
    Set "String=%%a"
    If not defined string (Goto :Leer_Ofuscador)
    Echo %%a>"%TEMP%\String.tmp"
    FOR %%? IN (%TEMP%\String.tmp) DO ( SET /A Longitud=%%~z? - 2 )
    Goto :Ofuscar
)




::::::::::::::::::::::
:Desofuscador
::::::::::::::::::::::

:Lineas
Set Linea=0
For /F "Tokens=*" %%a in ('Type %Archivo% ^| Find /V /C ""') do (Set Total=%%a)


:Leer_Desofuscador
For /F "Tokens=*" %%a in ('Type %Archivo% ^| MORE /E +%Linea%') do (
    Set /A Linea+=1
    Set "String=%%a"
    Goto :Desofuscar
)




:Ofuscar


If "%Count%" EQU "%Longitud%" (
    call :Write_Ofuscador
    Goto :Leer_Ofuscador)

::Comilladoble
Set "String=%String:"=€%"& rem "

::Espacio
If "%String:~0,1%" EQU " " (Set "New_String=%New_String% ")

::Alpha
If "%String:~0,1%" EQU "a" (Set "New_String=%New_String%%%Alpha:~0,1%%")
If "%String:~0,1%" EQU "b" (Set "New_String=%New_String%%%Alpha:~1,1%%")
If "%String:~0,1%" EQU "c" (Set "New_String=%New_String%%%Alpha:~2,1%%")
If "%String:~0,1%" EQU "d" (Set "New_String=%New_String%%%Alpha:~3,1%%")
If "%String:~0,1%" EQU "e" (Set "New_String=%New_String%%%Alpha:~4,1%%")
If "%String:~0,1%" EQU "f" (Set "New_String=%New_String%%%Alpha:~5,1%%")
If "%String:~0,1%" EQU "g" (Set "New_String=%New_String%%%Alpha:~6,1%%")
If "%String:~0,1%" EQU "h" (Set "New_String=%New_String%%%Alpha:~7,1%%")
If "%String:~0,1%" EQU "i" (Set "New_String=%New_String%%%Alpha:~8,1%%")
If "%String:~0,1%" EQU "j" (Set "New_String=%New_String%%%Alpha:~9,1%%")
If "%String:~0,1%" EQU "k" (Set "New_String=%New_String%%%Alpha:~10,1%%")
If "%String:~0,1%" EQU "l" (Set "New_String=%New_String%%%Alpha:~11,1%%")
If "%String:~0,1%" EQU "m" (Set "New_String=%New_String%%%Alpha:~12,1%%")
If "%String:~0,1%" EQU "n" (Set "New_String=%New_String%%%Alpha:~13,1%%")
If "%String:~0,1%" EQU "o" (Set "New_String=%New_String%%%Alpha:~14,1%%")
If "%String:~0,1%" EQU "p" (Set "New_String=%New_String%%%Alpha:~15,1%%")
If "%String:~0,1%" EQU "q" (Set "New_String=%New_String%%%Alpha:~16,1%%")
If "%String:~0,1%" EQU "r" (Set "New_String=%New_String%%%Alpha:~17,1%%")
If "%String:~0,1%" EQU "s" (Set "New_String=%New_String%%%Alpha:~18,1%%")
If "%String:~0,1%" EQU "t" (Set "New_String=%New_String%%%Alpha:~19,1%%")
If "%String:~0,1%" EQU "u" (Set "New_String=%New_String%%%Alpha:~20,1%%")
If "%String:~0,1%" EQU "v" (Set "New_String=%New_String%%%Alpha:~21,1%%")
If "%String:~0,1%" EQU "w" (Set "New_String=%New_String%%%Alpha:~22,1%%")
If "%String:~0,1%" EQU "x" (Set "New_String=%New_String%%%Alpha:~23,1%%")
If "%String:~0,1%" EQU "y" (Set "New_String=%New_String%%%Alpha:~24,1%%")
If "%String:~0,1%" EQU "z" (Set "New_String=%New_String%%%Alpha:~25,1%%")
If "%String:~0,1%" EQU "A" (Set "New_String=%New_String%%%Alpha:~26,1%%")
If "%String:~0,1%" EQU "B" (Set "New_String=%New_String%%%Alpha:~27,1%%")
If "%String:~0,1%" EQU "C" (Set "New_String=%New_String%%%Alpha:~28,1%%")
If "%String:~0,1%" EQU "D" (Set "New_String=%New_String%%%Alpha:~29,1%%")
If "%String:~0,1%" EQU "E" (Set "New_String=%New_String%%%Alpha:~30,1%%")
If "%String:~0,1%" EQU "F" (Set "New_String=%New_String%%%Alpha:~31,1%%")
If "%String:~0,1%" EQU "G" (Set "New_String=%New_String%%%Alpha:~32,1%%")
If "%String:~0,1%" EQU "H" (Set "New_String=%New_String%%%Alpha:~33,1%%")
If "%String:~0,1%" EQU "I" (Set "New_String=%New_String%%%Alpha:~34,1%%")
If "%String:~0,1%" EQU "J" (Set "New_String=%New_String%%%Alpha:~35,1%%")
If "%String:~0,1%" EQU "K" (Set "New_String=%New_String%%%Alpha:~36,1%%")
If "%String:~0,1%" EQU "L" (Set "New_String=%New_String%%%Alpha:~37,1%%")
If "%String:~0,1%" EQU "M" (Set "New_String=%New_String%%%Alpha:~38,1%%")
If "%String:~0,1%" EQU "N" (Set "New_String=%New_String%%%Alpha:~39,1%%")
If "%String:~0,1%" EQU "O" (Set "New_String=%New_String%%%Alpha:~40,1%%")
If "%String:~0,1%" EQU "P" (Set "New_String=%New_String%%%Alpha:~41,1%%")
If "%String:~0,1%" EQU "Q" (Set "New_String=%New_String%%%Alpha:~42,1%%")
If "%String:~0,1%" EQU "R" (Set "New_String=%New_String%%%Alpha:~43,1%%")
If "%String:~0,1%" EQU "S" (Set "New_String=%New_String%%%Alpha:~44,1%%")
If "%String:~0,1%" EQU "T" (Set "New_String=%New_String%%%Alpha:~45,1%%")
If "%String:~0,1%" EQU "U" (Set "New_String=%New_String%%%Alpha:~46,1%%")
If "%String:~0,1%" EQU "V" (Set "New_String=%New_String%%%Alpha:~47,1%%")
If "%String:~0,1%" EQU "W" (Set "New_String=%New_String%%%Alpha:~48,1%%")
If "%String:~0,1%" EQU "X" (Set "New_String=%New_String%%%Alpha:~49,1%%")
If "%String:~0,1%" EQU "Y" (Set "New_String=%New_String%%%Alpha:~50,1%%")
If "%String:~0,1%" EQU "Z" (Set "New_String=%New_String%%%Alpha:~51,1%%")

::Numeric
If "%String:~0,1%" EQU "0" (Set "New_String=%New_String%%%Numeric:~0,1%%")
If "%String:~0,1%" EQU "1" (Set "New_String=%New_String%%%Numeric:~1,1%%")
If "%String:~0,1%" EQU "2" (Set "New_String=%New_String%%%Numeric:~2,1%%")
If "%String:~0,1%" EQU "3" (Set "New_String=%New_String%%%Numeric:~3,1%%")
If "%String:~0,1%" EQU "4" (Set "New_String=%New_String%%%Numeric:~4,1%%")
If "%String:~0,1%" EQU "5" (Set "New_String=%New_String%%%Numeric:~5,1%%")
If "%String:~0,1%" EQU "6" (Set "New_String=%New_String%%%Numeric:~6,1%%")
If "%String:~0,1%" EQU "7" (Set "New_String=%New_String%%%Numeric:~7,1%%")
If "%String:~0,1%" EQU "8" (Set "New_String=%New_String%%%Numeric:~8,1%%")
If "%String:~0,1%" EQU "9" (Set "New_String=%New_String%%%Numeric:~9,1%%")

::Special_UTF8
If "%String:~0,1%" EQU "á" (Set "New_String=%New_String%%%Special_UTF8:~0,1%%")
If "%String:~0,1%" EQU "é" (Set "New_String=%New_String%%%Special_UTF8:~1,1%%")
If "%String:~0,1%" EQU "í" (Set "New_String=%New_String%%%Special_UTF8:~2,1%%")
If "%String:~0,1%" EQU "ó" (Set "New_String=%New_String%%%Special_UTF8:~3,1%%")
If "%String:~0,1%" EQU "ú" (Set "New_String=%New_String%%%Special_UTF8:~4,1%%")
If "%String:~0,1%" EQU "à" (Set "New_String=%New_String%%%Special_UTF8:~5,1%%")
If "%String:~0,1%" EQU "è" (Set "New_String=%New_String%%%Special_UTF8:~6,1%%")
If "%String:~0,1%" EQU "ì" (Set "New_String=%New_String%%%Special_UTF8:~7,1%%")
If "%String:~0,1%" EQU "ò" (Set "New_String=%New_String%%%Special_UTF8:~8,1%%")
If "%String:~0,1%" EQU "ù" (Set "New_String=%New_String%%%Special_UTF8:~9,1%%")
If "%String:~0,1%" EQU "Á" (Set "New_String=%New_String%%%Special_UTF8:~10,1%%")
If "%String:~0,1%" EQU "É" (Set "New_String=%New_String%%%Special_UTF8:~11,1%%")
If "%String:~0,1%" EQU "Í" (Set "New_String=%New_String%%%Special_UTF8:~12,1%%")
If "%String:~0,1%" EQU "Ó" (Set "New_String=%New_String%%%Special_UTF8:~13,1%%")
If "%String:~0,1%" EQU "Ú" (Set "New_String=%New_String%%%Special_UTF8:~14,1%%")
If "%String:~0,1%" EQU "À" (Set "New_String=%New_String%%%Special_UTF8:~15,1%%")
If "%String:~0,1%" EQU "È" (Set "New_String=%New_String%%%Special_UTF8:~16,1%%")
If "%String:~0,1%" EQU "Ì" (Set "New_String=%New_String%%%Special_UTF8:~17,1%%")
If "%String:~0,1%" EQU "Ò" (Set "New_String=%New_String%%%Special_UTF8:~18,1%%")
If "%String:~0,1%" EQU "Ù" (Set "New_String=%New_String%%%Special_UTF8:~19,1%%")
If "%String:~0,1%" EQU "ä" (Set "New_String=%New_String%%%Special_UTF8:~20,1%%")
If "%String:~0,1%" EQU "ë" (Set "New_String=%New_String%%%Special_UTF8:~21,1%%")
If "%String:~0,1%" EQU "ï" (Set "New_String=%New_String%%%Special_UTF8:~22,1%%")
If "%String:~0,1%" EQU "ö" (Set "New_String=%New_String%%%Special_UTF8:~23,1%%")
If "%String:~0,1%" EQU "ü" (Set "New_String=%New_String%%%Special_UTF8:~24,1%%")
If "%String:~0,1%" EQU "Ä" (Set "New_String=%New_String%%%Special_UTF8:~25,1%%")
If "%String:~0,1%" EQU "Ë" (Set "New_String=%New_String%%%Special_UTF8:~26,1%%")
If "%String:~0,1%" EQU "Ï" (Set "New_String=%New_String%%%Special_UTF8:~27,1%%")
If "%String:~0,1%" EQU "Ö" (Set "New_String=%New_String%%%Special_UTF8:~28,1%%")
If "%String:~0,1%" EQU "Ü" (Set "New_String=%New_String%%%Special_UTF8:~29,1%%")
If "%String:~0,1%" EQU "ñ" (Set "New_String=%New_String%%%Special_UTF8:~30,1%%")
If "%String:~0,1%" EQU "Ñ" (Set "New_String=%New_String%%%Special_UTF8:~31,1%%")
If "%String:~0,1%" EQU "ª" (Set "New_String=%New_String%%%Special_UTF8:~32,1%%")
If "%String:~0,1%" EQU "º" (Set "New_String=%New_String%%%Special_UTF8:~33,1%%")
If "%String:~0,1%" EQU "·" (Set "New_String=%New_String%%%Special_UTF8:~34,1%%")
If "%String:~0,1%" EQU "¿" (Set "New_String=%New_String%%%Special_UTF8:~35,1%%")
If "%String:~0,1%" EQU "¡" (Set "New_String=%New_String%%%Special_UTF8:~36,1%%")
If "%String:~0,1%" EQU "´" (Set "New_String=%New_String%%%Special_UTF8:~37,1%%")

::Special
If "%String:~0,1%" EQU "€" (Set "New_String=%New_String%€")
If "%String:~0,1%" EQU "\" (Set "New_String=%New_String%%%Special:~0,1%%")
If "%String:~0,1%" EQU "|" (Set "New_String=%New_String%%%Special:~1,1%%")
If "%String:~0,1%" EQU "@" (Set "New_String=%New_String%%%Special:~2,1%%")
If "%String:~0,1%" EQU "#" (Set "New_String=%New_String%%%Special:~3,1%%")
If "%String:~0,1%" EQU "~" (Set "New_String=%New_String%%%Special:~4,1%%")
If "%String:~0,1%" EQU "!" (Set "New_String=%New_String%%%Special:~5,1%%")
If "%String:~0,1%" EQU "$" (Set "New_String=%New_String%%%Special:~6,1%%")
If "%String:~0,1%" EQU "%%" (Set "New_String=%New_String%%%Special:~7,1%%")
If "%String:~0,1%" EQU "&" (Set "New_String=%New_String%%%Special:~8,1%%")
If "%String:~0,1%" EQU "/" (Set "New_String=%New_String%%%Special:~9,1%%")
If "%String:~0,1%" EQU "(" (Set "New_String=%New_String%%%Special:~10,1%%")
If "%String:~0,1%" EQU ")" (Set "New_String=%New_String%%%Special:~11,1%%")
If "%String:~0,1%" EQU "=" (Set "New_String=%New_String%%%Special:~12,1%%")
If "%String:~0,1%" EQU "?" (Set "New_String=%New_String%%%Special:~13,1%%")
If "%String:~0,1%" EQU "<" (Set "New_String=%New_String%%%Special:~14,1%%")
If "%String:~0,1%" EQU ">" (Set "New_String=%New_String%%%Special:~15,1%%")
If "%String:~0,1%" EQU ";" (Set "New_String=%New_String%%%Special:~16,1%%")
If "%String:~0,1%" EQU "," (Set "New_String=%New_String%%%Special:~17,1%%")
If "%String:~0,1%" EQU "." (Set "New_String=%New_String%%%Special:~18,1%%")
If "%String:~0,1%" EQU "-" (Set "New_String=%New_String%%%Special:~19,1%%")
If "%String:~0,1%" EQU "_" (Set "New_String=%New_String%%%Special:~20,1%%")
If "%String:~0,1%" EQU "+" (Set "New_String=%New_String%%%Special:~21,1%%")
If "%String:~0,1%" EQU "*" (Set "New_String=%New_String%%%Special:~22,1%%")
If "%String:~0,1%" EQU "[" (Set "New_String=%New_String%%%Special:~23,1%%")
If "%String:~0,1%" EQU "]" (Set "New_String=%New_String%%%Special:~24,1%%")
If "%String:~0,1%" EQU "{" (Set "New_String=%New_String%%%Special:~25,1%%")
If "%String:~0,1%" EQU "}" (Set "New_String=%New_String%%%Special:~26,1%%")
If "%String:~0,1%" EQU "`" (Set "New_String=%New_String%%%Special:~27,1%%")
If "%String:~0,1%" EQU "'" (Set "New_String=%New_String%%%Special:~28,1%%")
If "%String:~0,1%" EQU "^" (Set "New_String=%New_String%%%Special:~29,1%%")
If "%String:~0,1%" EQU ":" (Set "New_String=%New_String%%%Special:~30,1%%")

Set "String=%String:~1%"
Set /A Count+=1
Goto :Ofuscar




:Desofuscar

::Alpha
Set "String=%String:Alpha:~0,1=a%"
Set "String=%String:Alpha:~1,1=b%"
Set "String=%String:Alpha:~2,1=c%"
Set "String=%String:Alpha:~3,1=d%"
Set "String=%String:Alpha:~4,1=e%"
Set "String=%String:Alpha:~5,1=f%"
Set "String=%String:Alpha:~6,1=g%"
Set "String=%String:Alpha:~7,1=h%"
Set "String=%String:Alpha:~8,1=i%"
Set "String=%String:Alpha:~9,1=j%"
Set "String=%String:Alpha:~10,1=k%"
Set "String=%String:Alpha:~11,1=l%"
Set "String=%String:Alpha:~12,1=m%"
Set "String=%String:Alpha:~13,1=n%"
Set "String=%String:Alpha:~14,1=o%"
Set "String=%String:Alpha:~15,1=p%"
Set "String=%String:Alpha:~16,1=q%"
Set "String=%String:Alpha:~17,1=r%"
Set "String=%String:Alpha:~18,1=s%"
Set "String=%String:Alpha:~19,1=t%"
Set "String=%String:Alpha:~20,1=u%"
Set "String=%String:Alpha:~21,1=v%"
Set "String=%String:Alpha:~22,1=w%"
Set "String=%String:Alpha:~23,1=x%"
Set "String=%String:Alpha:~24,1=y%"
Set "String=%String:Alpha:~25,1=z%"
Set "String=%String:Alpha:~26,1=A%"
Set "String=%String:Alpha:~27,1=B%"
Set "String=%String:Alpha:~28,1=C%"
Set "String=%String:Alpha:~29,1=D%"
Set "String=%String:Alpha:~30,1=E%"
Set "String=%String:Alpha:~31,1=F%"
Set "String=%String:Alpha:~32,1=G%"
Set "String=%String:Alpha:~33,1=H%"
Set "String=%String:Alpha:~34,1=I%"
Set "String=%String:Alpha:~35,1=J%"
Set "String=%String:Alpha:~36,1=K%"
Set "String=%String:Alpha:~37,1=L%"
Set "String=%String:Alpha:~38,1=M%"
Set "String=%String:Alpha:~39,1=N%"
Set "String=%String:Alpha:~40,1=O%"
Set "String=%String:Alpha:~41,1=P%"
Set "String=%String:Alpha:~42,1=Q%"
Set "String=%String:Alpha:~43,1=R%"
Set "String=%String:Alpha:~44,1=S%"
Set "String=%String:Alpha:~45,1=T%"
Set "String=%String:Alpha:~46,1=U%"
Set "String=%String:Alpha:~47,1=V%"
Set "String=%String:Alpha:~48,1=W%"
Set "String=%String:Alpha:~49,1=X%"
Set "String=%String:Alpha:~50,1=Y%"
Set "String=%String:Alpha:~51,1=Z%"

::Numeric
Set "String=%String:Numeric:~0,1=0%"
Set "String=%String:Numeric:~1,1=1%"
Set "String=%String:Numeric:~2,1=2%"
Set "String=%String:Numeric:~3,1=3%"
Set "String=%String:Numeric:~4,1=4%"
Set "String=%String:Numeric:~5,1=5%"
Set "String=%String:Numeric:~6,1=6%"
Set "String=%String:Numeric:~7,1=7%"
Set "String=%String:Numeric:~8,1=8%"
Set "String=%String:Numeric:~9,1=9%"

::Special_UTF8
Set "String=%String:Special_UTF8:~0,1=…%"
Set "String=%String:Special_UTF8:~1,1=‚%"
Set "String=%String:Special_UTF8:~2,1=¡%"
Set "String=%String:Special_UTF8:~3,1=¢%"
Set "String=%String:Special_UTF8:~4,1=£%"
Set "String=%String:Special_UTF8:~5,1=…%"
Set "String=%String:Special_UTF8:~6,1=Š%"
Set "String=%String:Special_UTF8:~7,1=Ö%"
Set "String=%String:Special_UTF8:~8,1=•%"
Set "String=%String:Special_UTF8:~9,1=—%"
Set "String=%String:Special_UTF8:~10,1=µ%"
Set "String=%String:Special_UTF8:~11,1=‚%"
Set "String=%String:Special_UTF8:~12,1=Ö%"
Set "String=%String:Special_UTF8:~13,1=à%"
Set "String=%String:Special_UTF8:~14,1=é%"
Set "String=%String:Special_UTF8:~15,1=·%"
Set "String=%String:Special_UTF8:~16,1=Ô%"
Set "String=%String:Special_UTF8:~17,1=Þ%"
Set "String=%String:Special_UTF8:~18,1=ã%"
Set "String=%String:Special_UTF8:~19,1=ë%"
Set "String=%String:Special_UTF8:~20,1=Ž%"
Set "String=%String:Special_UTF8:~21,1=‰%"
Set "String=%String:Special_UTF8:~22,1=‹%"
Set "String=%String:Special_UTF8:~23,1=”%"
Set "String=%String:Special_UTF8:~24,1=š%"
Set "String=%String:Special_UTF8:~25,1=Ž%"
Set "String=%String:Special_UTF8:~26,1=Ó%"
Set "String=%String:Special_UTF8:~27,1=Ø%"
Set "String=%String:Special_UTF8:~28,1=™%"
Set "String=%String:Special_UTF8:~29,1=š%"
Set "String=%String:Special_UTF8:~30,1=¤%"
Set "String=%String:Special_UTF8:~31,1=¥%"
Set "String=%String:Special_UTF8:~32,1=^ª%"
Set "String=%String:Special_UTF8:~33,1=§%"
Set "String=%String:Special_UTF8:~34,1=^·%"
Set "String=%String:Special_UTF8:~35,1=¿%"
Set "String=%String:Special_UTF8:~36,1=­%"
Set "String=%String:Special_UTF8:~37,1=ï%"

::Special
Set "String=%String:Special:~0,1=^\%"
Set "String=%String:Special:~1,1=^|%"
Set "String=%String:Special:~2,1=@%"
Set "String=%String:Special:~3,1=#%"
Set "String=%String:Special:~4,1=^~%"
Set "String=%String:Special:~5,1=^^^!%"
Set "String=%String:Special:~6,1=$%"
Set "String=%String:Special:~7,1=€%"
Set "String=%String:Special:~8,1=^&%"
Set "String=%String:Special:~9,1=/%"
Set "String=%String:Special:~10,1=(%"
Set "String=%String:Special:~11,1=)%"
Set "String=%String:Special:~12,1==%"
Set "String=%String:Special:~13,1=?%"
Set "String=%String:Special:~14,1=^<%"
Set "String=%String:Special:~15,1=^>%"
Set "String=%String:Special:~16,1=;%"
Set "String=%String:Special:~17,1=,%"
Set "String=%String:Special:~18,1=.%"
Set "String=%String:Special:~19,1=-%"
Set "String=%String:Special:~20,1=_%"
Set "String=%String:Special:~21,1=+%"
Set "String=%String:Special:~22,1=*%"
Set "String=%String:Special:~23,1=^[%"
Set "String=%String:Special:~24,1=^]%"
Set "String=%String:Special:~25,1={%"
Set "String=%String:Special:~26,1=}%"
Set "String=%String:Special:~27,1=`%"
Set "String=%String:Special:~28,1='%"
Set "String=%String:Special:~29,1=^^^^%"
Set "String=%String:Special:~30,1=:%"

Echo string "%STRING%"
Call :Write_Desofuscador




:Write_Ofuscador
Set "New_String=%New_String:€="%"& rem "
Echo %New_String%>>"Script Ofuscado con BatOfuser.bat"
If NOT Errorlevel 0 (Echo ERROR & pause & Exit /B 1)
Set "New_String="
Set "Count="
Goto :EOF


:Write_Desofuscador
Echo %String%>>"%TEMP%\Batofuser_DESOFUSCAR_.bat"
If NOT Errorlevel 0 (Echo ERROR & pause & Exit /B 1)
Set "String="
If "%linea%" EQU "%total%" (Goto :Fin_Desofuscador)
Goto :Leer_Desofuscador


:Fin_Ofuscador
Echo REM By Elektro H@cker >> "Script Ofuscado con BatOfuser.bat"
Del /Q "%TEMP%\String.tmp"
Cls
echo Fin | More
pause
Exit


:Fin_Desofuscador
CLS
setlocal enabledelayedexpansion
Set "String=!String:%%=!"
Set "String=!String:€=%%!"

For /F "Tokens=*" %%a in ('Type "%TEMP%\Batofuser_DESOFUSCAR_.bat"') do (
    Set "String=%%a"
    Set "String=!String:%%=!"
    echo !String!
    Set "String=!String:€=%%!"
    Echo !String!>>"Script Desofuscado con BatOfuser.bat"
)
Del /Q "%TEMP%\Batofuser_DESOFUSCAR_.bat"
echo Fin | More
Pause
Exit
934  Programación / Scripting / (Solucionado) [Batch] Como reemplazar el caracter "%" dentro de una variable...? en: 20 Marzo 2012, 12:24 pm
Hola

Lo que necesito es eliminar el caracter "%".

Lo he intentado de todas las maneras que se me ha ocurrido... Escapando, Expandiendo, Usando 2 porcentages, 3, 4.. y volviendo a escapar xD...

Creo que no es posible reemplazar el caracter "%" ni el "~"

¿Alguien sabe si se puede hacer?

Código
  1. @Echo OFF
  2. Set "String=%%Special:~2,1%%"
  3. Echo Antes  :  %String%
  4. Set "String=%String:%=%"
  5. Echo Despues:  %String%

Este es el resultado que busco:



Gracias...
935  Foros Generales / Sugerencias y dudas sobre el Foro / [OFFTOPIC] Petición para El brujo [OFFTOPIC] en: 20 Marzo 2012, 08:30 am
Buenas

Me gustaría poder contactar contigo Alex, Bueno, Solo busco una respuesta a 2 o 3 mp's que te he ido mandando en los últimos meses, nada más

El problema es que no se si has llegado a leerlos.

Si los has leido ya capto la indirecta xD y entendería que este post que acabo de hacer es una tontería, Pero como no he tenido respuesta de ti en nínguno de esos mp no se si debo dejarme llevar por la intuición... Puedo estar equivocado.

"Jopé", Todos nos merecemos al menos una respuesta...

Si no has podido leerlos dimelo y mando un email

PD: No he querido molestar mandando un email al staff preguntandote esto porque no se si lo que te dije en el mp es que no te interesaba o es que nunca llegaste a poder leer mis mp  >:(

     Crear este post es lo menos molesto que se me ocurre.
 
     Tampoco busco crear polémica con este post (Me extrañaria que hubiese alguna...) pueden cerrar este post si quieren, yo con que el brujo lo léa me conformo.

Un saludo!
936  Programación / Scripting / [APORTE] [BATCH] Shack (Imageshack Uploader) en: 19 Marzo 2012, 16:08 pm
SHACK
An Imageshack commandline uploader.

By Elektro H@cker.

Esto no es más que la versión compilada del script para usarla desde la CMD sin necesidad del intérprete de Ruby. (Bueno, más o menos xD)
El code original lo posteé en este topic: http://foro.elhacker.net/scripting/aporte_ruby_shack_imageshack_uploader-t356878.0.html





IMPORTANTE:
Para usar este script necesitan obtener una developer key (No es un capricho mio), Simplemente rellenen este formulario y enseguida recibiran un email con la clave:
http://stream.imageshack.us/api/

Luego hay que introducirla (Una única vez) usando el script de tal forma:
Código:
shack.exe -k "CLAVE"

Y ya podrán disfrutar del libre uso de este script.  ;D



Citar
Modo de empleo:
 shack.exe [Opción] [Imagen]

Ejemplo:
 shack.exe -d C:\Test.jpg

Opciones:
 -a --all
      Devuelve el enlace de la imagen en todos los formatos.
 -b --bb
      Devuelve el enlace de la imagen en formato BB.
 -d --directo
      Devuelve el enlace directo a la imagen.
 -h --html
      Devuelve el enlace de la imagen en formato HTML.
 -t --thumb
      Devuelve el thumb de la imagen.
 -k --key
      Establece su Developer key.
 /?   Muestra esta ayuda.




El archivo lo he subido aqui:



Es un autoextraible de Winrar, Se instala SHACK y una opción en el menú contextual para subir imagenes desde el menú contextual de Windows.

Por otro lado, Si no les interesa lo del menú y solo quieren la aplicación, Descompriman el .RAR y guarden el archivo "shack.exe" donde quieran :)
 


937  Programación / Scripting / [APORTE] [RUBY] Shack (Imageshack Uploader) en: 19 Marzo 2012, 15:18 pm
SHACK
An Imageshack commandline uploader.

By Elektro H@cker.


Todas las tools y scripts que conozco para subir una imagen, como por ejemplo "shag" ya no funcionan por culpa de la developer key, Así que debido a la falta de un uploader para imageshack por línea de comandos he querido hacer este útil script.

Espero que os guste y si encontrais fallos o mejoras hagánmelo saber, Gracias.



IMPORTANTE:
Para usar este script necesitan obtener una developer key (No es un capricho mio), Simplemente rellenen este formulario y enseguida recibiran un email con la clave:
http://stream.imageshack.us/api/

Luego hay que introducirla (Una única vez) usando el script de tal forma:
Código:
shack.rb -k "CLAVE"

Y ya podrán disfrutar del libre uso de este script.  ;D



Citar
Modo de empleo:
 shack.rb [Opción] [Imagen]

Ejemplo:
 shack.rb -d C:\Test.jpg

Opciones:
 -a --all
      Devuelve el enlace de la imagen en todos los formatos.
 -b --bb
      Devuelve el enlace de la imagen en formato BB.
 -d --directo
      Devuelve el enlace directo a la imagen.
 -h --html
      Devuelve el enlace de la imagen en formato HTML.
 -t --thumb
      Devuelve el thumb de la imagen.
 -k --key
      Establece su Developer key.
 /?   Muestra esta ayuda.





Código
  1. # -*- coding: UTF-8 -*-
  2.  
  3.  
  4.  
  5. # Modulos
  6.  
  7. require 'rest_client'
  8. exit if Object.const_defined?(:Ocra)
  9.  
  10.  
  11.  
  12. # Metodos
  13.  
  14. def logo()
  15.  print "
  16.     @@
  17.    @   @                  
  18.   @    @      @@@   @@@  @   @
  19.    @   @         @ @   @ @  @
  20.     @  @ @@      @ @     @ @
  21.      @ @@  @  @@@@ @     @@
  22.      @ @   @ @   @ @     @ @
  23.  @  @  @   @ @   @ @   @ @  @
  24.   @@   @   @  @@@@  @@@  @   @
  25.  
  26.  
  27.                                By Elektro H@cker\n\n"
  28. end
  29.  
  30. def help()
  31.  print "\n Modo de empleo:\n\n"
  32.  print "  " + __FILE__.split('/').last + " [Opci\u00F3n] [Imagen]\n\n"
  33.  print "\n Ejemplo:\n\n"
  34.  print "  " + __FILE__.split('/').last + " -d C:\\Test.jpg \n\n"
  35.  print "\n Opciones: \n\n"
  36.  print "  -a --all \n       Devuelve el enlace de la imagen en todos los formatos. \n\n"
  37.  print "  -b --bb \n       Devuelve el enlace de la imagen en formato BB. \n\n"
  38.  print "  -d --directo \n       Devuelve el enlace directo a la imagen. \n\n"
  39.  print "  -h --html \n       Devuelve el enlace de la imagen en formato HTML. \n\n"
  40.  print "  -t --thumb \n       Devuelve el thumb de la imagen. \n\n"
  41.  print "  -k --key \n       Establece su Developer key. \n\n"
  42.  print "  /?   Muestra esta ayuda. \n\n"
  43.  Process.exit
  44. end
  45.  
  46. def keycode(imput)
  47. if ARGV[1] == () or not imput.length.eql? 40
  48.   puts "\n Porfavor introduzca una developer key válida..."
  49.   puts "\n Ejemplo:\n\n " + __FILE__.split('/').last + " --key 148CAPSV9465b858a45dc1b4cdb32dee95ff6f59 \n\n"
  50.   puts "\n Para más información, Visite: http://stream.imageshack.us/api/"
  51.   Process.exit
  52.  end # length
  53.  
  54. if File.exist?("key")
  55.   oldkey = File.read('key')
  56.   print "\n ¿Desea reemplazar el archivo que contiene su developer key?\n\n"
  57.   print " Clave anterior: " + oldkey
  58.   print "\n Clave nueva   : " + imput
  59.   print  "\n\n [SI/NO] \n\n>> "
  60.   $sino = STDIN.gets
  61.    if $sino[/si/i]
  62.      keyfile = File.new("key", "w")
  63.      keyfile.print(imput)
  64.      print "\nClave reemplazada correctamente.\n"
  65.    elsif $sino[/no/i]
  66.      Process.exit
  67.    elsif
  68.      keycode(imput)
  69.    end # Reemplazar
  70.  else
  71.      keyfile = File.new("key", "w")
  72.      keyfile.print(imput)
  73.      print "\nClave configurada correctamente.\n"
  74. end # File exist
  75. end
  76.  
  77. def subir(file)
  78. print "\n Subiendo la imagen, Espere...\n\n"
  79. $Imagen = RestClient.post('http://www.imageshack.us/upload_api.php',
  80.   :key => $devkey,
  81. #  :a_username => "USUARIO",
  82. #  :a_password => "PASSWORD",
  83.   :fileupload => File.new(file)
  84. )
  85. end
  86.  
  87. def show(opcion)
  88.  if opcion == "-d" or opcion == "--directo"
  89.    print $Imagen.split("<image_link>").last.split("</image_link>").first + "\n"
  90.  elsif opcion == "-b" or opcion == "--bb"
  91.    print $Imagen.split("<image_bb>").last.split("</image_bb>").first + "\n"
  92.  elsif opcion == "-h" or opcion == "--html"
  93.    print $Imagen.split("<image_html>").last.split("</image_html>").first.gsub("&gt;", ">").gsub("&lt;", "<").gsub("&quot;", "'") + "\n"
  94.  elsif opcion == "-t" or opcion == "--thumb"
  95.    print $Imagen.split("<thumb_link>").last.split("</thumb_link>").first + "\n"
  96.  elsif opcion == "-a" or opcion == "--all"
  97.    print "\nDirecto: \n" + $Imagen.split("<image_link>").last.split("</image_link>").first + "\n\n"
  98.    print "BB Forum: \n" + $Imagen.split("<image_bb>").last.split("</image_bb>").first + "\n\n"
  99.    print "HTML: \n" + $Imagen.split("<image_html>").last.split("</image_html>").first.gsub("&gt;", ">").gsub("&lt;", "<").gsub("&quot;", "'") + "\n\n"
  100.    print "Thumb: \n" + $Imagen.split("<thumb_link>").last.split("</thumb_link>").first + "\n"
  101.  end
  102. Process.exit
  103. end
  104.  
  105.  
  106.  
  107. # Control de errores
  108.  
  109. logo()
  110.  
  111. if ARGV[0] == "-k" or ARGV[0] == "--key"
  112.  keycode(ARGV[1])
  113.  Process.exit
  114. end
  115.  
  116. if not File.exist?("key")
  117.  print "\n ERROR.   Debe configurar su developer key para usar este programa...\n"
  118.  puts "\n Ejemplo:\n\n " + __FILE__.split('/').last + " --key 148CAPSV9465b858a45dc1b4cdb32dee95ff6f59 \n\n"
  119.  puts "\n Para más información, Visite: http://stream.imageshack.us/api/"
  120.  Process.exit
  121. elsif
  122.  $devkey = File.read('key')
  123. end
  124.  
  125. if (ARGV.empty?) or ARGV[0] == "/?"
  126.  help()
  127. end
  128.  
  129. if (ARGV[1])==()
  130.  print "\n ERROR.   Debe introducir la ruta local de la imagen...\n"
  131.  Process.exit
  132. end
  133.  
  134. if not File.exist?(ARGV[1])
  135.  print "\n ERROR.   La imagen no existe...\n"
  136.  Process.exit
  137. elsif not (ARGV[1].split('.').last)[/bmp\z/i] and not (ARGV[1].split('.').last)[/bmp\z/i] and not (ARGV[1].split('.').last)[/gif\z/i] and not (ARGV[1].split('.').last)[/ico\z/i] and not (ARGV[1].split('.').last)[/jpg\z/i] and not (ARGV[1].split('.').last)[/jpeg\z/i] and not (ARGV[1].split('.').last)[/png\z/i] and not (ARGV[1].split('.').last)[/tif\z/i] and not (ARGV[1].split('.').last)[/tiff\z/i]
  138.    print "\n ERROR.   Archivo de imagen no soportado...\n"
  139.    print "\n Formatos soportados: .BMP, .GIF, .ICO, .JPG, .JPEG, .PNG, .TIF, .TIFF\n"
  140.  Process.exit
  141. end
  142.  
  143. if not ARGV[0] == "-d" and not ARGV[0] == "--directo" and not ARGV[0] == "-a" and not ARGV[0] == "--all" and not ARGV[0] == "-b" and not ARGV[0] == "--bb" and not ARGV[0] == "-h" and not ARGV[0] == "--html" and not ARGV[0] == "-t" and not ARGV[0] == "--thumb"
  144.  print "\n ERROR.   Opcion incorrecta...\n\n"
  145.  print " Use la opcion [/?] para mostrar la ayuda. \n\n"
  146.  print " " +__FILE__.split('/').last +  " /?  \n"
  147.  Process.exit
  148. end
  149.  
  150.  
  151.  
  152. # Proceso
  153.  
  154. subir(ARGV[1])
  155. show(ARGV[0])
938  Programación / Scripting / [APORTE] Python 2.7.2 (64 Bit) Portable Auto-Instalable FULL para Windows en: 18 Marzo 2012, 20:33 pm
Python 2.7.2 (64 Bit) Portable Auto-Instalable FULL para Windows        

by Elektro H@cker





No hay mucho que decir :P, Se instala en "C:\Archivos de programa (x86)\Python" y lleva un desinstalador.

IMPORTANTE: Ejecutarlo como administrador, Hay 3 dlls de python que se deberán copiar en "...Windows\System32\".  Pueden abrir el .exe con WinRar y copiarlas manualmente...

- Es la instalación completa, Lleva el paquete de "Test", El IDLE, el TKinter, Los scripts, TODO.

- También lleva el "cxfreeze" para compilar scripts.

- Los archivos de python están asociados a Python.exe tal como lo hace el instalador oficial.

- Para ejecutar un script simplemente darle doble click a el, o en consola: "Script.py", o "Python.exe Script.py"

- Para abrir el IDLE simplemente poner en consola "IDLE", O ir a la carpeta de Python y hacer un acceso directo donde querais al archivo "IDLE.bat" de esa misma carpeta.

- Además le he agregado un icono personalizado para los archivos de extensión .py .pyc .pyo y .pyw.

- Y una opción en el menú contextual para compilar rápidamente un .py o un .pyw:



PD: Hay un "Setup.py" de ejemplo en la carpeta de Python.


Salu2!


EDITO: Tuve un pequeño fallo con el registro de la opción "Compilar", No funcionaba con nombres con espacio.  Aqui tienen el FIX

Compilar_FIXED.reg

Código:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\Shell\Compilar\command]
@="CMD /k python.exe \"C:\\Program Files (x86)\\Python\\Scripts\\cxfreeze\" \"%1\" --target-dir \"PYTHON_Compilado\" && echo+ && echo+ && echo+ Script compilado! && ping -n 3 localhost >nul & Exit"

[HKEY_CLASSES_ROOT\Python.NoConFile\Shell\Compilar\command]
@="CMD /k python.exe \"C:\\Program Files (x86)\\Python\\Scripts\\cxfreeze\" \"%1\" --target-dir \"PYTHON_Compilado\" && echo+ && echo+ && echo+ Script compilado! && ping -n 3 localhost >nul & Exit"
939  Programación / Scripting / (Solucionado) [RUBY] Como filtrar un body html? en: 17 Marzo 2012, 17:03 pm
Hola, Estoy intentando aprender este tipo de cosas, tengo hecho este script (Lo saque de un code de Doddy y lo he modificado un poco) pero no me funciona, El archivo no se sube, Y el script no me da error, No muestra el "except"...

Son 2 problemas xD

¿Que estoy haciendo mal?


Código
  1. import urllib2,sys,re
  2.  
  3. nave = urllib2.build_opener()
  4. nave.add_header = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5')]
  5.  
  6. def tomar(web,vars) :
  7. return nave.open(web,vars).read()
  8. ()
  9.  
  10. def chubir():
  11. print "[+] Uploading file\n"
  12. try:
  13.  code = tomar("http://www.imageshack.us/upload_api.php","key=268BEKSV9465b858a45cd1b4d2b32d1195ee6f27","a_username=elektrohacker","a_password=MIPASSWORD","fileupload=C:/1.jpg")
  14.  #code = tomar("http://www.imageshack.us/upload_api.php","fileupload="+str(lin)+"&submit=submit")
  15. except:
  16.  print "[-] Page offline\n"
  17. if re.findall("Bad API request",code):
  18.  print "[-] Error uploading file\n"
  19. else:
  20.  print "[+] Enjoy : ",code+"\n"
  21. ()
  22.  
  23. chubir()
  24.  
  25. # Fin


EDITO:
También lo he intentado por Ruby, Que me resultaría más fácil porque lo conozco un poco más que Python:

Código
  1. require "net/http"
  2.  
  3. def tomar(web,par)
  4.  return Net::HTTP.post_form(URI.parse(web),par).body
  5. end
  6.  
  7. def subir()
  8.  print "[+] Uploading file\n\n"
  9.  
  10.  code = tomar("http://www.imageshack.us/upload_api.php",{"fileupload"=>"C:/1.jpg","key"=>"268BEKSV9465b858a45cd1b4d2b32d1195ee6f27","submit"=>"submit"})
  11.  # code = tomar("http://www.imageshack.us/upload_api.php",{"fileupload"=>ARGV[1],"key"=>"268BEKSV9465b858a45cd1b4d2b32d1195ee6f27","submit"=>"submit"})
  12.  
  13.  print "[+] Enjoy : "+code+"\n"
  14. end
  15.  
  16. subir()
  17.  

Me da este error:
Código:
<error id="parameter_missing">Sorry, but we've detected that unexpected data is
received. Required parameter 'fileupload' is missing or your post is not multipa
rt/form-data</error>
</links>

Se que estoy intentando por el método POST, Pero en la documentación de Imageshack pone que se puede por POST, Y no se como hacer la conexión para multipart...


También lo he intentado con curl para Windows:
Código
  1. curl.exe -F xml=yes -F "fileupload=c:\1.jpg" http://www.imageshack.us/index.php

Me dice que necesito introducir la developer key, Pero no se como ponerla, con que sintaxis en curl...





Porfavor, Si alguien además me pudiera ayudar con los parámetros de la API, O simplemente decirme si lo estoy haciendo bien o no los parámetros de la APi se lo agradecerñia mucho, Aquí está la info:


Citar
Unified API entry point is: http://www.imageshack.us/upload_api.php for images

Supported parameters are:

fileupload; (input type="file") - image or video file. Mandatory unless url parameter is specified.
frmupload; (input type="file") - video default frame picture. Optional, used only for video upload.
url; This parameter indicates that transload method is used instead of upload
optsize; resize options for image in form WxH if image is uploaded/transloaded. No impact on video uploads.
rembar; Developer could tell to ImageShack to leave/remove information bar on thumbnail image generated by ImageShack . If you've supplied this parameter as yes or as 1 then generated thumbmail will have no information bar.
tags; A comma-separated list of tags to add to your video/image. E.g. family,picture. Optional
public; Public/private marker of your video/picture. yes means public (default), no means private. Optional
cookie; Registration code, optional.
a_username; Username, optional.
a_password; Password, optional.
key; Your DeveloperKey. Mandatory.
940  Programación / Scripting / [BATCH] Findstr, ¿Como repetir coincidencias? en: 17 Marzo 2012, 06:37 am
Hola

Necesito conseguir que findstr encuentre 2 (o más) coincidencias del mismo caracter.

Si nos paramos a leer la ayuda...

Código:
Expresión regular de referencia rápida:
  *        Repetir: cero o más ocurrencias de un carácter previo o de clase

Pero esto no me funciona:

Código
  1. Echo "nombre1 - nombre2 - nombre3" | Findstr /R "\-\*\-\"

¿Alguien sabe la sintaxis correcta?

EDITO: ya está:

Código
  1. Echo "nombre1 - nombre2 - nombre3" | Findstr /R "\-.*.\-"

El problema ahora es que no se como hacerlo más eficiente, Para que solo busque 2 coincidencias, No más, Si encuentra más, Se lo salte..

Lo que quiero decir, Es que por ejemplo limitar este comando a buscar solamente 2 coincidencias...
Código
  1. Echo "nombre1 - - - - -" | Findstr /R "\-.*.\-"

El findstr lo da por válido, Y no quiero que así séa, ya que hay 5 coincidencias, No 2.
Páginas: 1 ... 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 [94] 95 96 97 98 99 100 101 102 103 104 105
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines