Statistics

Members: 1927
News: 293
Web Links: 1
Visitors: 3961993

Who's Online

We have 1 guest online
Damn Vulnerable LinuxDamn Vulnerable Linux (DVL) is a Linux-based (modified Damn Small Linux) tool for IT-Security & IT-Anti- Security and Attack & Defense. [CLICK HERE FOR MORE INFOS! ]

Featured Conference Video

T16-Recon2006-Joe_Stewart-OllyBonE.gif OllyBone - Semi-Automatic Unpacking on IA-32. View the conference video here!
TOHEX
User Rating: / 0
PoorBest 
Written by Ronald   


;Summary:       Convert hexadecimal digits to ASCII
;Compatibility: PowerPC platform
;Notes:         Reads 3 parameters in R1-R3
;               R1 = Number to convert to ASCII representation
;               R2 = Number of LSD's of R1 to convert
;               R3 = Address to store ASCII representation of number to
;               R31 = Temp register that holds 4 bits
;               Note that R1 is ruined during execution
.global TOHEX, TOHEX_LOOP, LT_TEN, STEP_OVER, TOHEX_EXIT
TOHEX:
        cmpwi R2, 0
        be TOHEX_EXIT
TOHEX_LOOP:
        andi. R31, R1, 15
        cmpwi R31, 10
        blt LT_TEN
        addi R31, R31, 'A'-10
        b STEP_OVER
LT_TEN:
        ori R31, R31, '0'
STEP_OVER:
        srwi R1, R1, 4
        subi R2, R2, 1
        stbx R31, R2, R3
        cmpwi R2, 0
        bne TOHEX_LOOP
TOHEX_EXIT:
        blr