{"id":305508,"date":"2020-06-17T21:00:31","date_gmt":"2020-06-17T21:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305508"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305508","title":{"rendered":"PDB \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507124\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wj\/xh\/nj\/wjxhnjjdjtlfvr8ruydjczb5trg.jpeg\"><\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u0443\u044e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0431\u0435\u0437 SDK, \u043d\u043e \u043f\u043e \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u043e\u043c\u0443 \u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044e \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0440\u044f\u0434\u043e\u043c \u0437\u0430\u0432\u0430\u043b\u044f\u043b\u0441\u044f PDB \u0444\u0430\u0439\u043b. <\/p>\n<p>  (\u0411\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u0434\u0435\u0442\u044f\u043c \u043d\u0435 \u0447\u0438\u0442\u0430\u0442\u044c!)<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443, \u0432\u044b\u0445\u043e\u0434 \u0435\u0441\u0442\u044c (\u0412\u0430\u0448 \u041a\u041e). \u0422\u043e \u0447\u0442\u043e \u043a\u043e\u043c\u0438\u0442\u0435\u0442 \u043d\u0435 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0441\u0438\u043b\u0438\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u043c\u0438 \u043b\u0435\u0442 (\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f \u043d\u0435 \u043d\u0443\u0436\u043d\u0430), \u0443\u0436\u0430\u0441\u043d\u044b\u0439 M$ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\/\u0440\u0430\u0437\u0434\u043e\u0431\u044b\u043b 100 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e DIA SDK. \u0412 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c DIA2Dump.exe \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0440\u0430\u0434\u0443\u0435\u0442 \u0433\u043b\u0430\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u0430. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u043f\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c\u2026<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043a\u043e\u0448\u0435\u0447\u043a\u0438.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041e\u041e\u041f \u0431\u0430\u044f\u043d:<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#define NOINLINE __declspec(noinline)  class IDrawable { public:    virtual void draw() = 0; };  class Shape : public IDrawable { public:    NOINLINE Shape(int ix, int iy);    NOINLINE virtual ~Shape();    virtual void draw();    inline void setXY(int ix, int iy) { x = ix, y = iy; }    NOINLINE void someWork();    int x;    int y; };  class Circle : public Shape { public:    NOINLINE Circle(int ix, int iy, int ir);    virtual ~Circle();    void draw();    int r; };  Shape::Shape(int ix, int iy) { x = ix; y = iy; } Shape::~Shape() { } void Shape::someWork() { printf(&quot;someWork\\n&quot;); } void Shape::draw() { }  Circle::Circle(int ix, int iy, int ir): Shape(ix, iy), r(ir) { } Circle::~Circle() { } void Circle::draw() { printf(&quot;Circle\\n&quot;); }  int main() {     auto c = new Circle(0, 0, 10);     c-&gt;draw();     c-&gt;someWork();     delete c;      getchar();     return 0; } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c -&gt; victim.exe \/ victim.pdb<\/p>\n<p>  \u0410\u0432\u0442\u043e\u0440 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u0440\u0438\u0432\u044b\u043c\u0438 \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b DIA2Dump (pdb-ripper \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435, Achtung \u0433*\u0432\u043d*\u043a\u043e\u0434!!!) \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u0432\u044b\u0434\u0430\u0435\u0442 \u043a\u043e\u0435-\u0447\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u043e\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"plaintext\">DIA2Dump.exe -rip -printCppProxy -m -g -d -rd -names &quot;Shape;Rectangle;Circle&quot; victim.pdb &gt; victim.h <\/code><\/pre>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">IDrawable<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/UDT: class IDrawable @len=8 @vfcount=1 \t\/\/_VTable \t \t\/\/@intro @pure @virtual vtpo=0 vfid=0 @loc=optimized @len=0 @rva=0 \t\/\/_Func: public void draw(); \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public void IDrawable(IDrawable * _arg0);  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public void IDrawable(const IDrawable &amp; _arg0);  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public void IDrawable();  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public IDrawable &amp; operator=(IDrawable * _arg0);  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public IDrawable &amp; operator=(const IDrawable &amp; _arg0);  \/\/UDT;  class IDrawable { public: \tvoid* _vtable; \t \tinline void draw() {  \t\ttypedef void (IDrawable::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(get_vfp(this, 0));  \t\treturn (this-&gt;*_f)();  \t} \t \tinline IDrawable * ctor() { return this; } \tinline void dtor() {} }; <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">Shape<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/UDT: class Shape @len=16 @vfcount=2 \t\/\/_Base: class IDrawable @off=0 @len=8 \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public void Shape(const Shape &amp; _arg0);  \t \t\/\/@loc=static @len=20 @rva=4208 \t\/\/_Func: public void Shape(int ix, int iy);  \t \t\/\/@intro @virtual vtpo=0 vfid=1 @loc=static @len=11 @rva=4304 \t\/\/_Func: public void ~Shape();  \t \t\/\/@virtual vtpo=0 vfid=0 @loc=static @len=3 @rva=4336 \t\/\/_Func: public void draw();  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public void setXY(int _arg0, int _arg1);  \t \t\/\/@loc=static @len=12 @rva=4320 \t\/\/_Func: public void someWork();  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public Shape &amp; operator=(const Shape &amp; _arg0);  \t \t\/\/@intro @virtual vtpo=0 vfid=1 @loc=optimized @len=0 @rva=0 \t\/\/_Func: public void * __vecDelDtor(unsigned int _arg0);  \t \t\/\/_Data: this+0x8, Member, Type: int, x \t\/\/_Data: this+0xC, Member, Type: int, y \/\/UDT;  class Shape : public IDrawable { public: \tint x; \tint y; \t \tinline Shape * ctor(int ix, int iy) {  \t\ttypedef Shape * (Shape::*_fpt)(int, int);  \t\tauto _f=xcast&lt;_fpt&gt;(_drva(4208));  \t\treturn (this-&gt;*_f)(ix, iy);  \t} \t \tinline void dtor() {  \t\ttypedef void (Shape::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(get_vfp(this, 1));  \t\t(this-&gt;*_f)();  \t} \t \tinline void draw_impl() {  \t\ttypedef void (Shape::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(_drva(4336));  \t\treturn (this-&gt;*_f)();  \t} \t \tinline void draw() {  \t\ttypedef void (Shape::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(get_vfp(this, 0));  \t\treturn (this-&gt;*_f)();  \t} \t \tinline void someWork() {  \t\ttypedef void (Shape::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(_drva(4320));  \t\treturn (this-&gt;*_f)();  \t} }; <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">Circle<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/UDT: class Circle @len=24 @vfcount=2 \t\/\/_Base: class Shape @off=0 @len=16 \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public void Circle(const Circle &amp; _arg0);  \t \t\/\/@loc=static @len=34 @rva=4352 \t\/\/_Func: public void Circle(int ix, int iy, int ir);  \t \t\/\/@virtual vtpo=0 vfid=1 @loc=optimized @len=0 @rva=0 \t\/\/_Func: public void ~Circle();  \t \t\/\/@virtual vtpo=0 vfid=0 @loc=static @len=12 @rva=4464 \t\/\/_Func: public void draw();  \t \t\/\/@loc=optimized @len=0 @rva=0 \t\/\/_Func: public Circle &amp; operator=(const Circle &amp; _arg0);  \t \t\/\/@intro @virtual vtpo=0 vfid=1 @loc=optimized @len=0 @rva=0 \t\/\/_Func: public void * __vecDelDtor(unsigned int _arg0);  \t \t\/\/_Data: this+0x10, Member, Type: int, r \/\/UDT;  class Circle : public Shape { public: \tint r; \t \tinline Circle * ctor(int ix, int iy, int ir) {  \t\ttypedef Circle * (Circle::*_fpt)(int, int, int);  \t\tauto _f=xcast&lt;_fpt&gt;(_drva(4352));  \t\treturn (this-&gt;*_f)(ix, iy, ir);  \t} \t \tinline void dtor() {  \t\ttypedef void (Circle::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(get_vfp(this, 1));  \t\t(this-&gt;*_f)();  \t} \t \tinline void draw_impl() {  \t\ttypedef void (Circle::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(_drva(4464));  \t\treturn (this-&gt;*_f)();  \t} \t \tinline void draw() {  \t\ttypedef void (Circle::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(get_vfp(this, 0));  \t\treturn (this-&gt;*_f)();  \t} }; <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0427\u0442\u043e \u0442\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e?<\/p>\n<pre><code class=\"cpp\">\/\/UDT: class IDrawable @len=8 @vfcount=1  \/\/@intro @pure @virtual vtpo=0 vfid=0 @loc=optimized @len=0 @rva=0 \/\/_Func: public void draw(); \t \/\/ @intro --&gt; introducing virtual function (\u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0432\u043f\u0435\u0440\u0432\u044b\u0435) \/\/ @pure virtual --&gt; \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \/\/ @vtpo --&gt; virtual table pointer offset (\u043a\u0440\u0435\u0441\u0442\u043e\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e VT) \/\/ @vfid --&gt; virtual function id in VT \/\/ @loc=optimized --&gt; \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e \u0437\u0430 \u043d\u0435\u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e \/\/ @rva=0 --&gt; relative virtual address <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0430\u0434\u0440\u0435\u0441 \u0443\u0436\u0435 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">class IDrawable { \t\/\/ \u0431\u0435\u0437 VT \u043d\u0438\u043a\u0443\u0434\u0430 \tvoid* _vtable; \t \t\/\/ this-&gt;_vtable[func_id]() \tinline void draw() {  \t\ttypedef void (IDrawable::*_fpt)(); \t\tauto _f=xcast&lt;_fpt&gt;(get_vfp(this, 0));  \t\treturn (this-&gt;*_f)();  \t} };  \/\/ THIS IS SPARTA!!! __forceinline void* get_vtp(void* obj) {  \treturn *((void**)obj);  } __forceinline void* get_vfp(void* obj, size_t id) {  \treturn *((void**)((uint8_t*)get_vtp(obj) + id * sizeof(void*)));  } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0435\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c RVA \u0438\u0437 PDB \u0444\u0430\u0439\u043b\u0430 \u0438 \u0442\u043a\u043d\u0443\u0442\u044c \u043d\u043e\u0441\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440:<\/p>\n<pre><code class=\"cpp\">\/\/UDT: class Shape @len=16 @vfcount=2  \/\/@loc=optimized @len=0 @rva=0 &lt;--- \u0442\u0443\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0433\u043e\u0440\u0438\u0442, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0438\u043b \u043c\u0435\u0442\u043e\u0434 \/\/_Func: public void setXY(int _arg0, int _arg1);   \/\/@loc=static @len=12 @rva=4320 &lt;--- \u0412\u041e\u0422 \u041e\u041d, \u0417\u0414\u041e\u0420\u041e\u0412\u0415\u041d\u041d\u042b\u0419 \u042f\u0417\u042c \/\/_Func: public void someWork();   class Shape : public IDrawable { \tinline void someWork() {  \t\ttypedef void (Shape::*_fpt)();  \t\tauto _f=xcast&lt;_fpt&gt;(_drva(4320));  \t\treturn (this-&gt;*_f)();  \t} }; <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 _drva? \u041c\u044b \u0437\u043d\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e RVA (\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435) \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0430\u0437\u044b, \u0430 \u043d\u0443\u0436\u0435\u043d \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441:<\/p>\n<pre><code class=\"cpp\">void* _image_base = GetModuleHandleA(nullptr); \/\/ hello DYNAMICBASE  __forceinline void* _drva(size_t off) {  \treturn ((uint8_t*)_image_base) + off;  } <\/code><\/pre>\n<p>  \u0417\u0430\u0447\u0435\u043c xcast? \u041c\u0435\u0442\u043e\u0434\u044b \u0432 \u043f\u043b\u044e\u0441\u0430\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e __thiscall \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043a\u0442\u043e \u0442\u0443\u0442 \u0441\u0430\u043c\u044b\u0439 \u0443\u043c\u043d\u044b\u0439. \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u043a\u0430\u0441\u0442\u0443\u0435\u043c void* \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043c\u0435\u0442\u043e\u0434, this \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u044b\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">typedef void (Shape::*_fpt)();  auto _f=xcast&lt;_fpt&gt;(_drva(4320));  (this-&gt;*_f)(); \t\t \/\/ NUCLEAR MINEFIELD!!! template&lt;typename TOUT, typename TIN&gt; __forceinline TOUT xcast(TIN in) {     union     {         TIN in;         TOUT out;     }     u = { in };     return u.out; } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 victim.exe \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0443\u0442 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442. \u0421\u043c\u044b\u0441\u043b \u043e\u0434\u0438\u043d \u2014 \u043d\u0435\u043a\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 victim.exe. <\/p>\n<pre><code class=\"cpp\">void injected_func() { \tvoid* _image_base = GetModuleHandleA(nullptr); \tCircle* obj = (Circle*)malloc(sizeof(Circle)); \tobj-&gt;ctor(0, 0, 999); \t((IDrawable*)obj)-&gt;draw(); \tobj-&gt;dtor(); \tfree(obj); } <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0445\u0443\u043a\u043d\u0443\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434\/\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0443\u0436\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u2026 \u0418\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \ud83d\ude00<\/p>\n<p>  PROFIT\u2026<\/p>\n<p>  ===<\/p>\n<p>  \u041a\u0430\u043a \u044d\u0442\u0430 \u0444\u0438\u0433\u043d\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  Z2l0aHViLmNvbS93b25nZmVpL2FjLXBsdWdpbg==<\/p>\n<p>  aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g\/dj1SZUg1U0tmUEtTOA==<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0430\u0432\u0442\u043e\u0440 \u0443\u043f\u043e\u0440\u043e\u043b\u0441\u044f \u043f\u043e \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u0443 \u0438 \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u0443\u044e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0430 \u043e\u0442\u0440\u0435\u0432\u0435\u0440\u0441\u0438\u0442\u044c \u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \ud83d\ude00<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/507124\/\"> https:\/\/habr.com\/ru\/post\/507124\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507124\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wj\/xh\/nj\/wjxhnjjdjtlfvr8ruydjczb5trg.jpeg\"><\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u0443\u044e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0431\u0435\u0437 SDK, \u043d\u043e \u043f\u043e \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u043e\u043c\u0443 \u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044e \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0440\u044f\u0434\u043e\u043c \u0437\u0430\u0432\u0430\u043b\u044f\u043b\u0441\u044f PDB \u0444\u0430\u0439\u043b. <\/p>\n<p>  (\u0411\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u0434\u0435\u0442\u044f\u043c \u043d\u0435 \u0447\u0438\u0442\u0430\u0442\u044c!)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305508","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305508"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305508\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}