Results 1 to 17 of 17

Thread: ASCII

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User cecko19's Avatar
    Join Date: Jan:2011
    Location: Sofia
    Posts: 82

    ASCII

    !
    2 , : http://www.jobs.bg/f1116302 (php ). , : , ; , ( 31-) Tab, .

    txt, word , ...

    , !

  2. #2
    ! vbTheKing's Avatar
    Join Date: Sep:2003
    Location:
    Posts: 4,138
    .
    ''? * *
    - !
    ...

  3. #3
    Registered User cecko19's Avatar
    Join Date: Jan:2011
    Location: Sofia
    Posts: 82
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    
    namespace HexCodeCracker
    {
        class Cracker
        {
            static double ConvertToHex(char[] hexNum)
            {
                double converted = 0;
                const int a_INDEX = 87;
                int j = 0;
    
                if (hexNum[1] == 0)
                {
                    converted = (int)hexNum[0] - a_INDEX;
                }
    
                else
                {
                    for (int i = 1; i >= 0; i--)
                    {
                        if ((int)hexNum[i] >= a_INDEX + 10)
                        {
                            converted += ((int)hexNum[i] - a_INDEX) * Math.Pow(16, j);
                        }
    
                        else
                        {
                            converted += ((int)hexNum[i] - 48) * Math.Pow(16, j);
                        }
    
                        j++;
                    }
                }
    
                return converted;
            }
    
            static void CrackAlgorithm(string code)
            {
                char[] hexSymbol = new char[2];
                int i = 0;
                string sentence = "";
                double symbolCode = 0;
                StreamWriter output = new StreamWriter(@"E:/CECI/out.doc");
    
                foreach (var ch in code)
                {
                    if (i == 2)
                    {
                        i = 0;
                    }
    
                    if (ch != 'x')
                    {
                        hexSymbol[i] = ch;
                        i++;
                    }
    
                    if (ch == 'x')
                    {
                        symbolCode = ConvertToHex(hexSymbol);
                        sentence += (char)symbolCode;
                    }
                }
    
                output.Write(sentence);
                output.Close();
            }
    
            static void Main()
            {
                string hexCode = Console.ReadLine();
                hexCode += "x";
    
                CrackAlgorithm(hexCode);
            }
        }
    }
    , ...

  4. #4
    Registered User
    Join Date: Nov:2005
    Location:
    Posts: 3,317
    Code:
    public void Decode()
            {
                string hexCode = "x52x45x53x50x4fx4ex53x49x42x49x4cx49x54x49x45x53x3axdxax2dx9x44x65x76x65x6cx6fx70x6dx65x6ex74x20x6fx66x20x62x72x6fx77x73x65x72x20x62x61x73x65x64x20x67x61x6dx65x73x20x61x6ex64x20x61x70x70x6cx69x63x61x74x69x6fx6ex73x3bxdxax2dx9x4dx61x69x6ex74x65x6ex61x6ex63x65x20x6fx66x20x65x78x69x73x74x69x6ex67x20x67x61x6dx65x73x2exdxaxdxax52x45x51x55x49x52x45x4dx45x4ex54x53xdxax2dx9x32x2b";
    
                hexCode += "x20x50x48x50x20x61x6ex64x20x4dx79x53x51x4cx20x65x78x70x65x72x69x65x6ex63x65";
                hexCode += "x3bxdxax2dx9x45x78x70x65x72x69x65x6ex63x65x20x69x6ex20x4fx4fx50x20x61x6ex64";
                hexCode += "x20x50x48x50x35x3bxdxax2dx9x45x78x70x65x72x74x69x73x65x20x69x6ex20x53x51";
                hexCode += "x4cx2fx4dx79x53x51x4cx3bxdxax2dx9x41x62x69x6cx69x74x79x20x74x6fx20x64x65x76";
                hexCode += "x65x6cx6fx70x20x61x6ex64x20x6dx61x69x6ex74x61x69x6ex20x63x6fx6dx70x6cx65x78";
                hexCode += "x20x61x6ex64x20x65x66x66x69x63x69x65x6ex74x20x72x65x6cx61x74x69x6fx6ex61x6c";
                hexCode += "x20x64x61x74x61x62x61x73x65x73x3bxdxax2dx9x53x6bx69x6cx6cx73x20x69x6ex20x58";
                hexCode += "x4dx4cx2cx20x48x54x4dx4cx2fx58x48x54x4dx4cx2cx20x43x53x53x3bxdxax2dx9x47x6f";
                hexCode += "x6fx64x20x6bx6ex6fx77x6cx65x64x67x65x20x6fx66x20x4ax61x76x61x53x63x72x69x70";
                hexCode += "x74x2cx20x4ax53x4fx4ex2cx20x44x4fx4dx20x61x6ex64x20x41x4ax41x58x3bxdxax2d";
                hexCode += "x9x54x72x61x63x6bx20x72x65x63x6fx72x64x20x69x6ex20x4ax61x76x61x53x63x72x69";
                hexCode += "x70x74x20x66x72x61x6dx65x77x6fx72x6bx73x20x61x6ex64x20x6cx69x62x72x61x72x69";
                hexCode += "x65x73x20x28x70x72x6fx74x6fx74x79x70x65x20x61x6ex64x20x6ax51x75x65x72x79x29";
                hexCode += "x2exdxa";
    
                string[] arr = hexCode.Split("x".ToCharArray());
                byte[] b = new byte[arr.Length];
                for (int i = 0; i < arr.Length; i++)
                {
                    if (!string.IsNullOrEmpty(arr[i]))
                    {
                        int inVal = System.Int32.Parse(arr[i], System.Globalization.NumberStyles.AllowHexSpecifier);
                        b[i] = (byte)inVal;
                    }
    
                }
                UTF8Encoding encoding = new UTF8Encoding();
                string s = encoding.GetString(b);
                StreamWriter output = new StreamWriter(@"c:\\out.txt");
                output.Write(s);
                output.Close();
            }
    . .

  5. #5
    Registered User cecko19's Avatar
    Join Date: Jan:2011
    Location: Sofia
    Posts: 82
    . ! , ... ...

  6. #6
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    - ! . - - , ?

  7. #7
    ! vbTheKing's Avatar
    Join Date: Sep:2003
    Location:
    Posts: 4,138
    Quote Originally Posted by bsb View Post
    - ! . - - , ?
    , , ! - . - , , , 10 .
    Quote Originally Posted by bsb View Post
    Drunky 5 . - . . cecko19 , , , " 2 ...".
    2-3-5-10... - . , - , . , - .

    PHP ( ) 5-6 , 2 . replace- echo .
    PHP Code:
    <?php
    //Run me
    ob_start();
    echo 
    "x52x45x53x50x4fx4ex53x49x42x49x4cx49x54x49x45x53x3axdxax2dx9x44x65x76x65x6c";
    echo 
    "x6fx70x6dx65x6ex74x20x6fx66x20x62x72x6fx77x73x65x72x20x62x61x73x65x64x20x67";
    echo 
    "x61x6dx65x73x20x61x6ex64x20x61x70x70x6cx69x63x61x74x69x6fx6ex73x3bxdxax2dx9";
    echo 
    "x4dx61x69x6ex74x65x6ex61x6ex63x65x20x6fx66x20x65x78x69x73x74x69x6ex67x20x67";
    echo 
    "x61x6dx65x73x2exdxaxdxax52x45x51x55x49x52x45x4dx45x4ex54x53xdxax2dx9x32x2b";
    echo 
    "x20x50x48x50x20x61x6ex64x20x4dx79x53x51x4cx20x65x78x70x65x72x69x65x6ex63x65";
    echo 
    "x3bxdxax2dx9x45x78x70x65x72x69x65x6ex63x65x20x69x6ex20x4fx4fx50x20x61x6ex64";
    echo 
    "x20x50x48x50x35x3bxdxax2dx9x45x78x70x65x72x74x69x73x65x20x69x6ex20x53x51";
    echo 
    "x4cx2fx4dx79x53x51x4cx3bxdxax2dx9x41x62x69x6cx69x74x79x20x74x6fx20x64x65x76";
    echo 
    "x65x6cx6fx70x20x61x6ex64x20x6dx61x69x6ex74x61x69x6ex20x63x6fx6dx70x6cx65x78";
    echo 
    "x20x61x6ex64x20x65x66x66x69x63x69x65x6ex74x20x72x65x6cx61x74x69x6fx6ex61x6c";
    echo 
    "x20x64x61x74x61x62x61x73x65x73x3bxdxax2dx9x53x6bx69x6cx6cx73x20x69x6ex20x58";
    echo 
    "x4dx4cx2cx20x48x54x4dx4cx2fx58x48x54x4dx4cx2cx20x43x53x53x3bxdxax2dx9x47x6f";
    echo 
    "x6fx64x20x6bx6ex6fx77x6cx65x64x67x65x20x6fx66x20x4ax61x76x61x53x63x72x69x70";
    echo 
    "x74x2cx20x4ax53x4fx4ex2cx20x44x4fx4dx20x61x6ex64x20x41x4ax41x58x3bxdxax2d";
    echo 
    "x9x54x72x61x63x6bx20x72x65x63x6fx72x64x20x69x6ex20x4ax61x76x61x53x63x72x69";
    echo 
    "x70x74x20x66x72x61x6dx65x77x6fx72x6bx73x20x61x6ex64x20x6cx69x62x72x61x72x69";
    echo 
    "x65x73x20x28x70x72x6fx74x6fx74x79x70x65x20x61x6ex64x20x6ax51x75x65x72x79x29";
    echo 
    "x2exdxa";
    echo 
    PHP_EOL;

    $out ob_get_contents();
    ob_end_clean();
    $out explode('x'$out);
    foreach (
    $out as $val) {
        echo 
    chr(hexdec($val));
    }
    ?>
    ''? * *
    - !
    ...

  8. #8
    Registered User
    Join Date: Mar:2011
    Location:
    Posts: 3

    Java

    Code:
    import java.io.PrintStream;
    
    public class Decoder {
    
    		public static void main(String[] args) throws Throwable{
    		String text="52x45x53x50x4fx4ex53x49x42x49x4cx49x54x49x45x53x3axdxax2dx9x44x65x76x65x6c"+
    			"x6fx70x6dx65x6ex74x20x6fx66x20x62x72x6fx77x73x65x72x20x62x61x73x65x64x20x67"+
    			"x61x6dx65x73x20x61x6ex64x20x61x70x70x6cx69x63x61x74x69x6fx6ex73x3bxdxax2dx9"+
    			"x4dx61x69x6ex74x65x6ex61x6ex63x65x20x6fx66x20x65x78x69x73x74x69x6ex67x20x67"+
    			"x61x6dx65x73x2exdxaxdxax52x45x51x55x49x52x45x4dx45x4ex54x53xdxax2dx9x32x2b"+
    			"x20x50x48x50x20x61x6ex64x20x4dx79x53x51x4cx20x65x78x70x65x72x69x65x6ex63x65"+
    			"x3bxdxax2dx9x45x78x70x65x72x69x65x6ex63x65x20x69x6ex20x4fx4fx50x20x61x6ex64"+
    			"x20x50x48x50x35x3bxdxax2dx9x45x78x70x65x72x74x69x73x65x20x69x6ex20x53x51"+
    			"x4cx2fx4dx79x53x51x4cx3bxdxax2dx9x41x62x69x6cx69x74x79x20x74x6fx20x64x65x76"+
    			"x65x6cx6fx70x20x61x6ex64x20x6dx61x69x6ex74x61x69x6ex20x63x6fx6dx70x6cx65x78"+
    			"x20x61x6ex64x20x65x66x66x69x63x69x65x6ex74x20x72x65x6cx61x74x69x6fx6ex61x6c"+
    			"x20x64x61x74x61x62x61x73x65x73x3bxdxax2dx9x53x6bx69x6cx6cx73x20x69x6ex20x58"+
    			"x4dx4cx2cx20x48x54x4dx4cx2fx58x48x54x4dx4cx2cx20x43x53x53x3bxdxax2dx9x47x6f"+
    			"x6fx64x20x6bx6ex6fx77x6cx65x64x67x65x20x6fx66x20x4ax61x76x61x53x63x72x69x70"+
    			"x74x2cx20x4ax53x4fx4ex2cx20x44x4fx4dx20x61x6ex64x20x41x4ax41x58x3bxdxax2d"+
    			"x9x54x72x61x63x6bx20x72x65x63x6fx72x64x20x69x6ex20x4ax61x76x61x53x63x72x69"+
    			"x70x74x20x66x72x61x6dx65x77x6fx72x6bx73x20x61x6ex64x20x6cx69x62x72x61x72x69"+
    			"x65x73x20x28x70x72x6fx74x6fx74x79x70x65x20x61x6ex64x20x6ax51x75x65x72x79x29"+
    			"x2exdxa";
    		String[] word=text.split("x");
    		int[] number=new int[word.length];
    		
    		for(int i=0;i<number.length;i++){
    			number[i]=Integer.parseInt(word[i],16);
    		}
    		
    		PrintStream output=new PrintStream("filePath");
    		
    		for(int index=0;index<number.length;index++){
    			output.print((char)number[index]);
    		}
    		
    		output.close();
    	}
    
    }


    ---------- 09:50 ---------- 09:48 ----------

    RESPONSIBILITIES:
    - Development of browser based games and applications;
    - Maintenance of existing games.

    REQUIREMENTS
    - 2+ PHP and MySQL experience;
    - Experience in OOP and PHP5;
    - Expertise in SQL/MySQL;
    - Ability to develop and maintain complex and efficient relational databases;
    - Skills in XML, HTML/XHTML, CSS;
    - Good knowledge of JavaScript, JSON, DOM and AJAX;
    - Track record in JavaScript frameworks and libraries (prototype and jQuery).

  9. #9
    Registered User
    Join Date: Jul:2006
    Location:
    Posts: 1,071
    Find & Replace , x \x . , HTML echo "<pre>" .

  10. #10
    Registered User mitkohr's Avatar
    Join Date: Jul:2001
    Posts: 1,361
    Quote Originally Posted by NikiNedev View Post


    ---------- 09:50 ---------- 09:48 ----------

    RESPONSIBILITIES:
    - Development of browser based games and applications;
    - Maintenance of existing games.

    REQUIREMENTS
    - 2+ PHP and MySQL experience;
    - Experience in OOP and PHP5;
    - Expertise in SQL/MySQL;
    - Ability to develop and maintain complex and efficient relational databases;
    - Skills in XML, HTML/XHTML, CSS;
    - Good knowledge of JavaScript, JSON, DOM and AJAX;
    - Track record in JavaScript frameworks and libraries (prototype and jQuery).
    String.split() , , ..
    Code:
    public class TestHex {
    	private static String hexNum = "0123456789abcdef";
    	static int hexStrToChar(String str) {
    		if(str == null || str.length() == 0) {
    			throw new NumberFormatException("Cannot convert " + str);
    		}
    		String tmp = str.toLowerCase();
    		int ret = 0;
    		int ind;
    		for(int i = 0; i < tmp.length(); i++) {
    			ind = hexNum.indexOf(tmp.charAt(i));
    			if(ind == -1) {
    				throw new NumberFormatException("Cannot convert " + str);
    			}
    			ret = ret*16 + ind;
    		}
    		return ret;
    	}
    	
    
    	public static void main(String[] args) {
    		
    		String text="x52x45x53x50x4fx4ex53x49x42x49x4cx49x54x49x45x53x3axdxax2dx9x44x65x76x65x6c"+
    		"x6fx70x6dx65x6ex74x20x6fx66x20x62x72x6fx77x73x65x72x20x62x61x73x65x64x20x67"+
    		"x61x6dx65x73x20x61x6ex64x20x61x70x70x6cx69x63x61x74x69x6fx6ex73x3bxdxax2dx9"+
    		"x4dx61x69x6ex74x65x6ex61x6ex63x65x20x6fx66x20x65x78x69x73x74x69x6ex67x20x67"+
    		"x61x6dx65x73x2exdxaxdxax52x45x51x55x49x52x45x4dx45x4ex54x53xdxax2dx9x32x2b"+
    		"x20x50x48x50x20x61x6ex64x20x4dx79x53x51x4cx20x65x78x70x65x72x69x65x6ex63x65"+
    		"x3bxdxax2dx9x45x78x70x65x72x69x65x6ex63x65x20x69x6ex20x4fx4fx50x20x61x6ex64"+
    		"x20x50x48x50x35x3bxdxax2dx9x45x78x70x65x72x74x69x73x65x20x69x6ex20x53x51"+
    		"x4cx2fx4dx79x53x51x4cx3bxdxax2dx9x41x62x69x6cx69x74x79x20x74x6fx20x64x65x76"+
    		"x65x6cx6fx70x20x61x6ex64x20x6dx61x69x6ex74x61x69x6ex20x63x6fx6dx70x6cx65x78"+
    		"x20x61x6ex64x20x65x66x66x69x63x69x65x6ex74x20x72x65x6cx61x74x69x6fx6ex61x6c"+
    		"x20x64x61x74x61x62x61x73x65x73x3bxdxax2dx9x53x6bx69x6cx6cx73x20x69x6ex20x58"+
    		"x4dx4cx2cx20x48x54x4dx4cx2fx58x48x54x4dx4cx2cx20x43x53x53x3bxdxax2dx9x47x6f"+
    		"x6fx64x20x6bx6ex6fx77x6cx65x64x67x65x20x6fx66x20x4ax61x76x61x53x63x72x69x70"+
    		"x74x2cx20x4ax53x4fx4ex2cx20x44x4fx4dx20x61x6ex64x20x41x4ax41x58x3bxdxax2d"+
    		"x9x54x72x61x63x6bx20x72x65x63x6fx72x64x20x69x6ex20x4ax61x76x61x53x63x72x69"+
    		"x70x74x20x66x72x61x6dx65x77x6fx72x6bx73x20x61x6ex64x20x6cx69x62x72x61x72x69"+
    		"x65x73x20x28x70x72x6fx74x6fx74x79x70x65x20x61x6ex64x20x6ax51x75x65x72x79x29"+
    		"x2exdxa";
    		
    		
    		StringBuffer res = new StringBuffer();
    		String tmp = null;
    		int from = 0;
    		int to = 0;
    
    		while( from < text.length()) {
    			to = text.indexOf("x", from);
    			if(to == -1) {
    				if(from < text.length()) {
    					to = text.length();
    				} else {
    					break;
    				}
    			}
    			tmp = text.substring(from, to);
    			try {
    				res.append((char)hexStrToChar(tmp));
    			} catch(NumberFormatException ex) { //only because the exceptions should be processed somehow
    				System.out.println("Skipping [" + from + ";" + to + "]=" + tmp);
    			}finally {
    				from = to + 1;
    			}
    			
    		}
    		
    		System.out.println("result:\n"  + res);
    	}
    
    }
    Gigabyte X570 Aorus Elite, AMD Ryzen 7 5800X@PBO+200, Noctua NH-D15, 2x16GB G.Skill F4-3600C17D-32GTZR, Palit GeForce RTX 4070 Ti GameRock Classic, 2x Sandisk Extreme II 240GB (not in RAID)+WD 320GB AAKS + WD40EZRZ + Toshiba X300 6GB, Cooler Master HAF 922, CORSAIR 750W CX

  11. #11
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Code:
    $hexCode = "x52x45x53x50x4fx4ex53x49x42x49x4cx49x54x49x45x53x3axdxax2dx9x44x65x76x65x6c";
    $hexCode .= ...
    
    $hexCode = explode('x', $hexCode);
    foreach($hexCode as &$letter) {
    	echo chr(hexdec($letter));
    }


    ---------- 11:44 ---------- 11:38 ----------

    Quote Originally Posted by bsb View Post
    - ! . - - , ?
    ? " 5 3 , , ".
    (10b) || !(10b)

  12. #12
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    Quote Originally Posted by Tarvin View Post
    ...........
    ? " 5 3 , , ".
    Drunky 5 . - . . cecko19 , , , " 2 ...".
    , find and replace 10 ( ). , Drunky , - cecko19.
    " " , . , .

  13. #13
    Registered User
    Join Date: Nov:2005
    Location:
    Posts: 3,317
    Quote Originally Posted by bsb View Post
    ...
    " " , . , .
    , .

  14. #14
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by bsb View Post
    ...
    , . .

    @drunky: " " , , - - . bsb.
    (10b) || !(10b)

  15. #15
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    @drunky:
    , cecko19.

    , . , . , , - . , Tarvin.

    , , , .

  16. #16
    Registered User cecko19's Avatar
    Join Date: Jan:2011
    Location: Sofia
    Posts: 82
    . ASCII . , ...

  17. #17
    Nuclear's Avatar
    Join Date: Sep:2004
    Location: , . ()
    Posts: 3,352
    - ASCII<32 , , . printable characters.
    ASCII , , . , , non-printable characters ( tab newline).
    . HWBG !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |