Кресты / Говнокод #6495 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
class r{
	r(const r&);
	r& operator=(const r&);
public:
	r(){}
	template<class t>
	r& operator,(t *v){
		return this->operator<<(*v);
	}
	template<class t>
	r& operator<<(t &o){
		crash_if_fail(dynamic_cast<const void*>(&o));
		int l = 0;
		int n = 0, n_ = sizeof(o) / sizeof(void*);
		while (n < n_){
			void **a = *((void***)&o + n++);
			if (IsBadReadPtr(a, sizeof(void*)) || is_stack(a)){
				continue;
			}
			int c = 0;
			void *d = a[c];
			while (is_code_segment__(d)){
				print_info(&l, o, n, d, c, a);
				d = a[++c];
			}
		}
		return *this;
	}
	template<class t>
	void print_info(int *l, const t &o, int n, void *d, int c, void **a){
		if (!*l){
			puts("///////////////////////////////////////////////////");
			printf("object address %p\n", &o);
			*l = 1;
		}
		if (!c){
			puts("-=-=-=-=-=-=-=-=-=-");
			printf("%15.1s%p:__vfptr %p\n", "+", ((char*)((void***)&o + n - 1)) - (char*)&o, a);
		}
		printf("%32.p\n", d);
	}
};

Запостил: 34930fb4455e40f4 34930fb4455e40f4, (Updated )

Комментарии (35) RSS

Добавить комментарий

Где здесь C++, guest?!

    А не использовать ли нам bbcode?


    8