@@ -58,7 +58,7 @@ BOOST_PYTHON_FUNCTION_OVERLOADS(find_binary_overload, find_binary, 1, 2);
58
58
59
59
void export_binaryfile ()
60
60
{
61
- BOOST_ABSTRACT_CLASS ( CBinaryFile)
61
+ class_<CBinaryFile, boost::noncopyable>( " CBinaryFile" , no_init )
62
62
63
63
// Class methods
64
64
CLASS_METHOD (CBinaryFile,
@@ -76,36 +76,31 @@ void export_binaryfile()
76
76
)
77
77
78
78
// Special methods
79
- CLASS_METHOD_SPECIAL (CBinaryFile,
80
- " __getattr__" ,
81
- find_address,
79
+ .def (" __getattr__" ,
80
+ &CBinaryFile::find_address,
82
81
" Returns the address of a signature or symbol found in memory." ,
83
82
args (" identifier" ),
84
83
manage_new_object_policy ()
85
84
)
86
85
87
- CLASS_METHOD_SPECIAL (CBinaryFile,
88
- " __getitem__" ,
89
- find_address,
86
+ .def (" __getitem__" ,
87
+ &CBinaryFile::find_address,
90
88
" Returns the address of a signature or symbol found in memory." ,
91
89
args (" identifier" ),
92
90
manage_new_object_policy ()
93
91
)
94
-
92
+
95
93
// Properties
96
- CLASS_PROPERTY_READ_ONLY (CBinaryFile,
97
- " addr" ,
98
- get_address,
94
+ .add_property (" addr" ,
95
+ &CBinaryFile::get_address,
99
96
" Returns the base address of this binary."
100
97
)
101
98
102
- CLASS_PROPERTY_READ_ONLY (CBinaryFile,
103
- " size" ,
104
- get_size,
99
+ .add_property (" size" ,
100
+ &CBinaryFile::get_size,
105
101
" Returns the size of this binary."
106
102
)
107
-
108
- BOOST_END_CLASS ()
103
+ ;
109
104
110
105
def (" find_binary" ,
111
106
&find_binary,
@@ -158,7 +153,7 @@ DECLARE_CLASS_METHOD_OVERLOAD(CPointer, set_string, 1, 4);
158
153
159
154
void export_memtools ()
160
155
{
161
- BOOST_CLASS_CONSTRUCTOR ( CPointer, optional<unsigned long >)
156
+ class_<CPointer>( " CPointer" , init< optional<unsigned long > >() )
162
157
163
158
// Class methods
164
159
CLASS_METHOD_OVERLOAD_RET (CPointer,
@@ -579,54 +574,48 @@ void export_memtools()
579
574
)
580
575
581
576
// Special methods
582
- CLASS_METHOD_SPECIAL (CPointer,
583
- " __int__" ,
584
- get_address,
577
+ .def (" __int__" ,
578
+ &CPointer::get_address,
585
579
" Returns the address of this memory block."
586
580
)
587
581
588
- CLASS_METHOD_SPECIAL (CPointer,
589
- " __bool__" ,
590
- is_valid,
582
+ .def (" __bool__" ,
583
+ &CPointer::is_valid,
591
584
" Returns True if the address is not NULL."
592
585
)
593
586
594
- CLASS_METHOD_SPECIAL (CPointer,
595
- " __add__" ,
596
- add,
587
+ .def (" __add__" ,
588
+ &CPointer::add,
597
589
" Adds a value to the base address." ,
598
590
manage_new_object_policy ()
599
591
)
600
592
601
- CLASS_METHOD_SPECIAL (CPointer,
602
- " __sub__" ,
603
- sub,
593
+ .def (" __sub__" ,
594
+ &CPointer::sub,
604
595
" Subtracts a value from the base address." ,
605
596
manage_new_object_policy ()
606
597
)
607
598
608
599
// Properties
609
- CLASS_PROPERTY_READ_ONLY (CPointer,
610
- " addr" ,
611
- get_address,
600
+ .add_property (" addr" ,
601
+ &CPointer::get_address,
612
602
" Returns the address of this memory block."
613
603
)
614
604
615
- CLASS_PROPERTY_READ_ONLY (CPointer,
616
- " size" ,
617
- get_size,
605
+ .add_property (" size" ,
606
+ &CPointer::get_size,
618
607
" Returns the size of this memory block."
619
608
)
609
+ ;
620
610
621
- BOOST_END_CLASS ()
622
-
623
- BOOST_FUNCTION (alloc,
611
+ def (" alloc" ,
612
+ alloc,
624
613
" Allocates a memory block." ,
625
614
args (" iSize" ),
626
615
manage_new_object_policy ()
627
616
);
628
617
629
- BOOST_INHERITED_CLASS_CONSTRUCTOR ( CFunction, CPointer, unsigned long , Convention_t, char *)
618
+ class_< CFunction, bases< CPointer> >( " CFunction " , init< unsigned long , Convention_t, char *>() )
630
619
631
620
CLASS_METHOD_VARIADIC (CFunction,
632
621
__call__,
@@ -669,8 +658,7 @@ void export_memtools()
669
658
remove_post_hook,
670
659
" Removes a post-hook callback."
671
660
)
672
-
673
- BOOST_END_CLASS ()
661
+ ;
674
662
675
663
DEFINE_CLASS_METHOD_VARIADIC (CFunction, __call__);
676
664
DEFINE_CLASS_METHOD_VARIADIC (CFunction, call_trampoline);
@@ -682,34 +670,33 @@ void export_memtools()
682
670
void export_dyncall ()
683
671
{
684
672
enum_<Convention_t>(" Convention" )
685
- ENUM_VALUE (" CDECL" , CONV_CDECL)
686
- ENUM_VALUE (" STDCALL" , CONV_STDCALL)
687
- ENUM_VALUE (" THISCALL" , CONV_THISCALL)
688
- BOOST_END_CLASS ()
673
+ . value (" CDECL" , CONV_CDECL)
674
+ . value (" STDCALL" , CONV_STDCALL)
675
+ . value (" THISCALL" , CONV_THISCALL)
676
+ ;
689
677
690
678
// Other constants that are very useful.
691
- BOOST_GLOBAL_ATTRIBUTE ( " DC_ERROR_NONE" , DC_ERROR_NONE) ;
692
- BOOST_GLOBAL_ATTRIBUTE ( " DC_ERROR_UNSUPPORTED_MODE" , DC_ERROR_UNSUPPORTED_MODE) ;
679
+ scope (). attr ( " DC_ERROR_NONE" ) = DC_ERROR_NONE;
680
+ scope (). attr ( " DC_ERROR_UNSUPPORTED_MODE" ) = DC_ERROR_UNSUPPORTED_MODE;
693
681
694
- BOOST_FUNCTION (get_error,
682
+ def (" get_error" ,
683
+ get_error,
695
684
" Returns the last DynCall error ID."
696
685
);
697
686
}
698
687
699
688
void export_dynamichooks ()
700
689
{
701
- BOOST_CLASS_CONSTRUCTOR ( CStackData, CHook*)
690
+ class_<CStackData>( " CStackData" , init< CHook*>() )
702
691
703
692
// Special methods
704
- CLASS_METHOD_SPECIAL (CStackData,
705
- " __getitem__" ,
706
- get_item,
693
+ .def (" __getitem__" ,
694
+ &CStackData::get_item,
707
695
" Returns the argument at the specified index."
708
696
)
709
697
710
- CLASS_METHOD_SPECIAL (CStackData,
711
- " __setitem__" ,
712
- set_item,
698
+ .def (" __setitem__" ,
699
+ &CStackData::set_item,
713
700
" Sets the argument at the specified index."
714
701
)
715
702
@@ -721,6 +708,5 @@ void export_dynamichooks()
721
708
),
722
709
" Stack pointer register."
723
710
)
724
-
725
- BOOST_END_CLASS ()
711
+ ;
726
712
}
0 commit comments