evolve or die

hextodec.java

hextodec.java
Posted Feb 27, 2003
Authored by soGNo

Hextodec.java is a simple hex ip to dec ip converter which can be useful for many things, among them is finding the ips of users on java chats similar to the one on www.ircnet.com.

tags | java
MD5 | 79fbfc692c66a035d6240bd2e2c4e524

hextodec.java

Change Mirror Download
/*
* hextodec.java
*
* Created 23 Feb 2003 17:00
*/

/*
* Copyright (C) s0gno
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

/**
* Title: HEX IP to DEC IP Converter
* Description: This simple proggy helps you figure out the
* DEC correspondant of an IP represented in
* HEX format. This is useful when trying to
* figure out the ip of a user connected to a
* Java IRC Chat such as the one on www.ircnet.com.
* Code is OpenSource under the terms of the GNU
* General Public Licence. I will not be held
* responsable for any appropriate use you make
* with this code (ie: you get an ip and then start
* a DDoS attack towards it etc.)
* Copyright: Copyright (c) 2003 s0gno
* @author s0gno
* @version 0.1
*/
public class hextodec{

public final static void usage(){
System.out.println("HEX IP to DEC IP (hextodec.java) by s0gno");
System.out.println("Usage:");
System.out.println("java hextodec <hexip>");
System.out.println("Ex:");
System.out.println("java hextodec aabbccdd\n");
System.out.println("|--------------------------GNU----------------------------|");
System.out.println("|HexToDec version 0.1, Copyright (C) 2003 s0gno |");
System.out.println("|HexToDec comes with ABSOLUTELY NO WARRANTY |");
System.out.println("|This is free software, and you are welcome to |");
System.out.println("|redistribute it under certain conditions; |");
System.out.println("|for details go to http://www.gnu.org/copyleft/gpl.html |");
System.out.println("|---------------------------------------------------------|");
}//usage

public static void main(String args[]){

String ip = "";

try{
if(args[0].length() == 8){

for(int i = 0;i < args[0].length();i+=2){
ip += Integer.parseInt(args[0].substring(i, i+2),16);
if(i!=6)
ip += ".";

}//for
System.out.println("IP : " + ip);
}//if
else
usage();

}catch(IndexOutOfBoundsException e){
usage();
}
catch(NumberFormatException e){
System.out.println("String HEX errata");
}
}//main
}//class

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close