01 Feb 2010 @ 8:48 PM 

Open up C:\paimei\__build_installer.bat and change:

REM $Id: __build_installer.bat 194 2007-04-05 15:31:53Z cameron $

c:\python\python.exe setup.py bdist_wininst –bitmap=logos\installer.bmp –title=PaiMei

To:

REM $Id: __build_installer.bat 194 2007-04-05 15:31:53Z cameron $

c:\python25\python.exe setup.py bdist_wininst –bitmap=logos\installer.bmp –title=PaiMei

Open up a command prompt and go to wherever you checked out the paimei source… mine is in C:\paimei. Run the “__build_installer.bat” script:

C:\paimei>c:\python25\python.exe setup.py bdist_wininst –bitmap=logos\installe
.bmp –title=PaiMei
running bdist_wininst
running build
running build_py
creating build
creating build\lib
creating build\lib\pida
copying pida\basic_block.py -> build\lib\pida
copying pida\defines.py -> build\lib\pida
copying pida\function.py -> build\lib\pida
copying pida\instruction.py -> build\lib\pida
copying pida\module.py -> build\lib\pida
copying pida\__init__.py -> build\lib\pida
creating build\lib\pgraph
copying pgraph\cluster.py -> build\lib\pgraph
copying pgraph\edge.py -> build\lib\pgraph
copying pgraph\graph.py -> build\lib\pgraph
copying pgraph\node.py -> build\lib\pgraph
copying pgraph\__init__.py -> build\lib\pgraph
creating build\lib\pydbg
copying pydbg\breakpoint.py -> build\lib\pydbg
copying pydbg\defines.py -> build\lib\pydbg
copying pydbg\hardware_breakpoint.py -> build\lib\pydbg
copying pydbg\memory_breakpoint.py -> build\lib\pydbg
copying pydbg\memory_snapshot_block.py -> build\lib\pydbg
copying pydbg\memory_snapshot_context.py -> build\lib\pydbg
copying pydbg\my_ctypes.py -> build\lib\pydbg
copying pydbg\pdx.py -> build\lib\pydbg
copying pydbg\pydbg.py -> build\lib\pydbg
copying pydbg\pydbg_client.py -> build\lib\pydbg
copying pydbg\system_dll.py -> build\lib\pydbg
copying pydbg\windows_h.py -> build\lib\pydbg
copying pydbg\__init__.py -> build\lib\pydbg
creating build\lib\utils
copying utils\code_coverage.py -> build\lib\utils
copying utils\crash_binning.py -> build\lib\utils
copying utils\hooking.py -> build\lib\utils
copying utils\injection.py -> build\lib\utils
copying utils\process_stalker.py -> build\lib\utils
copying utils\udraw_connector.py -> build\lib\utils
copying utils\__init__.py -> build\lib\utils
copying pydbg\pydasm.pyd -> build\lib\pydbg
installing to build\bdist.win32\wininst
running install_lib
creating build\bdist.win32
creating build\bdist.win32\wininst
creating build\bdist.win32\wininst\PURELIB
creating build\bdist.win32\wininst\PURELIB\pgraph
copying build\lib\pgraph\cluster.py -> build\bdist.win32\wininst\PURELIB\pgraph
copying build\lib\pgraph\edge.py -> build\bdist.win32\wininst\PURELIB\pgraph
copying build\lib\pgraph\graph.py -> build\bdist.win32\wininst\PURELIB\pgraph
copying build\lib\pgraph\node.py -> build\bdist.win32\wininst\PURELIB\pgraph
copying build\lib\pgraph\__init__.py -> build\bdist.win32\wininst\PURELIB\pgrap

creating build\bdist.win32\wininst\PURELIB\pida
copying build\lib\pida\basic_block.py -> build\bdist.win32\wininst\PURELIB\pida
copying build\lib\pida\defines.py -> build\bdist.win32\wininst\PURELIB\pida
copying build\lib\pida\function.py -> build\bdist.win32\wininst\PURELIB\pida
copying build\lib\pida\instruction.py -> build\bdist.win32\wininst\PURELIB\pida
copying build\lib\pida\module.py -> build\bdist.win32\wininst\PURELIB\pida
copying build\lib\pida\__init__.py -> build\bdist.win32\wininst\PURELIB\pida
creating build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\breakpoint.py -> build\bdist.win32\wininst\PURELIB\pydb

copying build\lib\pydbg\defines.py -> build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\hardware_breakpoint.py -> build\bdist.win32\wininst\PUR
LIB\pydbg
copying build\lib\pydbg\memory_breakpoint.py -> build\bdist.win32\wininst\PUREL
B\pydbg
copying build\lib\pydbg\memory_snapshot_block.py -> build\bdist.win32\wininst\P
RELIB\pydbg
copying build\lib\pydbg\memory_snapshot_context.py -> build\bdist.win32\wininst
PURELIB\pydbg
copying build\lib\pydbg\my_ctypes.py -> build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\pdx.py -> build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\pydasm.pyd -> build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\pydbg.py -> build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\pydbg_client.py -> build\bdist.win32\wininst\PURELIB\py
bg
copying build\lib\pydbg\system_dll.py -> build\bdist.win32\wininst\PURELIB\pydb

copying build\lib\pydbg\windows_h.py -> build\bdist.win32\wininst\PURELIB\pydbg
copying build\lib\pydbg\__init__.py -> build\bdist.win32\wininst\PURELIB\pydbg
creating build\bdist.win32\wininst\PURELIB\utils
copying build\lib\utils\code_coverage.py -> build\bdist.win32\wininst\PURELIB\u
ils
copying build\lib\utils\crash_binning.py -> build\bdist.win32\wininst\PURELIB\u
ils
copying build\lib\utils\hooking.py -> build\bdist.win32\wininst\PURELIB\utils
copying build\lib\utils\injection.py -> build\bdist.win32\wininst\PURELIB\utils
copying build\lib\utils\process_stalker.py -> build\bdist.win32\wininst\PURELIB
utils
copying build\lib\utils\udraw_connector.py -> build\bdist.win32\wininst\PURELIB
utils
copying build\lib\utils\__init__.py -> build\bdist.win32\wininst\PURELIB\utils
running install_egg_info
Writing build\bdist.win32\wininst\PURELIB\PaiMei-1.2-py2.5.egg-info
creating ‘c:\docume~1\saint\locals~1\temp\tmpa3ag4q.zip’ and adding ‘.’ to it
adding ‘PURELIB\PaiMei-1.2-py2.5.egg-info’
adding ‘PURELIB\pgraph\cluster.py’
adding ‘PURELIB\pgraph\edge.py’
adding ‘PURELIB\pgraph\graph.py’
adding ‘PURELIB\pgraph\node.py’
adding ‘PURELIB\pgraph\__init__.py’
adding ‘PURELIB\pida\basic_block.py’
adding ‘PURELIB\pida\defines.py’
adding ‘PURELIB\pida\function.py’
adding ‘PURELIB\pida\instruction.py’
adding ‘PURELIB\pida\module.py’
adding ‘PURELIB\pida\__init__.py’
adding ‘PURELIB\pydbg\breakpoint.py’
adding ‘PURELIB\pydbg\defines.py’
adding ‘PURELIB\pydbg\hardware_breakpoint.py’
adding ‘PURELIB\pydbg\memory_breakpoint.py’
adding ‘PURELIB\pydbg\memory_snapshot_block.py’
adding ‘PURELIB\pydbg\memory_snapshot_context.py’
adding ‘PURELIB\pydbg\my_ctypes.py’
adding ‘PURELIB\pydbg\pdx.py’
adding ‘PURELIB\pydbg\pydasm.pyd’
adding ‘PURELIB\pydbg\pydbg.py’
adding ‘PURELIB\pydbg\pydbg_client.py’
adding ‘PURELIB\pydbg\system_dll.py’
adding ‘PURELIB\pydbg\windows_h.py’
adding ‘PURELIB\pydbg\__init__.py’
adding ‘PURELIB\utils\code_coverage.py’
adding ‘PURELIB\utils\crash_binning.py’
adding ‘PURELIB\utils\hooking.py’
adding ‘PURELIB\utils\injection.py’
adding ‘PURELIB\utils\process_stalker.py’
adding ‘PURELIB\utils\udraw_connector.py’
adding ‘PURELIB\utils\__init__.py’
creating dist
removing ‘build\bdist.win32\wininst’ (and everything under it)

