Best explanation of two's compliment i've heard. Going to use your method from now on lol
@60NoyCoolUser6 жыл бұрын
Great video. I solved it and needed an explanation. Your video was exactly what I needed. Thanks!
@_JohnHammond6 жыл бұрын
Happy to hear it, thanks for watching! :D
@anuragdeep33676 жыл бұрын
There is an even simpler method to get two's complement. Starting from least significant bit keep the value of the bits unchanged until you reach the first '1' and after that flip all the bits including the sign bit. Eg:- 0110->1010
@_JohnHammond6 жыл бұрын
NICE! This works great, thanks!
@anuragdeep33676 жыл бұрын
Thank you sir
@matthewreed20006 жыл бұрын
I'm no expert, but I believe that the reason 32-bit ints are maxed at 2^31 is because there are 2^31 positive ints and 2^31 negative ints. 2^31 + 2^31 = 2(2^31) = 2^32
@_JohnHammond6 жыл бұрын
More expert than me :P Good to know, thank you!!
@wecksell4 жыл бұрын
Exactly, one bit kind of becomes your sign indicator.
@wecksell4 жыл бұрын
You want to try the operator xor, ^ in most languages, python: 0b0110^0b0101 A little easier than your replace method. Thanks for your videos, I have learnt alot from them!
@altf4thc6 жыл бұрын
why cant we push win on the stack and ret like we do in shells?
@zanidd6 жыл бұрын
Cool use of something rather boring I had to learn for school. Nice to know that the stuff I'm learning at school can be used in ctfs xD
@_JohnHammond6 жыл бұрын
VERY RARELY, but sometimes there are crossovers xP