binhack32 sourcecode released

Discussion in 'Sega Dreamcast Development and Research' started by -=FamilyGuy=-, Oct 31, 2011.

  1. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    binhack32/64 is now on sourceforge and released under GPLv3: https://sourceforge.net/projects/binhack32/
    Get the sourcecode with binaries here: http://sourceforge.net/projects/binhack32/files/binhack32-1005-release.zip/download

    Or get the latest modifications to the source via git: git clone git://git.code.sf.net/p/binhack32/code binhack32-code


    binhack32/64:
    A clone of the program binhack used to hack LBA references in dreamcast Katana executables. Some features are added on top of the original ones; namely patching the bootsector to enable the VGA flag and setting the OS flag to 0 if a binconed bootbin is detected.

    The purpose of this project is to replace binhack on system that don't support 16bits x86 binaries.


    Features:
    • Hack the LBA45166 reference in Dreamcast Katana binaries (45000 + 166)
    • Create a hacked bootsector from an original one
    • Drop-in replacement for original binhack
    • Enable all region flags in the bootsector, making it region-free
    • Enable the VGA flag in the bootsector, restoring VGA support for some titles
    • Set the OS flag to 0 in the bootsector if a binconed WinCE binary is detected Licensed under GPLv3


    Thanks to Sizious for helping structuring and cleaning the code.

    Cheers!

    FG



    =========== Original message ===========

    There has been a demand for this lately so I am releasing it, albeit on a very restrictive license...

    http://shenmuesubs.sourceforge.net/download/addons/binhack32_1.0.0.3-Win32_Linux.zip

    Binhack32 is a clone of the original echelon's binhack coded in c++, allowing it to be compiled on recent OS. It was made to be a binhack alternative for 64 bits systems which can't execute the old 16bits binhack.

    This program also enable the vga flag in the ip.bin, even if binhack doesn't. Also the small easteregg the original coder had put is not reproduced, leaving all ip.bin game info intact. Furthermore, it detects a bincon'd binary and changes the OS flag of the ip.bin accordingly.

    I must thanks Sizious for cleaning up and optimizing my ugly code, merci l'ami!

    Have fun!

    FG


    Ps: I take this opportunity to underline the fact that when binhack asks for a bootsector you don't need to input ip.bin. In fact it will always use ip.bin as the input bootsector and the one it asks you to input is the output, read hacked, one. I always uses ip.hak as the hacked ip.bin, but it's up to you. This has the benefits of leaving the original ip.bin untouched.
     
    Last edited: Jul 14, 2014
    fafadou likes this.
  2. Mystical

    Mystical Resolute Member

    Joined:
    May 3, 2011
    Messages:
    935
    Likes Received:
    35
    cool, thanks for the release
     
  3. RaZiel

    RaZiel Enthusiastic Member

    Joined:
    Oct 30, 2008
    Messages:
    541
    Likes Received:
    85
    This will hack the IP.BIN for any LBA like 4500, 11702, 11700? Also can this hack the DP browser binaries?
     
  4. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    This is a binhack *clone* so it should do the same as original binhack: Hack any standard (katana) binary to a specified LBA. It does only apply the LBA hack though, other copy protection must be cracked otherwise.

    FG
     
    Last edited: Nov 2, 2011
  5. RaZiel

    RaZiel Enthusiastic Member

    Joined:
    Oct 30, 2008
    Messages:
    541
    Likes Received:
    85
    Sweet thanks man I hate using a VM to hack the bin sometimes. I was under the impression it only did 45000 for some reason. Now that Win7 has aspi drivers and this there is no need for any other OS to make my DC games.

    EDIT

    Wait is there a 32 bit tool for IPINS?
     
    Last edited: Nov 1, 2011
  6. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    You know binhack32 has been released quite a while now... only the opened source is new in this 1.0.0.3 release ...
    Out of interest you migth read the first lines of main.cpp, it explains what I figured binhack to actually do.

    Also, vanilla binaries are LBA referenced to 45000LBA out of the box. It'd have been pretty silly for binhack to only support this LBA...

    For ipins:

    When you're creating the 2de session iso file, add "-G ip.hak" to the mkisofs command to insert the ip.bin in the first 16 sectors!

    This is, as an exemple, how I build my 2de session iso file:
    mkisofs -C 0,45000 -V SELFBOOT -G ip.hak -M data1.iso -duplicates-once -l -sort sorttxt.txt -hide 0.0 -o data2.iso data

    SELFBOOT is the label of the cd, -duplicates-once burn duplicated files ony once, "-hide 0.0" hide a dummy file name 0.0 and the TOC of a first session data track(called data1.iso) is merged with the one being created by using "-M data1.iso". It's for data/data backup, it's actually taken from my selfboot data/data pack. I suggest you to read the selfboot.bat script to understand how to make good data/data backups.

    PS: I should be making a FULL 32bits version of my selfboot pack once I have time! It shouldn't be hard now that I made a 32bits binhack clone!

    FG
     
    Last edited: Nov 1, 2011
  7. zouzzz

    zouzzz Site Supporter 2013

    Joined:
    Mar 24, 2008
    Messages:
    362
    Likes Received:
    56
    Thanks FG
     
  8. RaZiel

    RaZiel Enthusiastic Member

    Joined:
    Oct 30, 2008
    Messages:
    541
    Likes Received:
    85
    Thanks alot that makes sense I am going to have a deeper look inside.
     
  9. SiZiOUS

    SiZiOUS Spirited Member

    Joined:
    Mar 26, 2009
    Messages:
    118
    Likes Received:
    166
  10. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    This is just a (2 years!) bump to say that binhack32 is now on sourceforge and released under GPLv3: https://sourceforge.net/projects/binhack32/
    Get the sourcecode this way: git clone git://git.code.sf.net/p/binhack32/code binhack32-code

    First post edited with more infos.

    FG
     
    Last edited: Jul 14, 2014
  11. darcagn

    darcagn Site Supporter 2013, Site Supporter 2014

    Joined:
    May 12, 2007
    Messages:
    529
    Likes Received:
    246
    Doesn't compile on OS X - needs 2 things first:

    1. obj directory needs to be created before running ./make_linux or you'll get the following error:
    2. UPX doesn't support OS X, it throws an error at this point but of course it's already successfully compiled the binary at that point. You can get rid of the error message if you remove this line from the Makefile:
    The executable is only 49KB anyway so it's not like UPX is really needed.

    Here's the binary for OS X. Keep in mind it's an x86_64 binary not an i386 binary.

    http://dcemulation.org/files/needed/binhack32_1.0.0.4-x86_64-MacOSX.gz
     
  12. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    The missing obj folder is a mistake, I think git doesn't clone empty directories and I'm not used to it yet. I added an osx option in the makefile that skips upx. I also put your compiled binary in the repository, as osx/binhack64.

    The release with updated sourcecode and binaries (win32, linux32, linux64 and osx64) is now there: http://sourceforge.net/projects/binhack32/files/binhack32-1005-release.zip/download

    Thanks!
     
    Last edited: Jul 14, 2014
  13. darcagn

    darcagn Site Supporter 2013, Site Supporter 2014

    Joined:
    May 12, 2007
    Messages:
    529
    Likes Received:
    246
    Awesome! :D And thanks for releasing the source!
     
  14. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    You're welcome! Feel free to link to on dumpcast or elsewhere as you see fit.

    It was already open-source since 1.0.0.3 (so since 2011) but I only recently put in on sourceforge for better accessibility. The only reason it wasn't open-source before is because it was shamefully ugly. Sizious gladly helped me clean the code and pretty it up in late 2010.

    I'm also working on an open-source python library for hacking bootbins and bootsectors (also serves as a hopefully great documentation source on Dreamcast hacks), but it's not quite ready yet!
     
    Last edited: Jul 14, 2014
  15. yzb37859365

    yzb37859365 Spirited Member

    Joined:
    Jul 14, 2013
    Messages:
    187
    Likes Received:
    124
    Very good program, thank you for sharing ^_^
     
  16. ramparts

    ramparts Member

    Joined:
    Feb 11, 2015
    Messages:
    16
    Likes Received:
    0
    Does anyone knows a good lba value for binhack32 for making sdiso´s ??'

    Regards
     
  17. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,033
    Likes Received:
    891
    You should ask SWAT. I don't know much about modern sdiso, but the old one had to be at lba 0.

    There is no difference for any LBA from the binhack point of view, it's a matter of being compatible with your application, sdiso in your case.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page