If everything worked you should now have a barnd new binary in C:\paimei\dist:


PaiMei-1.2.win32.exe

Lets run it to install the final bits of PaiMei…






When you re-run the “__install_requirements.py” script you’ll still get:

looking for PaiMei -> PyDbg … NOT FOUND

To resolve this, edit “edit C:\Python25\Lib\site-packages\pydbg\my_ctypers.py”

Look for the following code segment:

c_types = (Structure, c_char, c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, \
c_ulonglong, c_float, c_double, c_char_p, c_wchar_p, c_void_p)

… and ABOVE it, add ( replace “insert tab” with an actual tab, wordpress mess with my tabbing):

class Structure(Structure):
[INSERT TAB] pass

When you re-run the “__install_requirements.py” script you shound get FOUND for all of them. You’ll probably get this error (and I don’t care):

looking for pydot … Couldn’t import dot_parser, loading of dot files will not be possible.

Lets navigate to C:\paimei\console




When we double click the console you will (hopefully) be greated by an old-man, Mr. PaiMei himself, and then the console. Take the time to read the documentation but be ready to re-learn a few things.




The framework comes with a number of great reversing tools that we will cover in the days to come:








Posted By: jRichards
Last Edit: 02 Feb 2010 @ 08:24 PM

EmailPermalink
Tags
Categories: PaiMei


 

Responses to this post » (4 Total)

 
  1. john_rambo says:

    Hi, I tried to install PaiMei but I’m stuck on step when I need edit PyDBG file in order to get FOUND instead NOT FOUND by PaiMei requirements. I did what you told (I pasted class Structure(Structure):
    [INSERT TAB] pass above this line) but I still get NOT FOUND. Any ideas?

  2. john_rambo says:

    Well, today I did it. Problem laid in pydasm. Solution? I downloaded pydasm from here http://ashine.springnote.com/pages/5925085 and copy-paste it to Lib\site-packages\pydbg, after that PaiMei launches. (Although still print NOT FOUND along with pydbg in install_requir.)

  3. f0s says:

    thanks a lot for your nice tut;)
    it saves me some time to reinstall paimei

    regarding the error msg
    “looking for pydot … Couldn’t import dot_parser, loading of dot files will not be possible.”

    install pyparsing, that’s all!;)
    http://pypi.python.org/pypi/pyparsing/1.5.5
    in your case the python 2.5 compilation

    regarding pydasm:
    open pydasm.pyd in your hex editor and search for “26.dll”. replace 26 with 25. you have to do it twice, once in “C:\Python25\Lib\site-packages” and of course in your local svn directory paimei

    after all you get this nice console output:
    C:\fuzzers\paimei>__install_requirements.py
    looking for ctypes … FOUND
    looking for pydot … FOUND
    looking for wxPython … FOUND
    looking for MySQLdb … FOUND
    looking for GraphViz in default directory … FOUND
    looking for Oreas GDE in default directory … FOUND
    looking for uDraw(Graph) in default directory … FOUND
    looking for PaiMei -> PyDbg … FOUND
    looking for PaiMei -> PIDA … FOUND
    looking for PaiMei -> pGRAPH … FOUND
    looking for PaiMei -> Utilities … FOUND

    ;)

  4. jRichards says:

    Thanks for the info f0s

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 Last 50 Posts
 Back
Change Theme...
  • Users » 52
  • Posts/Pages » 28
  • Comments » 13
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Vulns



    No Child Pages.

Tools



    No Child Pages.

PaiMei



    No Child Pages.

PGP Key



    No Child Pages.