- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 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);
}
};