Question: I d like to ask an expert. #include #include #include / / #include . . / . . / shared / kernels _ lib.c
Id like to ask an expert.
#include
#include
#include
#include sharedkernelslib.cUncomment this if kernelslib.c is required
char name;
void callme
printfcallmefunction was called!
;
void unsafe
char buffer;
int charactersread;
uintt XORbius ; Ensure XORbius is initialized to
uintt XORstring xdeadbeef;
printfFeed Me A Stray String:
;
charactersread readbuffer;
Loop to construct XORbius bytebybyte with debug output
for int i ; i ; i
XORbius XORbius ; Shift XORbius by bits for the next byte
uintt bufferbyte unsigned charbufferi ;
uintt xorbyte XORstring i & xFF;
XORbius bufferbyte xorbyte;
Debug statements to observe values at each step
printfIteration d:
i;
printfbufferdxx
i bufferbyte;
printfXORstring byte xx
xorbyte;
printfResulting XORbius xx
XORbius;
Final check
if XORbius xdeadbeef
callme;
else
printfXORbius did not match xdeadbeef, it was xx
XORbius;
int mainint argc, charargv
char binchar malloc;
strcpybin&argvstrlenargv;
if strcmpbinflag
printfERROR DETECTED: MODIFIED BINARY NAME s
bin;
exit;
unsafe;
return ;
You need to unravel the logic that this program is checking against in order to get to the callmefunctionsimplyneed to input the right values that will correctly decode the logic and pass the checks.
XOR TRUTH TABLE
A B Result
XOR Operations are REVERSIBLE, meaning that performing the same XOR operation on a number twice will end up with the original number!
Example:
bbb
bbb
in Hex notation
xFxF xFF
xFF xF xF
I tried this payload in my python file : payload bAbxbAbxbAbxbAbxbA
Iteration : bufferxXORstring byte xef Resulting XORbius xde
Iteration : bufferxXORstring byte xbe Resulting XORbius xdead
Iteration : bufferxXORstring byte xad Resulting XORbius xdeadde
Iteration : bufferxXORstring byte xde Resulting XORbius xdeaddeef XORbius did not match xdeadbeef, it was xdeaddeef
Please don't use the solution that is already here in Chegg it didn't work and don't use AII have already tried.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
