Donate to us via Paypal!
It is never to LATE to become what you never WERE.
Monday, March 01, 2021
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 116
Guests Online: 116
Members Online: 0

Registered Members: 133766
Newest Member: denim6321d
Latest Articles

View Thread

HellBound Hackers | Computer General | Programming

Author

Hex to Binary in C

Scar0ptics
Member



Posts: 229
Location: ∆ P®0X¥ W0R|D ∆
Joined: 19.11.13
Rank:
Mad User
Posted on 16-11-16 14:16
You must show your work in binary when you make these calculations. You cannot just run this through a compiler. I mean you can (lol), but it defeats the purpose of the exercise, as you need to understand what's going on in the background. I will post my solution later.

List the output:

int main(int argc, char ** argv){

int x = 0x23;
int y = 0x15;
x = x << 16;
printf(“%x\n”, x);
x = (x | y) << 8;
printf (“%x\n”,x);
printf (“%x\n”, y);

x = 0x12345678;
y = 0x55;
x = ((x<<8) & (y<<8))>>8;
printf(“%x\n”, x);

x = 0x23;
y = 0x15;

x = x ^ y;
printf(“%d\n”, x);
x = y ^ x;
printf (“%d\n”,x);
y = y ^ x;
printf (“%d\n”, y);

}

Edited by Scar0ptics on 16-11-16 15:03
overlay-network.ddns.net