Hehouhua / idapython

Automatically exported from code.google.com/p/idapython
Other
0 stars 0 forks source link

Version 1.4.3 fail to build (get_highlighted_identifier) #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The build fails (see build log and config below). The offending code is 
apparently the new function get_highlighted_identifier.
Removing the function (see patch below) solve the build.

I'm not a C++ expert, I did not really investigate the root cause of the bug. 
Quick 'n dirty fix :-)

My config ---------------------------
IDA SDK 6.0
Python 2.7.1
swig 2.0.1
OS: ArchLinux 32bits
IDAPython svn (r341)

Dirty patch ---------------------------
diff -urN idapython/swig/kernwin.i idapython2/swig/kernwin.i
--- idapython/swig/kernwin.i    2011-02-08 10:28:39.000000000 +0100
+++ idapython2/swig/kernwin.i   2011-02-08 11:28:02.000000000 +0100
@@ -43,9 +43,6 @@
 %ignore skipSpaces;
 %ignore stristr;

-%ignore get_highlighted_identifier;
-%rename (get_highlighted_identifier) py_get_highlighted_identifier;
-
 // CLI
 %ignore cli_t;
 %ignore install_command_interpreter;
@@ -2288,29 +2285,6 @@

 //------------------------------------------------------------------------
 /*
-#<pydoc>
-def get_highlighted_identifier(flags = 0):
-    """
-    Returns the currently highlighted identifier
-
-    @param flags: reserved (pass 0)
-    @return: None or the highlighted identifier
-    """
-    pass
-#</pydoc>
-*/
-static PyObject *py_get_highlighted_identifier(int flags = 0)
-{
-  char buf[MAXSTR];
-  bool ok = get_highlighted_identifier(buf, sizeof(buf), flags);
-  if ( !ok )
-    Py_RETURN_NONE;
-  else
-    return PyString_FromString(buf);
-}
-
-//------------------------------------------------------------------------
-/*
 #<pydoc>
 def asktext(max_text, defval, prompt):
     """

Build log ---------------------------
└[/tmp/idapython]> python2 build.py 
swig -modern -python -c++ -w451 -shadow -D__GNUC__ -DNO_OBSOLETE_FUNCS -Iswig 
-o idaapi.cpp  -I../swigsdk-versions/6.0/include idaapi.i
SWIG:1: Warning 125: Use of the include path to find the input file is 
deprecated and will not work with ccache. Please include the path when 
specifying the input file.
g++ -m32 -fpermissive -o idaapi.o -c idaapi.cpp -I. -Iswig 
-I/usr/include/python2.7 -I../swigsdk-versions/6.0/include  -DVER_MAJOR="1" 
-DVER_MINOR="4" -DVER_PATCH="3" -D__IDP__ -DMAXSTR="1024" 
-DUSE_DANGEROUS_FUNCTIONS -DUSE_STANDARD_FILE_FUNCTIONS -D__LINUX__ -DPLUGINFIX 
idaapi.cpp: In static member function ‘static bool 
py_custom_data_type_t::s_may_create_at(void*, ea_t, size_t)’:
idaapi.cpp:7511:133: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In static member function ‘static asize_t 
py_custom_data_type_t::s_calc_item_size(void*, ea_t, asize_t)’:
idaapi.cpp:7529:135: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In static member function ‘static bool 
py_custom_data_format_t::s_print(void*, qstring*, const void*, asize_t, ea_t, 
int, int)’:
idaapi.cpp:7682:11: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In static member function ‘static bool 
py_custom_data_format_t::s_scan(void*, bytevec_t*, const char*, ea_t, int, 
qstring*)’:
idaapi.cpp:7721:18: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In static member function ‘static void 
py_custom_data_format_t::s_analyze(void*, ea_t, int)’:
idaapi.cpp:7781:126: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘void py_choose2_t::on_get_line(int, char* 
const*)’:
idaapi.cpp:9253:86: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int py_choose2_t::on_delete_line(int)’:
idaapi.cpp:9299:90: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int py_choose2_t::on_refresh(int)’:
idaapi.cpp:9309:86: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘void py_choose2_t::on_select_line(int)’:
idaapi.cpp:9325:90: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘void py_choose2_t::on_edit_line(int)’:
idaapi.cpp:9331:88: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int py_choose2_t::on_command(int, int)’:
idaapi.cpp:9337:95: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int py_choose2_t::on_get_icon(int)’:
idaapi.cpp:9347:87: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘void py_choose2_t::on_get_line_attr(int, 
chooser_item_attrs_t*)’:
idaapi.cpp:9355:92: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In static member function ‘static int 
plgform_t::s_callback(void*, int, char*)’:
idaapi.cpp:9728:44: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp:9742:44: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘bool py_cli_t::on_execute_line(const 
char*)’:
idaapi.cpp:9889:86: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘bool py_cli_t::on_keydown(qstring*, int*, 
int*, int*, int)’:
idaapi.cpp:9923:12: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘bool py_cli_t::on_complete_line(qstring*, 
const char*, int, const char*, int)’:
idaapi.cpp:9964:104: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘virtual bool 
py_simplecustview_t::on_click(int)’:
idaapi.cpp:10646:86: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘virtual bool 
py_simplecustview_t::on_dblclick(int)’:
idaapi.cpp:10657:90: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘virtual bool 
py_simplecustview_t::on_keydown(int, int)’:
idaapi.cpp:10694:97: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘virtual bool 
py_simplecustview_t::on_hint(place_t*, int*, qstring&)’:
idaapi.cpp:10717:95: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘virtual bool 
py_simplecustview_t::on_popup_menu(size_t)’:
idaapi.cpp:10738:106: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘bool py_simplecustview_t::jumpto(size_t, int, 
int)’:
idaapi.cpp:10844:57: warning: taking address of temporary
idaapi.cpp: In function ‘uint32 choose_sizer(void*)’:
idaapi.cpp:11157:62: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp:11157:62: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In function ‘char* choose_getl(void*, uint32, char*)’:
idaapi.cpp:11168:65: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp:11168:65: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In function ‘void choose_enter(void*, uint32)’:
idaapi.cpp:11195:58: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp:11195:58: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In function ‘PyObject* py_get_highlighted_identifier(int)’:
idaapi.cpp:11259:63: error: ‘get_highlighted_identifier’ was not declared 
in this scope
idaapi.cpp: In function ‘void s_py_get_user_defined_prefix(ea_t, int, int, 
const char*, char*, size_t)’:
idaapi.cpp:11568:37: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘void py_graph_t::on_command(Py_ssize_t)’:
idaapi.cpp:13244:76: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘bool 
py_graph_t::on_user_text(mutable_graph_t*, int, const char**, bgcolor_t*)’:
idaapi.cpp:13342:81: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int 
py_graph_t::on_user_hint(mutable_graph_t*, int, int, int, char**)’:
idaapi.cpp:13392:83: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int py_graph_t::on_clicked(graph_viewer_t*, 
selection_item_t*, graph_item_t*)’:
idaapi.cpp:13440:83: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int 
py_graph_t::on_dblclicked(graph_viewer_t*, selection_item_t*)’:
idaapi.cpp:13462:89: warning: deprecated conversion from string constant to 
‘char*’
idaapi.cpp: In member function ‘int 
py_graph_t::on_changed_current(graph_viewer_t*, int)’:
idaapi.cpp:13494:83: warning: deprecated conversion from string constant to 
‘char*’
Traceback (most recent call last):
  File "build.py", line 502, in <module>
    main()
  File "build.py", line 496, in main
    build_binary_package(ea64=False, nukeold=True)
  File "build.py", line 405, in build_binary_package
    build_plugin(platform_string, IDA_SDK, plugin_name, ea64)
  File "build.py", line 356, in build_plugin
    assert res == 0, "Failed to build the wrapper module"
AssertionError: Failed to build the wrapper module

Original issue reported on code.google.com by gras.emm...@gmail.com on 8 Feb 2011 at 10:56

GoogleCodeExporter commented 8 years ago
Please download the 6.0 SDK from our site. We added the missing definition.

Let me know if it works with you.

Original comment by elias.ba...@gmail.com on 8 Feb 2011 at 3:32

GoogleCodeExporter commented 8 years ago
What site do you mean ? I don't see it on http://code.google.com/p/idapython/

Original comment by gras.emm...@gmail.com on 8 Feb 2011 at 3:40

GoogleCodeExporter commented 8 years ago
What site do you mean ? I don't see it on http://code.google.com/p/idapython/

Emmanuel

Original comment by gras.emm...@gmail.com on 9 Feb 2011 at 9:17

GoogleCodeExporter commented 8 years ago
I mean redownload the SDK 6.0 from the Hex-Rays user site.

http://hex-rays.com/idapro/ida/idasdk60b.zip  You need the username/password 
you received when you got IDA 6.0

Original comment by elias.ba...@gmail.com on 10 Feb 2011 at 2:52

GoogleCodeExporter commented 8 years ago
thanks it works with the SDK from hex-rays web site.

Emmanuel

Original comment by gras.emm...@gmail.com on 11 Feb 2011 at 8:25

GoogleCodeExporter commented 8 years ago
Great. Sorry for the inconvenience.

Original comment by elias.ba...@gmail.com on 11 Feb 2011 at 5:15