Sign in to follow this  
Followers 0
datkewlguy

Shifting Off Non Displaying Characcters

4 posts in this topic

I'll try to be as clear as possible:

This is for a modification to an elaborate encryption program that in a certain part of the script, returns invidividual characters replaced by shifting the hex code and returning it to a string.

The problem is that the program that I'm primarily using this for doesn't display the following characters (listed in decimal):

0-31

or

128-161

The other characters are supported.

So the decimal returned can't be 0-31 or 128-161...what rule can i apply here, to make numbers that fall under this category be displayable?

*The same characters/symbols cant be shared...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I found a way, but now i have a logic error...im going crazy, can someone please respond with SOMETHING?

;fix decryption
Func normalize($character)  
    Select      
    Case (asc($character)-31) <= 31     
        msgbox(0, "3", "debug")
        Return(Chr(asc($character)-31))
                
    Case (asc($character)-128) >= 128 and (asc($character)-161) <= 161              
        msgbox(0, "4", "debug")
        Return(Chr(33-$character))
        
;meta tags
    Case $character = "²"
        Return ">"
        
    Case $character = "³"
        Return "<"
;meta tags
            
            EndSelect
    
EndFunc ;==>normalize

;fix encryption
Func unnormalize($character)
    
Select
    
Case asc($character) <= 31
    msgbox(0, "1", "debug")
            Return(Chr(31+asc($character)))
            
    Case asc($character) > 128 and asc($character) < 161
    msgbox(0, "2", "debug")
            Return(Chr(33+asc($character)))
        
;meta tags
    Case $character = ">"
        Return "²"
        
    Case $character = "<"
        Return "³"
;meta tags
        
    EndSelect
    
    Return $character
EndFunc ;==>unnormalize

edit: this works with the rest of my script, but doesnt decrypt correctly (for all i know, it doesnt encrypt correctly either...)

Edited by datkewlguy

Share this post


Link to post
Share on other sites

If your using strings with the web...take a look at StringRegExp / StringRegExpReplace in the help file... will probably make your life alot easier.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

hmm.. ill take a look

Edited by datkewlguy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0