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

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


  Mostrar Temas
Páginas: 1 ... 78 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
921  Programación / Scripting / [Ruby] [APORTE] FINDUS (Find Duplicates) en: 14 Abril 2012, 17:58 pm


Esta utilidad busca archivos duplicados comprobando el hash CRC32.

Citar
  • Modo de empleo:
          FINDUS [OPCIONES] [RUTA]

  • Opciones:
  • [-R]  Habilita la búsqueda recursiva de subdirectorios.

  • Ejemplos:
          FINDUS "%CD%"
           FINDUS -R "C:\Windows"



Código
  1. # -*- coding: UTF-8 -*-
  2.  
  3. require "zlib"
  4. exit if Object.const_defined?(:Ocra)
  5.  
  6. def logo()
  7. print '
  8.  
  9.   _______   __     _____  ___    ________    ____  ____    ________  
  10.  /"     "| |" \\   (\\"   \\|"  \\  |"      "\\  ("  _||_ " |  /"       )
  11. (: ______) ||  |  |.\\\\   \\    | (.  ___  :) |   (  ) : | (:   \\___/  
  12.  \\/    |   |:  |  |: \\.   \\\\  | |: \\   ) || (:  |  | . )  \\___  \\    
  13.  // ___)   |.  |  |.  \\    \\. | (| (___\\ ||  \\\\ \\__/ //    __/  \\\\  
  14. (:  (      /\\  |\\ |    \\    \\ | |:       :)  /\\\\    //\\   /" \\   :)  
  15.  \\__/     (__\\_|_) \\___|\\____\\) (________/      \\__/     (_______/  
  16.  
  17.           Find Duplicates v1.0       By Elektro H@cker
  18.  
  19. '
  20. end
  21.  
  22. def help()
  23. print '
  24. Este programa busca archivos duplicados comprobando el hash CRC32.
  25.  
  26. [*] Modo de empleo:
  27.  
  28.     FINDUS [OPCIONES] [RUTA]
  29.  
  30. [*] Opciones:
  31.  
  32.     [-R]  Habilita la búsqueda recursiva en subdirectorios.
  33.  
  34. [*] Ejemplos:
  35.  
  36.     FINDUS "%CD%"
  37.     FINDUS -R "C:\Windows"
  38.  
  39. '
  40. Process.exit
  41. end
  42.  
  43. def errorcontrol()
  44.  if ARGV.empty?
  45.    help
  46.  elsif ARGV.length == 2 and not File.directory? (ARGV[1])
  47.    help
  48.  elsif ARGV.length == 1 and not File.directory? (ARGV[0])
  49.    help
  50.  end
  51.  if ARGV[0] =~ /-r/i
  52.    $folder = ARGV[1]
  53.    Dir.chdir($folder)
  54.    resursive = File.join("**", "*.*")
  55.    $files = Dir.glob(resursive)
  56.  elsif
  57.    $folder = ARGV[0]
  58.    Dir.chdir($folder)
  59.    not_resursive = File.join("*.*")
  60.    $files = Dir.glob(not_resursive)
  61.  end
  62. end
  63.  
  64. logo
  65. errorcontrol
  66. $list = ""
  67.  
  68. # Listar los archivos del directorio
  69. File.open("#{ENV['TEMP']}\\dir.txt", 'w+') do |file|  
  70. file.puts $files
  71. end
  72.  
  73. # Comparar el crc de cada archivo listado
  74. File.read("#{ENV['TEMP']}\\dir.txt").each_line { |line|
  75. begin
  76.  file      = File.read(line.strip) ; nil
  77.  file_crc  = Zlib.crc32(file,0).to_s(16)
  78.  file_size = File.size(line.strip)
  79.   if $list[file_crc.to_s]
  80.     print "#{$folder}\\#{line.strip.gsub('/', '\\')}\n#{$list.split(file_crc).first.split(")").last.split("\n\n").last}#{file_crc})\n\n"
  81.   end
  82.  $list << "#{$folder}\\#{line.strip.gsub('/', '\\')}\n(CRC32: #{file_crc}) (BYTES: #{file_size})\n\n"
  83. rescue
  84.  print "Archivo inaccesible #{$folder}\\#{line}"
  85. end
  86. }
  87.  
  88.  
  89. __END__
  90.  

PD: Tiene algunos fallos en los permisos de las carpetas especiales de windows

Saludos.
922  Programación / Scripting / [BATCH] GTC (Google Translate Console) en: 12 Abril 2012, 15:20 pm


Una utilidad para traducir frases al vuelo desde la consola.

Citar
Modo de empleo:
   GTC [Idioma de entrada] [Idioma de salida] [Texto]

 Ejemplo:
   GTC ES "Hello World"

 (El idioma de entrada se reconoce automaticamente por defecto.)

 Idiomas:
Código:
 AF: Africano    AR: Árabe        AZ: Azerbaijani   BE: Bielorruso
 BG: Búlgaro     BN: Bengalés     CA: Catalàn       CS: Checo
 CY: Galés       DA: Danés        DE: Alemàn        EL: Griego
 EN: Inglés      EO: Esperanto    ES: Espa±ol       ET: Estonio
 EU: Euskera     FA: Persa        FI: Finlandés     FR: Francés
 GA: Irlandés    GL: Gallego      GU: Gujarati      HI: Hindú
 HR: Croata      HT: Haitiano     HU: Húngaro       HY: Armenio
 ID: Indonesio   IS: Islandés     IT: Italiano      IW: Hebreo
 JA: Japonés     KA: Georgiano    KN: Kanada        KO: Coreano
 LA: LatÝn       LT: Lituano      LV: Letón         MK: Macedonio
 MS: Malayo      MT: Maltés       NL: Holandés      NO: Noruego
 PL: Polaco      PT: Portugués    RO: Rumano        RU: Ruso
 SK: Eslovaco    SL: Esloveno     SQ: Albanés       SR: Serbio
 SV: Sueco       SW: Suajili      TA: Tamil         TE: Telugu
 TH: Tailandés   TL: Tagalo       TR: Turco         UK: Ucraniano
 UR: Urdu        VI: Vietnamita   YI: Yiddish
 ZH-CN: Chino    (Simplificado)
 ZH-TW: Chino    (Tradicional)

IMPORTANTE:
Para usar el script, Es necesario la utilidad wget.exe.
http://sourceforge.net/projects/gnuwin32/files/wget/1.11.4/wget-1.11.4-bin.zip/download PARECE SER QUE NO FUNCIONA
http://www.mediafire.com/?41476m73gbza1aj
(Necesariamente esa versión)

Capturas:
   
   

El code:
Código:
@Echo OFF
Title GoogleTranslateConsole v1.3
:: By Elektro H@cker

Wget 1>nul 2>&1
IF %Errorlevel% EQU 9009 (Exit /B 1)

Goto :Errorcontrol

:LOGO
Echo+
Echo:         GGGGGGGGGGGGG  TTTTTTTTTTTTTTTTTTTTTTT          CCCCCCCCCCCCC
Echo:      GGG::::::::::::G  T:::::::::::::::::::::T       CCC::::::::::::C
Echo:    GG:::::::::::::::G  T:::::::::::::::::::::T     CC:::::::::::::::C
Echo:   G:::::GGGGGGGG::::G  T:::::TT:::::::TT:::::T    C:::::CCCCCCCC::::C
Echo:  G:::::G       GGGGGG  TTTTTT  T:::::T  TTTTTT   C:::::C       CCCCCC
Echo: G:::::G                        T:::::T          C:::::C             
Echo: G:::::G                        T:::::T          C:::::C             
Echo: G:::::G    GGGGGGGGGG          T:::::T          C:::::C             
Echo: G:::::G    G::::::::G          T:::::T          C:::::C             
Echo: G:::::G    GGGGG::::G          T:::::T          C:::::C             
Echo: G:::::G        G::::G          T:::::T          C:::::C             
Echo:  G:::::G       G::::G          T:::::T           C:::::C       CCCCCC
Echo:   G:::::GGGGGGGG::::G        TT:::::::TT          C:::::CCCCCCCC::::C
Echo:    GG:::::::::::::::G        T:::::::::T           CC:::::::::::::::C
Echo:      GGG::::::::::::G        T:::::::::T             CCC::::::::::::C
Echo:         GGGGGGGGGGGGG Google TTTTTTTTTTT Translate      CCCCCCCCCCCCC Console
Echo+
Goto :EOF

:HELP
Echo: Modo de empleo: | MORE
Echo:   GTC [Idioma de entrada] [Idioma de salida] [Texto] |MORE
Echo: Ejemplo:  | MORE
Echo:   GTC ES "Hello World" | MORE

Echo: (El idioma de entrada se reconoce automaticamente por defecto.) | MORE

Echo: Idiomas: | MORE
Echo: AF: Africano    AR: µrabe        AZ: Azerbaijani   BE: Bielorruso
Echo: BG: B£lgaro     BN: Bengal‚s     CA: Catal…n       CS: Checo
Echo: CY: Gal‚s       DA: Dan‚s        DE: Alem…n        EL: Griego
Echo: EN: Ingl‚s      EO: Esperanto    ES: Espa¤ol       ET: Estonio
Echo: EU: Euskera     FA: Persa        FI: Finland‚s     FR: Franc‚s
Echo: GA: Irland‚s    GL: Gallego      GU: Gujarati      HI: Hind£
Echo: HR: Croata      HT: Haitiano     HU: H£ngaro       HY: Armenio
Echo: ID: Indonesio   IS: Island‚s     IT: Italiano      IW: Hebreo
Echo: JA: Japon‚s     KA: Georgiano    KN: Kanada        KO: Coreano
Echo: LA: Latín       LT: Lituano      LV: Let¢n         MK: Macedonio
Echo: MS: Malayo      MT: Malt‚s       NL: Holand‚s      NO: Noruego
Echo: PL: Polaco      PT: Portugu‚s    RO: Rumano        RU: Ruso
Echo: SK: Eslovaco    SL: Esloveno     SQ: Alban‚s       SR: Serbio
Echo: SV: Sueco       SW: Suajili      TA: Tamil         TE: Telugu
Echo: TH: Tailand‚s   TL: Tagalo       TR: Turco         UK: Ucraniano
Echo: UR: Urdu        VI: Vietnamita   YI: Yiddish       
Echo: ZH-CN: Chino    (Simplificado)
Echo: ZH-TW: Chino    (Tradicional)
Exit /B 1

:Errorcontrol
Setlocal Enabledelayedexpansion
Set "Langs=AF:Africano, AR:µrabe, AZ:Azerbaijani, BE:Bielorruso, BG:B£lgaro, BN:Bengal‚s, CA:Catal…n, CS:Checo, CY:Gal‚s, DA:Dan‚s, DE:Alem…n, EL:Griego, EN:Ingl‚s, EO:Esperanto, ES:Espa¤ol, ET:Estonio, EU:Euskera, FA:Persa, FI:Finland‚s, FR:Franc‚s, GA:Irland‚s, GL:Gallego, GU:Gujarati, HI:Hind£, HR:Croata, HT:Haitiano, HU:H£ngaro, HY:Armenio, ID:Indonesio, IS:Island‚s, IT:Italiano, IW:Hebreo, JA:Japon‚s, KA:Georgiano, KN:Kanada, KO:Coreano, LA:Latín, LT:Lituano, LV:Let¢nMK:, Macedonio, MS:Malayo, MT:Malt‚s, NL:Holand‚s, NO:Noruego, PL:Polaco, PT:Portugu‚s, RO:Rumano, RU:Ruso, SK:Eslovaco, SL:Esloveno, SQ:Alban‚s, SR:Serbio, SV:Sueco, SW:Suajili, TA:Tamil, TE:Telugu, TH:Tailand‚s, TL:Tagalo, TR:Turco, UK:Ucraniano, UR:Urdu, VI:Vietnamita, YI:Yiddish, ZH-CN:Chino Simplificado, ZH-TW:Chino Tradicional"
IF "%~3" EQU "" (
Echo "%LANGS%" | Find /I "%~1:" >NUL
IF !Errorlevel! EQU 1 (Echo Idioma no reconocido & Exit /B 1)
) ELSE (
Echo "%LANGS%" | Find /I "%~1:" >NUL
IF !Errorlevel! EQU 1 (Echo Idioma no reconocido & Exit /B 1)
Echo "%LANGS%" | Find /I "%~2:" >NUL
IF !Errorlevel! EQU 1 (Echo Idioma no reconocido & Exit /B 1)
)
Setlocal Disabledelayedexpansion

:Translate
Call :LOGO
IF "%~1" EQU "" (Start /B CMD /Q %0)
IF "%~2" EQU "" (Goto :HELP)
IF "%~3" EQU "" (Set "LangIN=auto" & Set "LangOUT=%~1" & Set "String=%~2") ELSE (Set "LangIN=%~1" & Set "LangOUT=%~2" & Set "String=%~3")
Set "String=%String: =+%"
Set "String=%String:...=;;%"
Set "String=%String:.=,,%"
Set "String=%String:!=(;)%"
WGET -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=%STRING%&sl=%LangIN%&tl=%LangOUT%" -O "%TEMP%\GTC.html"
For /F "Tokens=* Delims=;" %%a in ('Type "%TEMP%\GTC.html"') do (Set "Body=%%a")

SET "Cut=%Body:*","=%"
CALL SET "Traduced=%%Body:%Cut%=%%"
SET "Traduced=%Traduced:[[["=%" & REM "
SET "Traduced=%Traduced: , ,=.%"
SET "Traduced=%Traduced: (;)=!%"
SET "Traduced=%Traduced: ( ;)=!%"
SET "Traduced=%Traduced:(;)=!%"
SET "Traduced=%Traduced:","=%"

:Print
Setlocal Enabledelayedexpansion
IF "%~3" EQU "" (
SET "LangINPrint=[AUTO]"
SET "LangOUTPrint=!langs:*%1:=!"
For /F "Tokens=1,* Delims=," %%# in ('Echo !LangOUTPrint!') Do (Set "LangOUTPrint=[%%#]")
) ELSE (
SET "LangINPrint=!langs:*%1:=!"
SET "LangOUTPrint=!langs:*%2:=!"
For /F "Tokens=1,* Delims=," %%# in ('Echo !LangINPrint!') Do (Set "LangINPrint=[%%#]")
For /F "Tokens=1,* Delims=," %%# in ('Echo !LangOUTPrint!') Do (Set "LangOUTPrint=[%%#]")
)
Setlocal Disabledelayedexpansion
Echo: Texto a traducir %LangINPrint% :
IF "%~3" EQU "" (Echo: [+] %~2 | MORE) ELSE (Echo: [+] %~3 | MORE)
Echo: Texto traducido %LangOUTPrint% :
Echo: [+] %Traduced%
Exit /B 0

PD: Cualquier bug o mejora comenten, Gracias.

Salu2.
923  Media / Multimedia / (Solucionado) Como convertir AVI a M2V en: 10 Abril 2012, 13:33 pm
Hola

Pues me encuentro con ese problema... He buscado y buscado pero no encuentro ningún convertidor AVI a M2V ( En cambio, M2v a AVI hay a patadas... :/ )

Entiendo que AVI es un container, y M2V es un archivo de video sin pistas de audio, Pero digo yo que algún modo habrá, no? Además, Algo a mi favor es que mi AVI no tiene pista de audio...

EDITO: Si al menos supiera que codec necesito para convertir a m2v... lo haría con el vdub y listo xD, Sé que M2V es algo de mpeg... pero ahí me quedo atascado.

Gracias y saludos...
924  Programación / Scripting / [Batch] [Mini-Aporte] MAME Panel (Una tool para el emulador MAME) en: 9 Abril 2012, 10:19 am


 

Un script para los aficionados a los Arcades (Como yo).

Cuenta con varias utilidades para manejar ciertos aspectos del emulador Mame y/o MameUI32/MameUI64  (Tengo que decir que solo lo he probado con la gui MameUI)

-Se puede arrastrar una rom al bat para ejecutarla. (Con MAME/Mameui no se puede a menos que la ROM esté en el directorio "ROMS"... Por eso empezé a hacer este script.)

Otras cosas que se pueden hacer son:

- Ejecutar una rom escribiendo el nombre.
- Ejecutar una rom al azar.
- Buscar una rom.
- Listar las roms disponibles.
- Eliminar una rom.
- Ejecutar MAME
- Descargar la última base de trucos (cheat.zip)
- Ejecutar un pequeño limpiador/organizador de roms creado por mi.


Notas:

 El script tiene que ejecutarse en el directorio donde tiene su mame.exe o mameui32.exe/mameui64.exe

 Algunas partes del script requieren ciertos programas para el correcto funcionamiento del code. De todas formas si no tiene ninguna de estas utilidades, No pasa nada, simplemente esa parte se "saltará".

Citar
Colous    (Para mostrar el scrpt coloreado)
 Irfanview  (Para redimensionar las imagenes en el limpiador)
 Wget      (Para descargar el cheat.zip)
 7z          (Para descomprimir el cheat.zip)


Algunas imagenes:

 

 

 


El code:

Código:
@Echo OFF
Title Mame Panel v1.0

:: :: :: :: :: :: :: ::
:: By Elektro H@cker ::
:: :: :: :: :: :: :: ::

:: Configuración :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::

REM Modifica el nombre de los ejecutable si es necesario...

:: Obligatorio:
Set MAME=MameUI64.exe

:: Opcional:
Set COLOUS=%windir%\system32\colous.exe
Set IRFANVIEW=%windir%\system32\i_view32.exe
Set NIRCMD=%windir%\system32\nircmd
Set WGET=%windir%\system32\wget.exe
Set ZIP=%windir%\system32\7z.exe
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::

Mode con cols=80 lines=20
%NIRCMD% win center ititle "Mame Panel v1.0" 2>Nul
PUSHD "%~dp0"
IF NOT exist %MAME% (Exit /B 1)
IF exist "%~1" (Goto :Play_New)

:Invaders
call :Logo
%COLOUS% writesec "[7]                               By Elektro H@cker" 2>Nul || Echo:                               By Elektro H@cker
Echo:                                           ÛÛÛÛÛÛÛÛ
Echo:         ÛÛ          ÛÛ                     ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:     ÛÛ    ÛÛ      ÛÛ    ÛÛ                   ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:     ÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  ÛÛ                   ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:     ÛÛÛÛÛÛ  ÛÛÛÛÛÛ  ÛÛÛÛÛÛ                   ÛÛÛÛÛÛ    ÛÛÛÛ    ÛÛÛÛÛÛ
Echo:       ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                     ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:         ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                             ÛÛÛÛ    ÛÛÛÛ
Echo:         ÛÛ          ÛÛ                           ÛÛÛÛ  ÛÛÛÛ  ÛÛÛÛ
Echo:       ÛÛ              ÛÛ                           ÛÛÛÛ    ÛÛÛÛ
Call :Wait
call :Logo
Echo+
Echo:                                                           ÛÛÛÛÛÛÛÛ
Echo:         ÛÛ          ÛÛ                              ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:           ÛÛ      ÛÛ                              ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:         ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                            ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:       ÛÛÛÛ  ÛÛÛÛÛÛ  ÛÛÛÛ                          ÛÛÛÛÛÛ    ÛÛÛÛ    ÛÛÛÛÛÛ
Echo:     ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                        ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo:     ÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  ÛÛ                              ÛÛÛÛ    ÛÛÛÛ
Echo:     ÛÛ  ÛÛ          ÛÛ  ÛÛ                            ÛÛÛÛ  ÛÛÛÛ  ÛÛÛÛ
Echo:           ÛÛÛÛ  ÛÛÛÛ                              ÛÛÛÛ                ÛÛÛÛ
%COLOUS% writesec "[7]                               By Elektro H@cker" 2>Nul || Echo:                               By Elektro H@cker
Call :Wait
Set /A Animation+=1
IF %Animation% EQU 6 (Goto :Menu)
Goto :Invaders

:Logo
Cls
Set Rom=
Echo+
Echo:      _______ _______ _______ _______      ______                       __
Echo:     ^|   ^|   ^|   _   ^|   ^|   ^|    ___^|    ^|   __ \.---.-..-----..-----.^|  ^|
Echo:     ^|       ^|       ^|       ^|    ___^|    ^|    __/^|  _  ^|^|     ^|^|  -__^|^|  ^|
Echo:     ^|__^|_^|__^|___^|___^|__^|_^|__^|_______^|    ^|___^|   ^|___._^|^|__^|__^|^|_____^|^|__^|
Echo:
%COLOUS% Writesec "[8]     ÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈ" 2>NUL || Echo:     ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Echo+
Goto :EOF

:Wait
ping -n 1 localhost >nul & ping -n 1 localhost >nul & ping -n 1 localhost >nul
ping -n 1 localhost >nul & ping -n 1 localhost >nul & ping -n 1 localhost >nul
ping -n 1 localhost >nul & ping -n 1 localhost >nul & ping -n 1 localhost >nul
ping -n 1 localhost >nul & ping -n 1 localhost >nul & ping -n 1 localhost >nul
ping -n 1 localhost >nul & ping -n 1 localhost >nul & ping -n 1 localhost >nul
Goto :EOF

:Menu
Call :Logo
%COLOUS% writesec "[7]     ([10]1[7]) Jugar rom al azar.               ([10]M[7]) Ejecutar M.A.M.E." 2>Nul && Echo+  || Echo:     (1) Jugar rom al azar.               (M) Ejecutar M.A.M.E.    | MORE
%COLOUS% writesec "[7]     ([10]2[7]) Buscar rom.                      ([10]O[7]) Ir al organizador." 2>Nul && Echo+ || Echo:     (2) Buscar rom.                      (O) Ir al organizador.   | MORE
%COLOUS% writesec "[7]     ([10]3[7]) Listar roms disponibles.         ([10]S[7]) Salir..." 2>Nul && Echo+ && Echo+  || Echo:     (3) Listar roms disponibles.         (S) Salir...             | MORE & Echo+
%COLOUS% writesec "[7] Opcion [10]/[7] Nombre de la rom?" 2>Nul && Echo+                                             || Echo:  ¨Opci¢n / Nombre de la rom? | MORE
%COLOUS% Cursoron 2>Nul
Set /P ROM=^>^>
IF NOT defined ROM (Goto :Menu)
IF "%ROM%" EQU "1" (Goto :Random)
IF "%ROM%" EQU "2" (Goto :Search)
IF "%ROM%" EQU "3" (Goto :List)
IF /I "%ROM%" EQU "M" (Start /B %MAME% && Exit)
IF /I "%ROM%" EQU "O" (Goto :Manager)
IF /I "%ROM%" EQU "S" (Exit /B 0)
Start /B %MAME% %ROM%
Goto :Menu

:Play_New
Move %1 ".\roms\" >Nul
Start /W %MAME% "%~n1"
Echo: Si no te ha gustado la rom, Puedes borrarla... | MORE
Choice /M "¨Borrar la rom %~nx1 ?"
IF errorlevel 1 (Del /Q ".\Roms\%~nx1")
Goto :Menu

:List
Dir /W /P /A-D ".\Roms\*" ^| Find /V "bytes" | MORE /E /C +2
Pause
Goto :Menu

:Random
Setlocal enabledelayedexpansion
Del /Q "%temp%\roms.tmp" 2>Nul
For /F "Tokens=*" %%# in ('Dir /B ".\Roms\*"') do (Echo !Random!!Random!;%%#>>"%temp%\roms.tmp")
For /F "Tokens=2 Delims=;" %%# in ('Type "%temp%\roms.tmp" ^| Sort') do (Start /B %MAME% %%# && Endlocal && Goto :Menu)

:Search
Call :Logo
%COLOUS% writesec "[7]     Busca una rom en tu colecion...      ([10]M[7]) Ejecutar M.A.M.E." 2>Nul && Echo+ || Echo:     Busca una rom en tu colecion...      (M) Ejecutar M.A.M.E. | MORE
%COLOUS% writesec "[7]     Ejemplo: [10]kof[7]                         ([10]V[7]) Volver..." 2>Nul && Echo+  || Echo:     Ejemplo: kof                         (V) Volver...         | MORE
%COLOUS% writesec "[7]                                          ([10]S[7]) Salir..." 2>Nul && Echo+ && Echo+ || Echo:                                          (S) Salir...          | MORE & Echo+
%COLOUS% writesec "[7] Nombre de la rom?" 2>Nul && Echo+                                                     || Echo:  ¨Nombre de la rom? | MORE
%COLOUS% Cursoron 2>Nul
Set /P ROM=^>^>
IF NOT defined ROM (Goto :Search)
IF /I "%ROM%" EQU "M" (Start /B %MAME% && Exit)
IF /I "%ROM%" EQU "V" (Goto :Menu)
IF /I "%ROM%" EQU "S" (Exit /B 0)
Cls
Echo+
%COLOUS% writesec "[7] Buscando roms con el patron [10]*%ROM%*[7] ..." 2>Nul && Echo+ || Echo: Buscando roms con el patr¢n: *%Rom%* ... | MORE
%COLOUS% Cursoron 2>Nul
Dir /B /A ".\Roms\*%rom%*" | MORE
Pause
Goto :Search

:Manager
Call :Logo
%COLOUS% writesec "[7]     ([10]1[7]) Descargar CheatDatabase          ([10]M[7]) Ejecutar M.A.M.E." 2>Nul && Echo+ || Echo:     (1) Descargar CheatDatabase          (M) Ejecutar M.A.M.E. | MORE
%COLOUS% writesec "[7]     ([10]2[7]) Ejecutar el limpiador            ([10]V[7]) Volver..." 2>Nul && Echo+         || Echo:     (2) Ejecutar el limpiador            (V) Volver...         | MORE
%COLOUS% writesec "[7]     ([10]3[7]) Eliminar una rom.                ([10]S[7]) Salir..." 2>Nul && Echo+ && Echo+ || Echo:     (3) Eliminar una rom.                (S) Salir...          | MORE & Echo+
%COLOUS% writesec "[7] Opcion?" 2>Nul && Echo+                                                                      || Echo:  ¨Opci¢n? | MORE
%COLOUS% Cursoron 2>Nul
Set /P ROM=^>^>
IF NOT defined ROM (Goto :Manager)
IF "%ROM%" EQU "1" (Call :Cheats)
IF "%ROM%" EQU "2" (Goto :Cleaner)
IF "%ROM%" EQU "3" (Goto :Delete)
IF /I "%ROM%" EQU "M" (Start /B %MAME% && Exit)
IF /I "%ROM%" EQU "V" (Goto :Menu)
IF /I "%ROM%" EQU "S" (Exit /B 0)
Goto :Manager

:Cheats
Call :Logo
IF NOT exist "%wget%" (Echo Para usar esta opcion necesita instalar wget... | MORE & Pause & Goto :EOF)
IF NOT exist "%zip%"  (Echo Para usar esta opcion necesita instalar 7zip... | MORE & Pause & Goto :EOF)
%COLOUS% writesec "[7] Conectando con la pagina de [10]Pugsy's [7]..." 2>Nul && Echo+ || Echo: Conectando con la pagina de Pugsy's ... | MORE
%WGET% -q -t 3 http://cheat.retrogames.com/ -O "%temp%\mameloader_cheat.html.tmp" 1>Nul
%COLOUS% writesec "[7] Buscando la ultima version del archivo ..." 2>Nul && Echo+ || Echo: Buscando la £ltima versi¢n del archivo ... | MORE
For /F "tokens=3 Delims==>" %%# in ('Type "%temp%\mameloader_cheat.html.tmp" ^| Find /I "XML Cheat Collection for MAME" ^| Find /V /I "ZIP"') Do (Set CheatDatabase=%%#)
%COLOUS% writesec "[7] Descargando [10]%CheatDatabase:~10,-1% [7]..." 2>Nul && Echo+ || Echo: Descargando %CheatDatabase:~10,-1% ... | MORE
%WGET% -q -t 3 "http://cheat.retrogames.com/%CheatDatabase:~1,-1%" -O "%temp%\%CheatDatabase:~10,-1%" 1>Nul
%COLOUS% writesec "[7] Descomprimiendo [10]%CheatDatabase:~10,-1% [7]en la carpeta [10]cheat [7]..." 2>Nul && Echo+ || Echo: Descomprimiendo %CheatDatabase:~10,-1% en la carpeta "cheat" ... | MORE
%ZIP% e "%temp%\%CheatDatabase:~10,-1%" -o"%temp%\" cheat.zip -aoa 1>nul
%ZIP% e "%temp%\cheat.zip" -o".\cheat\" *.xml -aoa 1>nul
Echo: Listo! | MORE
%COLOUS% Cursoron 2>Nul
Pause
Goto :EOF


:Cleaner
Setlocal enabledelayedexpansion
Call :Logo
Echo+
%COLOUS% writesec "[7]El limpiador se encarga de redimensionar las imagenes de la carpeta titles y eliminar los archivos de las demas carpetas que no tengan una rom asociada en la carpeta [10]ROMS[7]." 2>Nul && Echo+ || Echo: El limpiador se encarga de redimensionar las imagenes de la carpeta titles y eliminar los archivos de las demas carpetas que no tengan una rom asociada en la carpeta ROMS. | MORE
%COLOUS% writesec "[7]Los archivos listos para su eliminacion se moveran a la carpeta [10]_Eliminados [7]del directorio de MAME." 2>Nul && Echo+ || Echo: Los archivos listos para su eliminacion se moveran a la carpeta "_Eliminados" del directorio de MAME. | MORE
%COLOUS% Cursoron 2>Nul
Choice /M "¨Ejecutar el limpiador?"
IF !Errorlevel! EQU 2 (Goto :Manager) Else (Call :Logo)
Call :Resizer_title_png
Call :Resizer_title_ico
Call :Clean cfg
Call :Clean cheat
Call :Clean diff
Call :Clean icons
Call :Clean_Folder nvram
Call :Clean snap
Call :Clean titles
Echo: Listo. | MORE
%COLOUS% Cursoron 2>Nul
Pause
Goto :Manager

:Clean
%COLOUS% writesec "[7] Eliminando archivos sin rom asociada en la carpeta: [10]%~1" 2>Nul || Echo: Eliminando archivos sin rom asociada en la carpeta: %~1
FOR /F "Tokens=*" %%a in ('Dir /B /A ".\%~1" ^| Find /V /I "Default.cfg" ^| Find /V /I "output.xml"') do (
Set "Rom=%%a"
IF NOT exist ".\Roms\!Rom:~0,-4!.zip" (
IF NOT exist ".\Roms\!Rom:~0,-4!" (
%COLOUS% writesec "[14] %%a" 2>nul || Echo: %%a
MKDir ".\_Eliminados\%~1" 2>NUL
Move /Y "%~1\%%a" ".\_Eliminados\%~1\" >NUL
)
)
)
Echo+
Goto :EOF

:Clean_Folder
%COLOUS% writesec "[7] Eliminando archivos sin rom asociada en la carpeta: [10]%~1" 2>Nul || Echo: Eliminando archivos sin rom asociada en la carpeta: %~1
FOR /F "Tokens=*" %%a in ('Dir /B /AD ".\%~1" ^| Find /V /I "Default.cfg" ^| Find /V /I "output.xml"') do (
IF NOT exist ".\Roms\%%a.zip" (
%COLOUS% writesec "[14] %%a" 2>nul || Echo: %%a
MKDir ".\_Eliminados\%~1" 2>NUL
Move /Y "%~1\%%a" ".\_Eliminados\%~1\" >NUL
)
)
Echo+
Goto :EOF

:Resizer_title_png
REM Redimensionar titles a 512x512 px (Y formato PNG)
%COLOUS% writesec "[7] Redimensionando los titles a PNG 512x512 px ..." 2>Nul || Echo: Redimensionando los titles a PNG 512x512 px ...
%IRFANVIEW% "%CD%\titles\* /resize=(512,512) /resample /convert=*.png" 2>NUL || IF NOT exist "%IRFANVIEW%" (Echo: Para usar esta opcion necesita instalar Irfanview... | MORE)
Del /Q "%CD%\titles\*.bmp", "%CD%\titles\*.gif", "%CD%\titles\*.ico", "%CD%\titles\*.jpg", "%CD%\titles\*.jpeg", "%CD%\titles\*.tif" 2>Nul
Echo+
Goto :EOF

:Resizer_title_ico
REM Convertir titles a iconos 32x32
%COLOUS% writesec "[7] Convirtiendo los titles a iconos de 32x32 px ..." 2>Nul || Echo: Convirtiendo los titles a iconos de 32x32 px ...
%IRFANVIEW% "%CD%\titles\* /resize=(32,32) /convert=..\icons\*.ico" 2>NUL || IF NOT exist "%IRFANVIEW%" (Echo: Para usar esta opcion necesita instalar Irfanview... | MORE)
Echo+
Goto :EOF

:Delete
Call :Logo
%COLOUS% writesec "[7]     Elimina una rom escribiendo          ([10]M[7]) Ejecutar M.A.M.E." 2>Nul && Echo+        || Echo:     Busca una rom en tu colecion...      (M) Ejecutar M.A.M.E. | MORE
%COLOUS% writesec "[7]     su nombre...                         ([10]V[7]) Volver..." 2>Nul && Echo+                || Echo:     Ejemplo: kof                         (V) Volver...         | MORE
%COLOUS% writesec "[7]     Ejemplo: [10]kof2000[7]                     ([10]S[7]) Salir..." 2>Nul && Echo+ && Echo+ || Echo:                                          (S) Salir...          | MORE & Echo+
%COLOUS% writesec "[7] Nombre de la rom?" 2>Nul && Echo+                                                            || Echo:  ¨Nombre de la rom? | MORE
%COLOUS% Cursoron 2>Nul
Set /P ROM=^>^>
IF NOT defined ROM (Goto :Delete)
IF /I "%ROM%" EQU "M" (Start /B %MAME% && Exit)
IF /I "%ROM%" EQU "V" (Goto :Manager)
IF /I "%ROM%" EQU "S" (Exit /B 0)
Cls
Echo+
Set Rom=%ROM:.zip=%
IF NOT exist ".\Roms\%Rom%.zip" (
%COLOUS% writesec "[7] Rom no encontrada..." 2>Nul && Echo+ || Echo: Rom no encontrada... | MORE
%COLOUS% writesec "[7] Mostrando resultados parecidos:" 2>Nul && Echo+ || Echo: Mostrando resultados parecidos: | MORE
%COLOUS% Cursoron 2>Nul
Dir /B /A ".\Roms\*%rom%*" | MORE
Pause
) Else (
Del /Q ".\Roms\%Rom%.zip"
%COLOUS% writesec "[7] Rom [10]%ROM%.zip [7]eliminada ..." 2>Nul && Echo+ || Echo: Rom %ROM%.zip eliminada ... | MORE
%COLOUS% Cursoron 2>Nul
Pause
)
Goto :Delete

Salu2.:
925  Programación / Scripting / [Batch] [APORTE] Clock (Alternativa a AT) en: 4 Abril 2012, 06:55 am
Hola.

Estaba haciendo unas correcciones en un script de una persona en otro foro, Y me gustó bastante la idea del script, Así que decidí mejorarlo y simplificarlo...



- Codeado por Ianna. Modificado por Elektro H@cker.

Básicamente el script se podría comparar con el comando AT, Para realizar una acción determinada a una hora determinada (Eso si, Del mismo día).
Obviamente no es un programador de tareas, Ni está tán completo como para commpararlo, Pero de algún modo si.
CLOCK Pausa el proceso por lotes hasta que llega la hora, Y luego continua.

Ejemplos:

Código
  1. Clock 08:15:00 Echo+ Buenos dias!
Código
  1. Clock 22:50:00 Shutdown /R
Código
  1. @Echo OFF
  2. Clock 14:30:00
  3. Echo Ha llegado la hora de comer!

PD: Realizar un comando después de la hora no es algo obligatorio.

Citar
Suspende el proceso de un programa por lotes hasta la hora determinada.

» CLOCK [HORA:MINUTO:SEGUNDO]

Ejemplos:

» CLOCK 20:30:15
» CLOCK 22:50:00 Shutdown /R

La hora se aplica con un formato de 24 horas.

(Codeado por Ianna. Modificado por Elektro H@cker.)


El Script:

Código
  1. :::::::::::::::::::::
  2. ::: CLOCK UTILITY :::
  3. :::::::::::::::::::::
  4. ::: By El_Ianna
  5. ::: Mod by Elektro H@cker
  6.  
  7. @ECHO OFF
  8.  
  9. REM Comprobación de errores.
  10. IF "%~1" EQU "/?" (GOTO :HELP)
  11. IF "%*" EQU "" (GOTO :MSG)
  12.  
  13. REM Seteo de la hora seleccionada.
  14. SET "FINAL=%1"
  15. SET "FINAL=%FINAL::=%"
  16. IF "%FINAL:~0,1%" EQU "0" (Set FINAL=%FINAL:~1%)
  17.  
  18. REM Seteo de la acción.
  19. SET "ACTION=%*"
  20. SET "ACTION=%Action:~8%"
  21.  
  22. :SLEEP
  23. SET "HORARIO=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"
  24. SET "HORARIO=%Horario: =%"
  25. IF %HORARIO% GEQ %FINAL% (GOTO :END) ELSE (GOTO :SLEEP)
  26.  
  27. :HELP
  28. ECHO: MM'""""'YMM M""MMMMMMMM MMP"""""YMM MM'""""'YMM M""MMMMM""M
  29. ECHO: M' .mmm. `M M  MMMMMMMM M' .mmm. `M M' .mmm. `M M  MMMM' .M
  30. ECHO: M  MMMMMooM M  MMMMMMMM M  MMMMM  M M  MMMMMooM M       .MM
  31. ECHO: M  MMMMMMMM M  MMMMMMMM M  MMMMM  M M  MMMMMMMM M  MMMb. YM
  32. ECHO: M. `MMM' .M M  MMMMMMMM M. `MMM' .M M. `MMM' .M M  MMMMb  M
  33. ECHO: MM.     .dM M         M MMb     dMM MM.     .dM M  MMMMM  M
  34. ECHO: MMMMMMMMMMM MMMMMMMMMMM MMMMMMMMMMM MMMMMMMMMMM MMMMMMMMMMM | MORE & REM "
  35. ECHO: Suspende el proceso de un programa por lotes hasta la hora determinada. | MORE
  36. ECHO: ¯ CLOCK [HORA:MINUTO:SEGUNDO] | MORE
  37. ECHO: Ejemplos: | MORE
  38. ECHO: ¯ CLOCK 20:30:15
  39. ECHO: ¯ CLOCK 22:50:00 Shutdown /R | MORE
  40. ECHO: La hora se aplica con un formato de 24 horas. | MORE
  41. ECHO: (Codeado por Ianna. Modificado por Elektro H@cker.) | MORE
  42. EXit /B 0
  43.  
  44. :MSG
  45. ECHO msgbox "La sintaxis del comando no es correcta. CLOCK /? para mas informacion.",16,"Utilidad Clock (By Ianna)" > "%TEMP%\Clock.vbs"
  46. START /B Wscript "%TEMP%\Clock.vbs"
  47. Exit /B 1
  48.  
  49. :END
  50. ECHO: Utilidad Clock (By Ianna) | MORE
  51. IF Defined ACTION %Action%
926  Programación / Scripting / [Batch] [Ruby] Ctool (Convertidor de unidades Bytes, KB, MB, GB, TB y PB) en: 31 Marzo 2012, 17:52 pm


Una utilidad por linea de comandos para convertir entre bytes, kilobytes, megabytes, gigabytes, terabytes, y petabytes.

Citar
Como usarlo:
Código:
CTool.exe {Tamaño} {Unidad} {A unidad}
  Las unidades son: Bytes, KB, MB, GB, TB, PB.

 Ejemplos:

  - Convertir bytes a megabytes:
Código:
CTool 446.777.647.104 Bytes MB

  - Convertir megabytes a kilobytes:
Código:
CTool 44.33 MB KB

  - Convertir petabyte a todas las unidades:
Código:
CTool 1 PB

Algunas imagenes:

   

- El script convertido a EXE:



- Un ejemplo de uso en Batch, Para averiguar el espacio libre en el disco duro:
Código
  1. @Echo OFF
  2. For /f "tokens=3 delims= " %%# in ('Dir ^| find "libres"') do (Set "Bytes=%%#")
  3. For /f "tokens=2 delims==" %%# in ('Ctool %bytes% bytes gb ^| Find "="') do (Echo: Espacio libre en %Homedrive%%%#)

- El script, Codeado en Ruby:
  PD: Quizás no me ha quedado muy "bonito", Repito bastantes cosas que se podrian simplificar xD pero no estoy por la labor de hacerlo, Así como está ya funciona xD.

Código
  1. # -*- coding: UTF-8 -*-
  2.  
  3. # Conversion Tool v0.1
  4. # By Elektro H@cker
  5.  
  6. exit if Object.const_defined?(:Ocra)
  7.  
  8. def logo()
  9. puts "
  10.  _______  _______                __
  11. |   _   ||       |.-----..-----.|  |
  12. |.  1___||.|   | ||  _  ||  _  ||  |
  13. |.  |___ `-|.  |-'|_____||_____||__|
  14. |:  1   |  |:  |
  15. |::.. . |  |::.|    Conversion
  16. `-------'  `---'       Tool
  17.  
  18.  
  19. "
  20. end
  21.  
  22. def help()
  23. print "
  24. How to use it:
  25.  
  26.   #{__FILE__.split('/').last.split('.').first}.exe {Size} {Unit} {To unit}
  27.  
  28.   Units are: Bytes, KB, MB, GB, TB, PB.
  29.  
  30.  
  31. Examples:
  32.  
  33.  - Convert bytes to megabytes:
  34.  
  35.    #{__FILE__.split('/').last.split('.').first}.exe 446.777.647.104 Bytes MB
  36.  
  37.  - Convert megabytes to kilobytes:
  38.  
  39.    #{__FILE__.split('/').last.split('.').first}.exe 44.33 MB KB
  40.  
  41.  - Convert petabyte to all:
  42.  
  43.    #{__FILE__.split('/').last.split('.').first}.exe 1 PB
  44.  
  45. "
  46. Process.exit
  47. end
  48.  
  49. def BytesToUnit (number)
  50.  
  51.  @KILOBYTE   = 1024.0
  52.  @MEGABYTE = 1024.0 * 1024.0
  53.  @GIGABYTE  = 1024.0 * 1024.0 * 1024.0
  54.  @TERABYTE  = 1024.0 * 1024.0 * 1024.0 * 1024.0
  55.  @PETABYTE  = 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0
  56.  
  57. @Bytes = number.to_s + " Bytes"
  58.  
  59. @Kilos = (number / @KILOBYTE).to_s
  60.  if number.to_s.length > 20 and @Kilos.length > 3 and @Kilos.split('.').first.length == 1
  61.    @Kilos = "KB too depth"
  62.  elsif  not @Kilos.include? "-" and not @Kilos[0..3].eql? "0.00"
  63.     @Kilos = @Kilos.split('.').first + "." + @Kilos.split('.').last[0..1] + " KB"
  64.   elsif
  65.     @Kilos = "0.0 KB".to_s
  66.  end # Kilos
  67.  
  68. @Megas = (number / @MEGABYTE).to_s
  69.  if number.to_s.length > 20 and @Megas.length > 3 and @Megas.split('.').first.length == 1
  70.    @Megas = "MB too depth"
  71.  elsif  not @Megas.include? "-" and not @Megas[0..3].eql? "0.00"
  72.     @Megas = @Megas.split('.').first + "." + @Megas.split('.').last[0..1] + " MB"
  73.   elsif
  74.     @Megas = "0.0 MB".to_s
  75.   end # Megas
  76.  
  77. @Gigas = (number / @GIGABYTE).to_s
  78.  if number.to_s.length > 20 and @Gigas.length > 3 and @Gigas.split('.').first.length == 1
  79.    @Gigas = "GB too depth"
  80.  elsif not @Gigas.include? "-"
  81.     @Gigas = @Gigas.split('.').first + "." + @Gigas.split('.').last[0..1] + " GB"
  82.   elsif
  83.     @Gigas = "0.0 GB".to_s
  84.   end # Gigas
  85.  
  86. @Teras = (number / @TERABYTE).to_s
  87.  if number.to_s.length > 20 and @Teras.length > 3 and @Teras.split('.').first.length == 1
  88.    @Teras = "TB too depth"
  89.  elsif not @Teras.include? "-"
  90.     @Teras = @Teras.split('.').first + "." + @Teras.split('.').last[0..1] + " TB"
  91.   elsif
  92.     @Teras = "0.0 TB".to_s
  93.   end # Teras
  94.  
  95. @Petas = (number / @PETABYTE).to_s
  96.  if number.to_s.length > 20 and @Petas.length > 3 and @Petas.split('.').first.length == 1
  97.    @Petas = "PB too depth"
  98.  elsif not @Petas.include? "-"
  99.     @Petas = @Petas.split('.').first + "." + @Petas.split('.').last[0..1] + " PB"
  100.   elsif
  101.     @Petas = "0.0 PB".to_s
  102.   end # Petas
  103. end
  104.  
  105. def KBToUnit (number)
  106.  
  107.  @BYTE           = 1024.0
  108.  @MEGABYTE = 1024.0
  109.  @GIGABYTE  = 1024.0 * 1024.0
  110.  @TERABYTE  = 1024.0 * 1024.0 * 1024.0
  111.  @PETABYTE  = 1024.0 * 1024.0 * 1024.0 * 1024.0
  112.  
  113. @Bytes = (number * @BYTE).to_s
  114.  if number.to_s.length > 20 and @Bytes.length > 3 and @Bytes.split('.').first.length == 1
  115.    @Bytes = "Bytes too depth"
  116.  elsif @Bytes[0..2].eql? "0.0"
  117.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0..1] + " Bytes"
  118.  elsif
  119.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0] + " Bytes"
  120.  end # Bytes
  121.  
  122. @Kilos = number.to_s + " KB"
  123.  
  124. @Megas = (number / @MEGABYTE).to_s
  125.  if number.to_s.length > 20 and @Megas.length > 3 and @Megas.split('.').first.length == 1
  126.    @Megas = "MB too depth"
  127.  elsif  not @Megas.include? "-" and not @Megas[0..3].eql? "0.00"
  128.     @Megas = @Megas.split('.').first + "." + @Megas.split('.').last[0..1] + " MB"
  129.   elsif
  130.     @Megas = "0.0 MB".to_s
  131.   end # Megas
  132.  
  133. @Gigas = (number / @GIGABYTE).to_s
  134.  if number.to_s.length > 20 and @Gigas.length > 3 and @Gigas.split('.').first.length == 1
  135.    @Gigas = "GB too depth"
  136.  elsif not @Gigas.include? "-"
  137.     @Gigas = @Gigas.split('.').first + "." + @Gigas.split('.').last[0..1] + " GB"
  138.   elsif
  139.     @Gigas = "0.0 GB".to_s
  140.   end # Gigas
  141.  
  142. @Teras = (number / @TERABYTE).to_s
  143.  if number.to_s.length > 20 and @Teras.length > 3 and @Teras.split('.').first.length == 1
  144.    @Teras = "TB too depth"
  145.  elsif not @Teras.include? "-"
  146.     @Teras = @Teras.split('.').first + "." + @Teras.split('.').last[0..1] + " TB"
  147.   elsif
  148.     @Teras = "0.0 TB".to_s
  149.   end # Teras
  150.  
  151. @Petas = (number / @PETABYTE).to_s
  152.  if number.to_s.length > 20 and @Petas.length > 3 and @Petas.split('.').first.length == 1
  153.    @Petas = "PB too depth"
  154.  elsif not @Petas.include? "-"
  155.     @Petas = @Petas.split('.').first + "." + @Petas.split('.').last[0..1] + " PB"
  156.   elsif
  157.     @Petas = "0.0 PB".to_s
  158.   end # Petas
  159. end
  160.  
  161. def MBToUnit (number)
  162.  
  163.  @BYTE           = 1024.0 * 1024.0
  164.  @KILOBYTE   = 1024.0
  165.  @GIGABYTE  = 1024.0
  166.  @TERABYTE  = 1024.0 * 1024.0
  167.  @PETABYTE  = 1024.0 * 1024.0 * 1024.0
  168.  
  169. @Bytes = (number * @BYTE).to_s
  170.  if number.to_s.length > 20 and @Bytes.length > 3 and @Bytes.split('.').first.length == 1
  171.    @Bytes = "Bytes too depth"
  172.  elsif @Bytes[0..2].eql? "0.0"
  173.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0..1] + " Bytes"
  174.  elsif
  175.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0] + " Bytes"
  176.  end # Bytes
  177.  
  178. @Kilos = (number * @KILOBYTE).to_s
  179.  if number.to_s.length > 20 and @Kilos.length > 3 and @Kilos.split('.').first.length == 1
  180.    @Kilos = "KB too depth"
  181.  elsif  not @Kilos.include? "-" and not @Kilos[0..3].eql? "0.00"
  182.     @Kilos = @Kilos.split('.').first + "." + @Kilos.split('.').last[0..1] + " KB"
  183.   elsif
  184.     @Kilos = "0.0 KB".to_s
  185.  end # Kilos
  186.  
  187. @Megas = number.to_s + " MB"
  188.  
  189. @Gigas = (number / @GIGABYTE).to_s
  190.  if number.to_s.length > 20 and @Gigas.length > 3 and @Gigas.split('.').first.length == 1
  191.    @Gigas = "GB too depth"
  192.  elsif not @Gigas.include? "-"
  193.     @Gigas = @Gigas.split('.').first + "." + @Gigas.split('.').last[0..1] + " GB"
  194.   elsif
  195.     @Gigas = "0.0 GB".to_s
  196.   end # Gigas
  197.  
  198. @Teras = (number / @TERABYTE).to_s
  199.  if number.to_s.length > 20 and @Teras.length > 3 and @Teras.split('.').first.length == 1
  200.    @Teras = "TB too depth"
  201.  elsif not @Teras.include? "-"
  202.     @Teras = @Teras.split('.').first + "." + @Teras.split('.').last[0..1] + " TB"
  203.   elsif
  204.     @Teras = "0.0 TB".to_s
  205.   end # Teras
  206.  
  207. @Petas = (number / @PETABYTE).to_s
  208.  if number.to_s.length > 20 and @Petas.length > 3 and @Petas.split('.').first.length == 1
  209.    @Petas = "PB too depth"
  210.  elsif not @Petas.include? "-"
  211.     @Petas = @Petas.split('.').first + "." + @Petas.split('.').last[0..1] + " PB"
  212.   elsif
  213.     @Petas = "0.0 PB".to_s
  214.   end # Petas
  215. end
  216.  
  217. def GBToUnit (number)
  218.  
  219.  @BYTE           = 1024.0 * 1024.0 * 1024.0
  220.  @KILOBYTE   = 1024.0 * 1024.0
  221.  @MEGABYTE = 1024.0
  222.  @TERABYTE  = 1024.0
  223.  @PETABYTE  = 1024.0 * 1024.0
  224.  
  225. @Bytes = (number * @BYTE).to_s
  226.  if number.to_s.length > 20 and @Bytes.length > 3 and @Bytes.split('.').first.length == 1
  227.    @Bytes = "Bytes too depth"
  228.  elsif @Bytes[0..2].eql? "0.0"
  229.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0..1] + " Bytes"
  230.  elsif
  231.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0] + " Bytes"
  232.  end # Bytes
  233.  
  234. @Kilos = (number * @KILOBYTE).to_s
  235.  if number.to_s.length > 20 and @Kilos.length > 3 and @Kilos.split('.').first.length == 1
  236.    @Kilos = "KB too depth"
  237.  elsif  not @Kilos.include? "-" and not @Kilos[0..3].eql? "0.00"
  238.     @Kilos = @Kilos.split('.').first + "." + @Kilos.split('.').last[0..1] + " KB"
  239.   elsif
  240.     @Kilos = "0.0 KB".to_s
  241.  end # Kilos
  242.  
  243. @Megas = (number * @MEGABYTE).to_s
  244.  if number.to_s.length > 20 and @Megas.length > 3 and @Megas.split('.').first.length == 1
  245.    @Megas = "MB too depth"
  246.  elsif  not @Megas.include? "-" and not @Megas[0..3].eql? "0.00"
  247.     @Megas = @Megas.split('.').first + "." + @Megas.split('.').last[0..1] + " MB"
  248.   elsif
  249.     @Megas = "0.0 MB".to_s
  250.  end # Megas
  251.  
  252. @Gigas = number.to_s + " GB"
  253.  
  254. @Teras = (number / @TERABYTE).to_s
  255.  if number.to_s.length > 20 and @Teras.length > 3 and @Teras.split('.').first.length == 1
  256.    @Teras = "TB too depth"
  257.  elsif not @Teras.include? "-"
  258.     @Teras = @Teras.split('.').first + "." + @Teras.split('.').last[0..1] + " TB"
  259.   elsif
  260.     @Teras = "0.0 TB".to_s
  261.   end # Teras
  262.  
  263. @Petas = (number / @PETABYTE).to_s
  264.  if number.to_s.length > 20 and @Petas.length > 3 and @Petas.split('.').first.length == 1
  265.    @Petas = "PB too depth"
  266.  elsif not @Petas.include? "-"
  267.     @Petas = @Petas.split('.').first + "." + @Petas.split('.').last[0..1] + " PB"
  268.   elsif
  269.     @Petas = "0.0 PB".to_s
  270.   end # Petas
  271. end
  272.  
  273. def TBToUnit (number)
  274.  
  275.  @BYTE           = 1024.0 * 1024.0 * 1024.0 * 1024.0
  276.  @KILOBYTE   = 1024.0 * 1024.0 * 1024.0
  277.  @MEGABYTE = 1024.0 * 1024.0
  278.  @GIGABYTE  = 1024.0
  279.  @PETABYTE  = 1024.0
  280.  
  281. @Bytes = (number * @BYTE).to_s
  282.  if number.to_s.length > 20 and @Bytes.length > 3 and @Bytes.split('.').first.length == 1
  283.    @Bytes = "Bytes too depth"
  284.  elsif @Bytes[0..2].eql? "0.0"
  285.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0..1] + " Bytes"
  286.  elsif
  287.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0] + " Bytes"
  288.  end # Bytes
  289.  
  290. @Kilos = (number * @KILOBYTE).to_s
  291.  if number.to_s.length > 20 and @Kilos.length > 3 and @Kilos.split('.').first.length == 1
  292.    @Kilos = "KB too depth"
  293.  elsif  not @Kilos.include? "-" and not @Kilos[0..3].eql? "0.00"
  294.     @Kilos = @Kilos.split('.').first + "." + @Kilos.split('.').last[0..1] + " KB"
  295.   elsif
  296.     @Kilos = "0.0 KB".to_s
  297.  end # Kilos
  298.  
  299. @Megas = (number * @MEGABYTE).to_s
  300.  if number.to_s.length > 20 and @Megas.length > 3 and @Megas.split('.').first.length == 1
  301.    @Megas = "MB too depth"
  302.  elsif  not @Megas.include? "-" and not @Megas[0..3].eql? "0.00"
  303.     @Megas = @Megas.split('.').first + "." + @Megas.split('.').last[0..1] + " MB"
  304.   elsif
  305.     @Megas = "0.0 MB".to_s
  306.  end # Megas
  307.  
  308. @Gigas = (number * @GIGABYTE).to_s
  309.  if number.to_s.length > 20 and @Gigas.length > 3 and @Gigas.split('.').first.length == 1
  310.    @Gigas = "GB too depth"
  311.  elsif not @Gigas.include? "-"
  312.     @Gigas = @Gigas.split('.').first + "." + @Gigas.split('.').last[0..1] + " GB"
  313.   elsif
  314.     @Gigas = "0.0 GB".to_s
  315.   end # Gigas
  316.  
  317. @Teras = number.to_s + " TB"
  318.  
  319. @Petas = (number / @PETABYTE).to_s
  320.  if number.to_s.length > 20 and @Petas.length > 3 and @Petas.split('.').first.length == 1
  321.    @Petas = "PB too depth"
  322.  elsif not @Petas.include? "-"
  323.     @Petas = @Petas.split('.').first + "." + @Petas.split('.').last[0..1] + " PB"
  324.   elsif
  325.     @Petas = "0.0 PB".to_s
  326.   end # Petas
  327. end
  328.  
  329. def PBToUnit (number)
  330.  
  331.  @BYTE          = 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0
  332.  @KILOBYTE   = 1024.0 * 1024.0 * 1024.0 * 1024.0
  333.  @MEGABYTE = 1024.0 * 1024.0 * 1024.0
  334.  @GIGABYTE  = 1024.0 * 1024.0
  335.  @TERABYTE  = 1024.0
  336.  
  337. @Bytes = (number * @BYTE).to_s
  338.  if number.to_s.length > 20 and @Bytes.length > 3 and @Bytes.split('.').first.length == 1
  339.    @Bytes = "Bytes too depth"
  340.  elsif @Bytes[0..2].eql? "0.0"
  341.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0..1] + " Bytes"
  342.  elsif
  343.    @Bytes = @Bytes.split('.').first + "." + @Bytes.split('.').last[0] + " Bytes"
  344.  end # Bytes
  345.  
  346. @Kilos = (number * @KILOBYTE).to_s
  347.  if number.to_s.length > 20 and @Kilos.length > 3 and @Kilos.split('.').first.length == 1
  348.    @Kilos = "KB too depth"
  349.  elsif  not @Kilos.include? "-" and not @Kilos[0..3].eql? "0.00"
  350.     @Kilos = @Kilos.split('.').first + "." + @Kilos.split('.').last[0..1] + " KB"
  351.   elsif
  352.     @Kilos = "0.0 KB".to_s
  353.  end # Kilos
  354.  
  355. @Megas = (number * @MEGABYTE).to_s
  356.  if number.to_s.length > 20 and @Megas.length > 3 and @Megas.split('.').first.length == 1
  357.    @Megas = "MB too depth"
  358.  elsif  not @Megas.include? "-" and not @Megas[0..3].eql? "0.00"
  359.     @Megas = @Megas.split('.').first + "." + @Megas.split('.').last[0..1] + " MB"
  360.   elsif
  361.     @Megas = "0.0 MB".to_s
  362.  end # Megas
  363.  
  364. @Gigas = (number * @GIGABYTE).to_s
  365.  if number.to_s.length > 20 and @Gigas.length > 3 and @Gigas.split('.').first.length == 1
  366.    @Gigas = "GB too depth"
  367.  elsif not @Gigas.include? "-"
  368.     @Gigas = @Gigas.split('.').first + "." + @Gigas.split('.').last[0..1] + " GB"
  369.   elsif
  370.     @Gigas = "0.0 GB".to_s
  371.   end # Gigas
  372.  
  373. @Teras = (number * @TERABYTE).to_s
  374.  if number.to_s.length > 20 and @Teras.length > 3 and @Teras.split('.').first.length == 1
  375.    @Teras = "TB too depth"
  376.  elsif not @Teras.include? "-"
  377.     @Teras = @Teras.split('.').first + "." + @Teras.split('.').last[0..1] + " TB"
  378.   elsif
  379.     @Teras = "0.0 TB".to_s
  380.   end # Teras
  381.  
  382. @Petas = number.to_s + " PB"
  383. end
  384.  
  385. # Error control
  386. def args()
  387.  if ARGV.empty? or ARGV[0] == "/?" or ARGV[1] == nil  or ARGV[2] == nil and not ARGV[1] == "bytes" and not ARGV[1] == "Bytes" and not ARGV[1] == "BYTES" and not ARGV[1] == "kb" and not ARGV[1] == "Kb" and not ARGV[1] == "KB" and not ARGV[1] == "kB" and not ARGV[1] == "mb" and not ARGV[1] == "Mb" and not ARGV[1] == "MB" and not ARGV[1] == "mB" and not ARGV[1] == "gb" and not ARGV[1] == "gB" and not ARGV[1] == "Gb" and not ARGV[1] == "GB" and not ARGV[1] == "tb" and not ARGV[1] == "Tb" and not ARGV[1] == "TB" and not ARGV[1] == "tB" and not ARGV[1] == "pb" and not ARGV[1] == "pB" and not ARGV[1] == "Pb" and not ARGV[1] == "PB"
  388.    help()
  389.  elsif not ARGV[2] == "bytes" and not ARGV[2] == "Bytes" and not ARGV[2] == "BYTES" and not ARGV[2] == "kb" and not ARGV[2] == "Kb" and not ARGV[2] == "KB" and not ARGV[2] == "kB" and not ARGV[2] == "mb" and not ARGV[2] == "Mb" and not ARGV[2] == "MB" and not ARGV[2] == "mB" and not ARGV[2] == "gb" and not ARGV[2] == "gB" and not ARGV[2] == "Gb" and not ARGV[2] == "GB" and not ARGV[2] == "tb" and not ARGV[2] == "Tb" and not ARGV[2] == "TB" and not ARGV[2] == "tB" and not ARGV[2] == "pb" and not ARGV[2] == "pB" and not ARGV[2] == "Pb" and not ARGV[2] == "PB"
  390.    $ToUnit = "all"
  391.  end
  392. end
  393.  
  394. # Process
  395. logo()
  396. args()
  397.  
  398. input = ARGV[0]
  399. unit = ARGV[1]
  400. $ToUnit = ARGV[2]
  401.  
  402. input = input.gsub(',', '.')
  403.  
  404. if not input.length == 6 or not input.length == 5 and not input[-3] == "."
  405.  input = input.gsub('.', '')
  406.  input = input.to_i
  407. elsif
  408.  input = input.to_f
  409. end
  410.  
  411. if unit =~ /bytes/i
  412.  BytesToUnit(input)
  413. elsif unit =~ /kb/i
  414.  KBToUnit(input)
  415. elsif unit =~ /mb/i
  416.  MBToUnit(input)
  417. elsif unit =~ /gb/i
  418.  GBToUnit(input)
  419. elsif unit =~ /tb/i
  420.  TBToUnit(input)
  421. elsif unit =~ /pb/i
  422.  PBToUnit(input)
  423. end
  424.  
  425. if $ToUnit =~ /bytes/i
  426.  puts "#{input} #{unit} = #{@Bytes}"
  427. elsif $ToUnit =~ /kb/i
  428.  puts "#{input} #{unit} = #{@Kilos}"
  429. elsif $ToUnit =~ /mb/i
  430.  puts "#{input} #{unit} = #{@Megas}"
  431. elsif $ToUnit =~ /gb/i
  432.  puts "#{input} #{unit} = #{@Gigas}"
  433. elsif $ToUnit =~ /tb/i
  434.  puts "#{input} #{unit} = #{@Teras}"
  435. elsif $ToUnit =~ /pb/i
  436.  puts "#{input} #{unit} = #{@Petas}"
  437. elsif $ToUnit == nil
  438.  puts "#{input} #{unit} = #{@Bytes}"
  439.  puts "#{input} #{unit} = #{@Kilos}"
  440.  puts "#{input} #{unit} = #{@Megas}"
  441.  puts "#{input} #{unit} = #{@Gigas}"
  442.  puts "#{input} #{unit} = #{@Teras}"
  443.  puts "#{input} #{unit} = #{@Petas}"
  444. end
  445.  
  446. __END__
