Want to Join Us ?

you'll be able to discuss, share and send private messages.

HELP!! with plugin PIN debugger

Discussion in 'Plugins' started by storm shadow, Jan 26, 2014.

Share This Page

  1. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    After looking at the plugins.cfg from idademo 6.4 \plugins\plugins.cfg

    Code (Text):
            ; Debugger plugins
            Windbg_debugger            windbg_user 0      0  DEBUG
            Local_Windows_debugger      win32_user  0      0  DEBUG
            Remote_Windows_debugger    win32_stub  0      0  DEBUG
            Local_Bochs_debugger        bochs_user  0      0  DEBUG
            Local_Linux_debugger        linux_user  0      0  DEBUG
            Remote_Linux_debugger      linux_stub  0      0  DEBUG
            Remote_ARMLinux/Android_debugger armlinux_stub 0 0 DEBUG ; only remote
            Remote_WinCE_debugger      wince_stub  0      0  DEBUG ; only remote
            Local_Mac_OS_X_debugger    mac_user    0      0  DEBUG
            Remote_Mac_OS_X_debugger    mac_stub    0      0  DEBUG
            Remote_Symbian_debugger    epoc_user  0      0  DEBUG ; only remote
            Remote_iPhone_v1.x_debugger iphone_stub 0      0  DEBUG ; only remote
            Remote_GDB_debugger        gdb_user    0      0  DEBUG ; only remote
            [COLOR=#ff0000]PIN_debugger                pin_user    0      0  DEBUG[/COLOR]
            ; Other plugins
    I notice that
    PIN_debugger pin_user 0 0 DEBUG
    is in the plugins.cfg 6.4 but not in ida 6.1
    any i wanted to build it.
    Spent whole day building the ida pin debugger

    Its build but give an error both in Ida demo 6.4 and ida 6.1



    Building the PIN tool from hexrays site


    After alot off error i manage to build it with vc2010 and pin download
    IA32 and intel64 (x86 32 bit and 64 bit) revision 58423 Apr 11, 2013 VC10

    http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.12-58423-msvc10-windows.zip

    I made an folder c:\pin2 then extracted the DL to pin2

    then i downloaded the pin from ida https://www.hex-rays.com/products/ida/support/freefiles/idapin.zip and extracted it to C:\pin2\source\

    Then in vc2010
    FILE>>open Project/Solution>>C:\pin2\source\all_pin_related.sln
    I set the build to release.
    header an resource files are fixed with project properties
    C++ >>General >>(AdditionalIncludeDirectories) C:\pin2\extras\components\include;C:\pin2\extras\components\include\util;C:\pin2\extras\xed2-ia32\include;C:\pin2\source\include\pin\gen;C:\pin2\source\include\pin;%


    Lib errrors are fixed with
    Linker>>>input(AdditionalDependicies)pin.lib;libxed.lib;libcpmt.lib;libcmt.lib;pinvm.lib;kernel32.lib;ntdll-32.lib;ws2_32.lib

    I changhed the cofiiggoration>>>General >>>targetExtension to .plw
    plw is like dll but ida use extension plw.

    Build log

    Code (Text):
    1>------ Build started: Project: idadbg, Configuration: Release Win32 ------
    1>Build started 26.01.2014 20:57:11.
    1>InitializeBuildStatus:
    1>  Creating "Release\idadbg.unsuccessfulbuild" because "AlwaysCreate" was specified.
    1>  idadbg.cpp
    1>Link:
    1>     Creating library C:\pin2\source\Release\idadbg.lib and object C:\pin2\source\Release\idadbg.exp
    1>  IDADBG.vcxproj -> C:\pin2\source\Release\idadbg.plw
    1>FinalizeBuildStatus:
    1>  Deleting file "Release\idadbg.unsuccessfulbuild".
    1>  Touching "Release\idadbg.lastbuildstate".
    1>
    1>Build succeeded.
    1>
    1>Time Elapsed 00:00:02.11
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
     
    I now copy the Idadbg.plw to ida\plugin folder both ida pro 6.1 and demo 6.4

    I get this error when loading Ida PRo


    LoadLibrary(C:\Users\zadow\Downloads\ida\ida\plugins\idadbg.plw) error: modul not found.

    C:\Users\zadow\Downloads\ida\ida\plugins\idadbg.plw: can't load file



    Any ideas ???
     

    Attached Files:

  2. Rip Cord

    Administrator Staff Member Admin Developer

    well, it doesn't even show in the list of debuggers for me
    local bochs, win32 blah blah blah but not pin

    in pin_tutorial.pdf page 5
    wonder why they don't use plw

    btw, in forum posts, I can't get colored text to display properly in a code block, like in your post above shows
    [COLOR=#ff0000]PIN_debugger pin_user 0 0 DEBUG[/COLOR]
    instead of red :(
    PIN_debugger pin_user 0 0 DEBUG
     
  3. computerline

    Well-Known Member Ida Pro Expert

    Plugin Loaded, but not compatible with my version, so you must add pin directory in your Environt Variable and copy pinvm.dll to IDA Directory

    Code (Text):
    idadbg.plw: incompatible plugin version, skipped
     
    Rip Cord likes this.
  4. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    I think they left out something on purpose

    http://tinyurl.com/padv3o2
    if you download the tool and open the "all_pin_related.sln" l all in editor it makes sense.

    the idadbg is supposed to be an dll its actuelly the pinwm.dll just called idadbg.dll

    Then you have to build the pin_user.plw with all pin releated , they just dont tell you how.
    the pin_user.plw goes to plugin folder

    Code (Text):

    Microsoft Visual Studio Solution File, Format Version 11.00
    # Visual Studio 2010
    Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pin_user", "pin_remote.vcxproj", "{7B15DC49-31A0-468F-9E7B-F2E27A80FF61}"
    EndProject
    Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "idaq", "..\..\ui\qt\idaqv32.vcxproj", "{EB64A121-F5A9-4491-9571-8C1DD6EDA36D}"
    EndProject
    Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "idadbg", "..\..\..\..\tools\pin\pin-2.12-53271-msvc10-ia32_intel64-windows\source\tools\MyPinTool\MyPinTool.vcxproj", "{639EF517-FCFC-408E-9500-71F0DC0458DB}"
    EndProject
    Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
            Debug|Win32 = Debug|Win32
            Debug|x64 = Debug|x64
            Release|Win32 = Release|Win32
            Release|x64 = Release|x64
        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Debug|Win32.ActiveCfg = Debug|Win32
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Debug|Win32.Build.0 = Debug|Win32
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Debug|x64.ActiveCfg = Debug|x64
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Debug|x64.Build.0 = Debug|x64
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Release|Win32.ActiveCfg = Release|Win32
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Release|Win32.Build.0 = Release|Win32
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Release|x64.ActiveCfg = Release|x64
            {7B15DC49-31A0-468F-9E7B-F2E27A80FF61}.Release|x64.Build.0 = Release|x64
            {EB64A121-F5A9-4491-9571-8C1DD6EDA36D}.Debug|Win32.ActiveCfg = Debug|Win32
            {EB64A121-F5A9-4491-9571-8C1DD6EDA36D}.Debug|Win32.Build.0 = Debug|Win32
            {EB64A121-F5A9-4491-9571-8C1DD6EDA36D}.Debug|x64.ActiveCfg = Debug|Win32
            {EB64A121-F5A9-4491-9571-8C1DD6EDA36D}.Release|Win32.ActiveCfg = Release|Win32
            {EB64A121-F5A9-4491-9571-8C1DD6EDA36D}.Release|Win32.Build.0 = Release|Win32
            {EB64A121-F5A9-4491-9571-8C1DD6EDA36D}.Release|x64.ActiveCfg = Release|Win32
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Debug|Win32.ActiveCfg = Debug|Win32
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Debug|Win32.Build.0 = Debug|Win32
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Debug|x64.ActiveCfg = Debug|x64
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Debug|x64.Build.0 = Debug|x64
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Release|Win32.ActiveCfg = Release|Win32
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Release|Win32.Build.0 = Release|Win32
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Release|x64.ActiveCfg = Release|x64
            {639EF517-FCFC-408E-9500-71F0DC0458DB}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
            HideSolutionNode = FALSE
        EndGlobalSection
    EndGlobal

    its presselly the same with other debugger lets add some debuggers from version 6.1 to new demo

    works like an charm
    [​IMG]

    But where to find the last stuff for building the pin_user.plw o_O
     
    Rip Cord likes this.
  5. computerline

    Well-Known Member Ida Pro Expert

    I finally figureout, and success build idadbg.dll :)
    Code (Text):
    \pin\ia32\bin>\pin\ia32\bin\pin.exe -t \pin\ia32\bin\idadbg.dll -p 1234 -- test.exe
    This build up pin debug server, but we don't have ida plugin remote client :) So, I think we must code remote debug plugin, haha
     
    Nihilus likes this.
  6. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    Yes we have to build the pin_user.plw
    Just very wierd it isent in either sdk 6.4 or 6.5
     
    Rip Cord and computerline like this.
  7. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    we can only hope for a leak for pin_user.plw and pin_remote.plw
     
    Rip Cord and computerline like this.
  8. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    i looked again and i do think we can build the pin_user also

    i have some trouble though

    getting this error

    Code (Text):
    1>c:\pin2\source\include\pin\compiler_version_check2.H(83): fatal error C1189: #error :  "Unknown target architecture"
     
     
    Rip Cord likes this.
  9. computerline

    Well-Known Member Ida Pro Expert

    What project is pin_user ?
     
  10. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    builded for ida pro 6.8
     

    Attached Files:

    marius, hypnz and Rip Cord like this.
Top