Access Status VERY Illegally
This commit is contained in:
parent
bbad0349e4
commit
50e86d6ed5
@ -33,10 +33,21 @@ void Aufg9Main() {
|
||||
char *fuckery = (char *)test;
|
||||
printf("Fuckery: %X\n", fuckery);
|
||||
|
||||
char *bit20 = &dest[20];
|
||||
// Name
|
||||
char *byte20 = &dest[20];
|
||||
std::cout << "Name: ";
|
||||
for (int i = 0; i < 16; i++) {
|
||||
std::cout << bit20[i];
|
||||
std::cout << byte20[i];
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
char* byte36 = &dest[36];
|
||||
std::cout << "Status: " << (((int)(*((bool *)byte36)))%8)/4 << std::endl; // geh zu Byte 36, lies genau 1 byte (da sizeOf(bool) = 1), interpretier es als int, berechner mod 8 -> wegwerfen der linken Bits, /4 -> wegwerfen der rechten beiden Bits -> Tada, nur das 3. Bit von Rechts bleibt übrig
|
||||
|
||||
// Klasse
|
||||
bool *byte40 = (bool*) &dest[40];
|
||||
std::cout << "Klasse: " << byte40[0] << std::endl;
|
||||
// 2 -> Necromancer
|
||||
|
||||
|
||||
} catch (const std::exception &e) {
|
||||
|
Loading…
Reference in New Issue
Block a user