927  Programación / Scripting / [BATCH/RUBY] [APORTE] REG2BAT (Convierte archivos REG a BAT) en: 30 Marzo 2012, 01:28 am


Un simple programa por línea de comandos que convierte archivos de registro (.REG) a archivos por lotes (.BAT)

 Modo de empleo:
Código:
REG2BAT.exe [Archivo]

 Ejemplos:
Código:
REG2BAT.exe Archivo.reg
REG2BAT.exe *.reg
REG2BAT.exe *

Ahora con un sencillo instalador!
Convierte archivos con un solo click del ratón! ::)


(Hecho especialmente para aquellos Batcheros que no disponen del intérprete de Ruby  :-[)



Nota:
Esta version solamente es compatible con archivos de registro en codificación Unicode, debido a las mejoras para evitar los bugs corregidos.



Test.reg
(Un simple archivo de registro para que puedan testear el programa.)

Código:
Windows Registry Editor Version 5.00

# Delete test:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"my key"=-
[-HKEY_CURRENT_USER\test]

# Add Test
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"Binary Test"=hex:da,da,d2,dd,d0
"Dword Test"=dword:23523626
"Expand SZ Test"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,00,00
"Multi SZ Test"=hex(7):22,00,63,00,3a,00,5c,00,70,00,72,00,6f,00,67,00,72,00,\
  61,00,6d,00,20,00,66,00,69,00,6c,00,65,00,73,00,5c,00,74,00,65,00,73,00,74,\
  00,2e,00,65,00,78,00,65,00,22,00,00,00,00,00
"Qword Test"=hex(b):2f,3b,00,00,00,00,00,00
"SZ Test"="Wscript.exe \"C:\\Program Files (x86)\\RUN.vbs\""

La conversión del test.reg:

Código
  1. REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "my key" /F
  2. REG DELETE "HKCU\test" /F
  3. REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "Binary Test" /T "REG_BINARY" /D dadad2ddd0 /F
  4. REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "Dword Test" /T "REG_DWORD" /D 0x23523626 /F
  5. REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "Expand SZ Test" /T "REG_EXPAND_SZ" /D "%%windir%%" /F
  6. REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "Qword Test" /T "REG_QWORD" /D "0x0000000000003b2f" /F
  7. REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "Multi SZ Test" /T "REG_MULTI_SZ" /D "\"c:\program files\test.exe\"" /F
  8. REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "SZ Test" /T "REG_SZ" /D "Wscript.exe \"C:\Program Files (x86)\RUN.vbs\"" /F



REG2BAT.rb

Versión 0.3

Soporte para convertir lineas de comentario a comentario de Batch
Se ha mejorado la eficacia de conversión para evitar al 100% problemas con claves de varias lineas.

Bugs corregidos:
 - Error al intentar convertir una clave binaria de varias lineas
 - Error al convertir claves predeterminadas

Versión 0.2
Ahora soporta el uso del comodín *
Código:
REG2BAT *
REG2BAT *.reg

Código:
# -*- coding: UTF-8 -*-


# # # # # # # # # # # # # # # # # # #

#           REG2BAT v0.3            #          

#         By Elektro H@cker         #

#  Tested with REGEDIT 5.0 version  #

# # # # # # # # # # # # # # # # # # #


require 'tmpdir'
exit if Object.const_defined?(:Ocra)

def logo
  puts "
 _  .-')     ('-.                              .-. .-')     ('-.     .-') _    
( \\( -O )  _(  OO)                             \\  ( OO )   ( OO ).-.(  OO) )  
 ,------. (,------. ,----.         .-----.      ;-----.\\   / . --. //     '._  
 |   /`. ' |  .---''  .-./-')     / ,-.   \\     | .-.  |   | \\-.  \\ |'--...__)
 |  /  | | |  |    |  |_( O- )    '-'  |  |     | '-' /_).-'-'  |  |'--.  .--'
 |  |_.' |(|  '--. |  | .--, \\       .'  /      | .-. `.  \\| |_.'  |   |  |    
 |  .  '.' |  .--'(|  | '. (_/     .'  /__      | |  \\  |  |  .-.  |   |  |    
 |  |\\  \\  |  `---.|  '--'  |     |       |     | '--'  /  |  | |  |   |  |    
 `--' '--' `------' `------'      `-------'     `------'   `--' `--'   `--'    
  "

  puts "

                          Coded by Elektro H@cker

                      ▄                        ▄█████  
                      ███▄▄        ▄▄▄▄▄▄▄▄█████████▀  
                      ██████▀ ▄▄████████████████████  
                      ▀████ ▄███████████████████████▄  
                       ███ ▄███████████████████████████
                       ▀█ █████████████████▀▀   ██ ████
                      ▄▄█████████████████▀      ██ ████
                      ███▀▀████████████▀       ▄█  ████
                      ███▄    ▀▀█████▀ ▄▀▄    ▄█  ▄████
                       ███▄▄  ▄▀▄ ▀███▄▀▀  ▄▄▀█▀  █████
                      ▄▄█▄▀█▄▄ ▀▀████████▀███  ▄ ██████
                      ▀████▄▀▀▀██▀▀██▀▀██  ▀█  █▄█████
                        ▀▀███▄ ▀█  ▀█   ▀ █   ▄██████ ▄
                      ████▄▄▀██▄ █  ▄  █▄ ███ ████▀▀ ▄█
                      █▀▀▀▀▀▀ █████▄█▄▄████████▀ ▄▄ ▄██
                       ▄▄█▀▀   ▀█▀██████████▀ ▄███  █▀
                      ██▀   ▄▄▀  ▄ ▀▀▀████▀ ▄████      
                      █ ▄██  ▄██      ▀█  ████  ▄███▄
                        ▄███ ▄███            ▀▀  ▄   ▀▀
  "
  sleep 0.5
end

def help()
  print "\n How to use:\n\n"
  print "  " + __FILE__.split('/').last + " [File]\n\n"
  print "\n Examples:\n\n"
  print "  " + __FILE__.split('/').last + " File.reg\n\n"
  print "  " + __FILE__.split('/').last + " *.reg\n\n"
  print "  " + __FILE__.split('/').last + " *\n\n"
  Process.exit
end

def expand(string)

# Comment line
  if string[0].eql? (';')
      $key = string
      print "[COMMENT] #{string}\n"
      write_comment()
      $key = ''
  end # Comment line

# Key to delete
  if string[0..1].eql? ('[-')
    $key = string[2..-2]
    $key = $key.gsub('HKEY_CLASSES_ROOT', 'HKCR').gsub('HKEY_CURRENT_USER', 'HKCU').gsub('HKEY_LOCAL_MACHINE', 'HKLM').gsub('HKEY_USERS', 'HKU')
    $subkey = ''
    print "IN: [-#{$key}]\n\n"
    write_delete()
    $key = ''

# Key to add
  elsif string[0..0].eql? ('[') and string[-1].eql? (']')
    $key = string[1..-2]
    $key = $key.gsub('HKEY_CLASSES_ROOT', 'HKCR').gsub('HKEY_CURRENT_USER', 'HKCU').gsub('HKEY_LOCAL_MACHINE', 'HKLM').gsub('HKEY_USERS', 'HKU')
    print "IN: #{string}\n\n"

#Subkey to delete
  elsif string[-1].eql? ('-')
    $subkey = string
    $subkey = $subkey[0..-3]
    print "[REG] #{string}\n"
    write_delete
    $key = ''

#Subkey to add
  elsif string.include? '"'
    if not $key.eql? ''

      $subkey = string
      $subkey = $subkey.gsub('\\\\', '\\')
      $subkey = $subkey.gsub(      '@=' , ' "" /D '                )
      $subkey = $subkey.gsub(   '=hex:' , ' /T "REG_BINARY" /D '   )
      $subkey = $subkey.gsub('=hex(2):' , ' /T "REG_EXPAND_SZ" /D ')
      $subkey = $subkey.gsub('=hex(7):' , ' /T "REG_MULTI_SZ" /D ' )
      $subkey = $subkey.gsub('=hex(b):' , ' /T "REG_QWORD" /D '    )
      $subkey = $subkey.gsub( '=dword:' , ' /T "REG_DWORD" /D '    )
      $subkey = $subkey.gsub(     '"="' ,'" /T "REG_SZ" /D "'      )

      # BIANRY
        if $subkey.include? 'REG_BINARY'
           $subkey = $subkey.gsub(',' , '')
        end # BINARY

      # DWORD
        if $subkey.include? 'REG_DWORD'
           $DWORD_data = $subkey.split('/D').last
           $New_DWORD_data =  ' 0x' + $DWORD_data[1..-1]
           $subkey = $subkey.gsub($DWORD_data, $New_DWORD_data)
        end # DWORD

      # QWORD
        if $subkey.include? 'REG_QWORD'
           $QWORD_data = $subkey.split('/D').last.gsub(',','').gsub(' ', '')
           hex_string_len = $QWORD_data.length
           $New_QWORD_data = ''
           min = -2
           until min < -hex_string_len
             hex_string_block = $QWORD_data[min,2]
             $New_QWORD_data << hex_string_block
             min -= 2
           end # until
           $subkey = $subkey.split('/D').first + '/D "0x' + $New_QWORD_data + '"'
        end # QWORD

      # EXPAND
      #   &
      # MULTI
        if $subkey.include? 'REG_EXPAND_SZ' or $subkey.include? 'REG_MULTI_SZ'
           hex_string = $subkey.split('/D').last.gsub(' ', '').gsub('\\', '').gsub(',00', '').gsub('00,', '').gsub(',', '')
           hex_string_len = hex_string.length
           $New_hex_data = ''
           min = 0
           until min == hex_string_len
             $New_hex_data << hex_string[min,2].hex.chr
             min += 2
           end # until
           $New_hex_data = $New_hex_data.gsub('"', '\"').gsub('%', '%%')
           $subkey = $subkey.split('/D').first + '/D "' + $New_hex_data + '"'
        end # EXPAND & MULTI

      print "[REG] #{string}\n"
      write_add()
      $subkey = ''
    end # if not $key.eql? ''
  end # if & elsifs
end

def write_delete()
  if not $subkey.eql? ""
    File.open(ARGV[$num][0..-4] + "bat", 'a+') do |file|
      file.print "REG DELETE \"#{$key}\" /V #{$subkey} /F \n"
      print "[BAT] REG DELETE \"#{$key}\" /V #{$subkey} /F \n\n"
    end # file (1)
  elsif
    File.open(ARGV[$num][0..-4] + "bat", 'a+') do |file|  
      file.print "REG DELETE \"#{$key}\" /F \n"
      print "[BAT] REG DELETE \"#{$key}\" /F \n\n"
    end # file (2)
  end # if & elsifs
end

def write_add()
  File.open(ARGV[$num][0..-4] + "bat", 'a+') do |file|  
    file.print "REG ADD \"#{$key}\" /V #{$subkey} /F \n"
    print "[BAT] REG ADD \"#{$key}\" /V #{$subkey} /F \n\n"
  end # file
end

def write_comment()
  File.open(ARGV[$num][0..-4] + "bat", 'a+') do |file|  
    file.print "REM #{$key}\n"
  end # file
end

def args()
  if ARGV.empty? or ARGV[$num] == "/?"
    help()
  elsif ARGV[$num] == nil
    print "Finished.\n"
    Process.exit
  elsif not File.exist? (ARGV[$num])
    print "\n ERROR.               File doesn't exist...\n\n"
    help()
  elsif not ARGV[$num].split('.').last.eql? "reg" and not ARGV[$num].split('.').last.eql? "REG"
    print "\n ERROR.               File " + ARGV[$num] + " is not a valid registry...\n\n"
    $num += 1
    if ARGV.length == 1
      print "Finished.\n"
      Process.exit
    end # ARGV.length
  args()
  end # if & elsifs
end

########################################################################################################

string = ''
$string_hex = ''
$num = 0
$regcode = ''

logo()
args()

while not $num == ARGV.length or $num < ARGV.length
  args()
  File.open(ARGV[$num], "r:utf-16le:UTF-8").each_line { |line|
    if line[0..1].eql?   "  "  then line = line[2..-1] end
    if line[-3..-2].eql? ",\\" then line = line[0..-3] end
    $regcode = $regcode + line
  }
  File.open("#{Dir.tmpdir}/#{ARGV[$num].split('\\').last}", 'a+') { |file| file.puts $regcode }
  File.open("#{Dir.tmpdir}/#{ARGV[$num].split('\\').last}", "r").each_line { |string| expand(string[0..-2]) and string = ''}
  File.open("#{Dir.tmpdir}/#{ARGV[$num].split('\\').last}", "w") { |delete| delete.print "" }
  $regcode = ''
  $num += 1
end # while

puts "Finished.\n"
__END__




Saludos  :D
928  Programación / Scripting / [Batch] [APORTE] Text Protector en: 23 Marzo 2012, 21:07 pm



Un pequeño programa commandline para proteger sus archivos con contenido de texto para que queden inteligibles a ojos de otra persona.

Ejemplo:

Antes:
Código:
@Echo off
chcp 1252 >nul
Echo Test | More
Echo abc123 áéíóú ñ Ñ € ^
Pause

Después:
Código:
charlist[65,1]charlist[31,1]charlist[3,1]charlist[8,1]charlist[15,1]charlist[0,1]charlist[15,1]charlist[6,1]charlist[6,1]
charlist[3,1]charlist[16,1]charlist[3,1]charlist[8,1]charlist[0,1]charlist[54,1]charlist[55,1]charlist[58,1]charlist[55,1]charlist[0,1]charlist[78,1]charlist[14,1]charlist[21,1]charlist[12,1]
charlist[31,1]charlist[3,1]charlist[8,1]charlist[15,1]charlist[0,1]charlist[46,1]charlist[5,1]charlist[19,1]charlist[20,1]charlist[0,1]charlist[64,1]charlist[0,1]charlist[39,1]charlist[15,1]charlist[18,1]charlist[5,1]
charlist[31,1]charlist[3,1]charlist[8,1]charlist[15,1]charlist[0,1]charlist[1,1]charlist[2,1]charlist[3,1]charlist[54,1]charlist[55,1]charlist[56,1]charlist[0,1]charlist[172,1]charlist[147,1]charlist[174,1]charlist[175,1]charlist[110,1]charlist[0,1]charlist[202,1]charlist[0,1]charlist[203,1]charlist[0,1]charlist[210,1]charlist[0,1]charlist[92,1]
charlist[42,1]charlist[1,1]charlist[21,1]charlist[19,1]charlist[5,1]



- Testeado con archivos .bat (ANSI y UTF-8), .cmd, .rb, .rbw, .py, .pyw, .txt (ANSI y UTF-8), .reg y .vbs. Pero debería soportar cualquier archivo de tipo texto.

- No hay ningún tipo de problema con ningún caracter convencional de un teclado.

- Soporta una gran cantidad de caracteres adicionales.

DESCARGA (Correjido un despiste con el caracter "x" e "y"): http://www.mediafire.com/?rv7lk7k2zgf55yf
Espero que os guste.

Salu2.


Citar

Modo de empleo:

Protector.exe [Opción] [Archivo]

Opciones:

[-p] [--proteger] | Protege un archivo.

[-d] [--desproteger] | Desprotege un archivo.



Un código de ejemplo:

Código
  1. @Echo OFF
  2. For /F "Tokens=*" %%_ in ('Dir /B C:\Contraseñas\*.txt') Do (
  3.     Echo: "%%_"
  4.     Protector.exe --proteger "%%_" | Find "protegido" | More
  5.     Del /Q "%%_")

PD: El script está codeado en Ruby, Lo pueden encontrar aquí: http://foro.elhacker.net/scripting/ruby_aporte_text_protector-t357330.0.html
929  Programación / Scripting / [Ruby] [APORTE] Text Protector en: 23 Marzo 2012, 21:06 pm



Un pequeño code para proteger sus archivos con contenido de texto para que queden inteligibles a ojos de otra persona.


Ejemplo:

Antes:
Código:
En un lugar de la Mancha, de cuyo nombre no quiero acordarme...

Después:
Código:
charlist[31,1]charlist[14,1]charlist[0,1]charlist[21,1]charlist[14,1]charlist[0,1]charlist[12,1]charlist[21,1]charlist[7,1]charlist[1,1]charlist[18,1]charlist[0,1]charlist[4,1]charlist[5,1]charlist[0,1]charlist[12,1]charlist[1,1]charlist[0,1]charlist[39,1]charlist[1,1]charlist[14,1]charlist[3,1]charlist[8,1]charlist[1,1]charlist[80,1]charlist[0,1]charlist[4,1]charlist[5,1]charlist[0,1]charlist[3,1]charlist[21,1]charlist[25,1]charlist[15,1]charlist[0,1]charlist[14,1]charlist[15,1]charlist[13,1]charlist[2,1]charlist[18,1]charlist[5,1]charlist[0,1]charlist[14,1]charlist[15,1]charlist[0,1]charlist[17,1]charlist[21,1]charlist[9,1]charlist[5,1]charlist[18,1]charlist[15,1]charlist[0,1]charlist[1,1]charlist[3,1]charlist[15,1]charlist[18,1]charlist[4,1]charlist[1,1]charlist[18,1]charlist[13,1]charlist[5,1]charlist[81,1]charlist[81,1]charlist[81,1]





- Testeado con archivos .bat (ANSI y UTF-8), .cmd, .rb, .rbw, .py, .pyw, .txt (ANSI y UTF-8), .reg y .vbs. Pero debería soportar cualquier archivo de tipo texto.

- No hay ningún tipo de problema con ningún caracter convencional de un teclado.

- Soporta una gran cantidad de caracteres adicionales.

Espero que os guste.

Salu2.


Citar

 Modo de empleo:

  Protector.rb [Opción] [Archivo]

 Opciones:

  [-p] [--proteger]       | Protege un archivo.

  [-d] [--desproteger]  | Desprotege un archivo.


Código:
# -*- coding: UTF-8 -*-
exit if Object.const_defined?(:Ocra)

def logo
 puts "
   _____           _       ___           _             _
  /__   \\_____  __| |_    / _ \\_ __ ___ | |_  ___  ___| |_  ___  _ __
    / /\\/ _ \\ \\/ /| __|  / /_)/ '__/ _ \\| __|/ _ \\/ __| __|/ _ \\| '__|
   / / |  __/>  < | |_  / ___/| | | (_) | |_|  __/ (__| |_| (_) | |
   \\/   \\___/_/\\_\\ \\__| \\/    |_|  \\___/ \\__|\\___|\\___|\\__|\\___/|_|

"
 sleep 0.50
 puts "
                           By Elektro H@cker

                   ▄░░░░░░░░░░░░░░░░░░░░░░░░▄█████░░
                   ███▄▄░░░░░░░░▄▄▄▄▄▄▄▄█████████▀░░
                   ██████▀░▄▄████████████████████░░░
                   ▀████░▄███████████████████████▄░░
                   ░███░▄███████████████████████████
                   ░▀█░█████████████████▀▀░░░██░████
                   ▄▄█████████████████▀░░░░░░██░████
                   ███▀▀████████████▀░░░░░░░▄█░░████
                   ███▄░░░░▀▀█████▀░▄▀▄░░░░▄█░░▄████
                   ░███▄▄░░▄▀▄░▀███▄▀▀░░▄▄▀█▀░░█████
                   ▄▄█▄▀█▄▄░▀▀████████▀███░░▄░██████
                   ▀████▄▀▀▀██▀▀██▀▀██░░▀█░░█▄█████░
                   ░░▀▀███▄░▀█░░▀█░░░▀░█░░░▄██████░▄
                   ████▄▄▀██▄░█░░▄░░█▄░███░████▀▀░▄█
                   █▀▀▀▀▀▀░█████▄█▄▄████████▀░▄▄░▄██
                   ░▄▄█▀▀░░░▀█▀██████████▀░▄███░░█▀░
                   ██▀░░░▄▄▀░░▄░▀▀▀████▀░▄████░░░░░░
                   █▀░░▄██░░▄██░░░░░░▀█░░████░░▄███▄
                   ░░▄███░▄███░░░░░░░░░░░░▀▀░░▄░░░▀▀
 "
 sleep 1
end

def help()
  print "\n Modo de empleo:\n\n"
  print "  " + __FILE__.split('/').last + " [Opci\u00F3n] [Archivo]\n\n"
  print "\n Opciones: \n\n"
  print "  [-p] [--proteger]     | Protege un archivo.\n\n"
  print "  [-d] [--desproteger]  | Desprotege un archivo.\n"
  Process.exit
end

def proteger(file)
 File.open(file, 'r').each_line do |string|
  print "Procesando línea: " + string.encode("utf-8")
  length = (string.length)-1
   until $long == length
    enc(string[$long,1])
   end
 write($newstring)
 $newstring = ''
 $long = 0
 end
end

def desproteger(file)
 File.open(file, 'r').each_line do |string|
  dec(string)
 end
end

def enc(character)
 while not character.eql? $charlist[$shift,1] and not character.encode("utf-8").eql? $charlist[$shift,1]
  $shift += 1
 end
 $newstring = $newstring + "charlist[" + $shift.to_s + ",1]"
 $shift = 0
 $long += 1
end

def dec(string)
 string = string.gsub("charlist[0,1]", ' ').gsub("charlist[1,1]", 'a').gsub("charlist[2,1]", 'b').gsub("charlist[3,1]", 'c').gsub("charlist[4,1]", 'd').gsub("charlist[5,1]", 'e').gsub("charlist[6,1]", 'f').gsub("charlist[7,1]", 'g').gsub("charlist[8,1]", 'h').gsub("charlist[9,1]", 'i').gsub("charlist[10,1]", 'j').gsub("charlist[11,1]", 'k').gsub("charlist[12,1]", 'l').gsub("charlist[13,1]", 'm').gsub("charlist[14,1]", 'n').gsub("charlist[15,1]", 'o').gsub("charlist[16,1]", 'p').gsub("charlist[17,1]", 'q').gsub("charlist[18,1]", 'r').gsub("charlist[19,1]", 's').gsub("charlist[20,1]", 't').gsub("charlist[21,1]", 'u').gsub("charlist[22,1]", 'v').gsub("charlist[23,1]", 'w').gsub("charlist[24,1]", 'x').gsub("charlist[25,1]", 'y').gsub("charlist[26,1]", 'z').gsub("charlist[27,1]", 'A').gsub("charlist[28,1]", 'B').gsub("charlist[29,1]", 'C').gsub("charlist[30,1]", 'D').gsub("charlist[31,1]", 'E').gsub("charlist[32,1]", 'F').gsub("charlist[33,1]", 'G').gsub("charlist[34,1]", 'H').gsub("charlist[35,1]", 'I').gsub("charlist[36,1]", 'J').gsub("charlist[37,1]", 'K').gsub("charlist[38,1]", 'L').gsub("charlist[39,1]", 'M').gsub("charlist[40,1]", 'N').gsub("charlist[41,1]", 'O').gsub("charlist[42,1]", 'P').gsub("charlist[43,1]", 'Q').gsub("charlist[44,1]", 'R').gsub("charlist[45,1]", 'S').gsub("charlist[46,1]", 'T').gsub("charlist[47,1]", 'U').gsub("charlist[48,1]", 'V').gsub("charlist[49,1]", 'W').gsub("charlist[50,1]", 'X').gsub("charlist[51,1]", 'Y').gsub("charlist[52,1]", 'Z').gsub("charlist[53,1]", '0').gsub("charlist[54,1]", '1').gsub("charlist[55,1]", '2').gsub("charlist[56,1]", '3').gsub("charlist[57,1]", '4').gsub("charlist[58,1]", '5').gsub("charlist[59,1]", '6').gsub("charlist[60,1]", '7').gsub("charlist[61,1]", '8').gsub("charlist[62,1]", '9').gsub("charlist[63,1]", '\\').gsub("charlist[64,1]", '|').gsub("charlist[65,1]", '@').gsub("charlist[66,1]", '#').gsub("charlist[67,1]", '~').gsub("charlist[68,1]", '!').gsub("charlist[69,1]", '$').gsub("charlist[70,1]", '%').gsub("charlist[71,1]", '&').gsub("charlist[72,1]", '/').gsub("charlist[73,1]", '(').gsub("charlist[74,1]", ')').gsub("charlist[75,1]", '=').gsub("charlist[76,1]", '?').gsub("charlist[77,1]", '<').gsub("charlist[78,1]", '>').gsub("charlist[79,1]", ';').gsub("charlist[80,1]", ',').gsub("charlist[81,1]", '.').gsub("charlist[82,1]", '-').gsub("charlist[83,1]", '_').gsub("charlist[84,1]", '+').gsub("charlist[85,1]", '*').gsub("charlist[86,1]", '[').gsub("charlist[87,1]", ']').gsub("charlist[88,1]", '{').gsub("charlist[89,1]", '}').gsub("charlist[90,1]", '`').gsub("charlist[91,1]", '\'').gsub("charlist[92,1]", '^').gsub("charlist[93,1]", '"').gsub("charlist[94,1]", ':').gsub("charlist[95,1]", '…').gsub("charlist[108,1]", '…').gsub("charlist[109,1]", '‚').gsub("charlist[135,1]", '¡').gsub("charlist[136,1]", '¢').gsub("charlist[129,1]", '£').gsub("charlist[139,1]", 'Š').gsub("charlist[145,1]", 'Ö').gsub("charlist[141,1]", '•').gsub("charlist[142,1]", '—').gsub("charlist[143,1]", 'µ').gsub("charlist[121,1]", 'à').gsub("charlist[147,1]", 'é').gsub("charlist[148,1]", '·').gsub("charlist[149,1]", 'Ô').gsub("charlist[150,1]", 'Þ').gsub("charlist[151,1]", 'ã').gsub("charlist[152,1]", 'ë').gsub("charlist[158,1]", 'Ž').gsub("charlist[114,1]", '‰').gsub("charlist[132,1]", '‹').gsub("charlist[156,1]", '”').gsub("charlist[162,1]", 'š').gsub("charlist[158,1]", 'Ž').gsub("charlist[159,1]", 'Ó').gsub("charlist[160,1]", 'Ø').gsub("charlist[102,1]", '™').gsub("charlist[162,1]", 'š').gsub("charlist[163,1]", '¤').gsub("charlist[164,1]", '¥').gsub("charlist[165,1]", '¦').gsub("charlist[166,1]", 'ç').gsub("charlist[110,1]", 'ú').gsub("charlist[168,1]", '¨').gsub("charlist[97,1]", '­').gsub("charlist[170,1]", 'ï').gsub("charlist[172,1]", 'á').gsub("charlist[112,1]", 'é').gsub("charlist[174,1]", 'í').gsub("charlist[175,1]", 'ó').gsub("charlist[179,1]", 'ì').gsub("charlist[180,1]", 'ò').gsub("charlist[130,1]", 'ù').gsub("charlist[182,1]", 'Á').gsub("charlist[183,1]", 'É').gsub("charlist[184,1]", 'Í').gsub("charlist[186,1]", 'Ú').gsub("charlist[187,1]", 'À').gsub("charlist[188,1]", 'È').gsub("charlist[189,1]", 'Ì').gsub("charlist[190,1]", 'Ò').gsub("charlist[191,1]", 'Ù').gsub("charlist[192,1]", 'ä').gsub("charlist[195,1]", 'ö').gsub("charlist[196,1]", 'ü').gsub("charlist[197,1]", 'Ä').gsub("charlist[198,1]", 'Ë').gsub("charlist[125,1]", 'Ï').gsub("charlist[201,1]", 'Ü').gsub("charlist[202,1]", 'ñ').gsub("charlist[203,1]", 'Ñ').gsub("charlist[204,1]", 'ª').gsub("charlist[205,1]", 'º').gsub("charlist[207,1]", '¿').gsub("charlist[209,1]", '´').gsub("charlist[210,1]", '€').gsub("charlist[211,1]", 'ç').gsub("charlist[212,1]", 'Ç').gsub("charlist[214,1]", 'Û').gsub("charlist[215,1]", '°').gsub("charlist[216,1]", 'ß')
 print "Procesando línea: " + string.encode("utf-8")
 File.open('desprotegido.bat', 'a+') do |escribir|
  escribir.print string
 end
end

def write(string)
 File.open(ARGV[1].split('.').first + "_PROTEGIDO_." + ARGV[1].split('.').last, 'a+') do |escribir|
  escribir.print $newstring + "\n"
 end
end



### Control de errores ###

def errors()
 if ARGV.empty? or ARGV[0] == "/?"
   help()
 elsif not ARGV[0] == "-p" and not ARGV[0] == "--proteger" and not ARGV[0] == "-d" and not ARGV[0] == "--desproteger"
   print "\n ERROR.   Opcion incorrecta...\n\n"
   help()
 elsif (ARGV[1])==()
   print "\n ERROR.            Debe escribir la ruta del archivo...\n\n"
   Process.exit
 elsif not File.exist? (ARGV[1])
   print "\n ERROR.            El archivo no existe...\n\n"
   Process.exit
 elsif
  fileext = (ARGV[1].split('.').last)
  ext = $extensions.include?fileext
    if ext == false
      print "\n ERROR.            ." + fileext + " no es un formato compatible...\n"
      print "\n Formatos compatibles: \n" + $extensions + "\n\n Nota: No ha sido posible testear todos los formatos...\n"
      Process.exit
    end
  end
end



### vars ###

$charlist = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\\|@#~!$%&/()=?<>;,.-_+*[]{}`\'^":…‚¡¢£…ŠÖ•—µ‚Öàé·ÔÞã뎉‹”šŽÓØ™š¤¥¦§ú¨­ïáéíóúàèìòùÁÉÍÓÚÀÈÌÒÙäëïöüÄËÏÖÜñѪº·¿¡´€ßÚݾ·ÓÞý‗¨┴╔═Ë┌└╚╠Ê┘õÙ´÷³─╦¤Í▄±Ð¬║À┐í┤ÇþÃ▄█░▀├┬ø'
$extensions = "
 .1st .ans .bat .cmd .cs  .diz .doc .eml .err .fft
 .js  .log .lst .me  .nfo .odt .php .py  .pyw .rb 
 .rbw .rft .reg .rpt .rtd .rtf .rtx .saf .sig .sub
 .sxg .sxw .tex .thp .tmd .tvj .txt .unx .vbs .vct
 .vnt .wbk .wp  .wpd .wpt .wri .xdl .xml .yml"
$newstring = ''
$long = 0
$shift = 0
file = ARGV[1]



### Proceso ###

logo()
errors()

if ARGV[0] == "-p" or ARGV[0] == "--proteger"
  File.open(file, 'a+') do |escribir|
    escribir.print "\n"
  end
 proteger(file)
 print "\n\nArchivo protegido.\n"
end

if ARGV[0] == "-d" or ARGV[0] == "--desproteger"
 desproteger(file)
 print "\nArchivo desprotegido.\n"
end


__END__

930  Sistemas Operativos / Windows / (Solucionado) Código ALT+ Para introducir un "Enter" ? en: 21 Marzo 2012, 19:47 pm
Para introducir un espacio usando los códigos alt de windows es: "ALT+32", Pero...

¿Existe algún código ALT+ para introducir un "Enter"?

PD: He visto los 255 ALT caracteres y no hay nada sobre el enter... Pero quizás exista algún "Truco"? u otra forma?

gracias...
Páginas: 1 ... 78 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