Want to Join Us ?

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

Research ida mbn/sbl loader (relocation table help)

Discussion in 'Loaders' started by Surge1223, Oct 3, 2015.

Share This Page

?

What version of loaders do you prefer?

  1. Winblows (ldr)

    42.9%
  2. Mac - sheep4lyfe (.pmc)

    0 vote(s)
    0.0%
  3. Linux - (.llx)

    0 vote(s)
    0.0%
  4. Python/IDC (.py/.idc)

    57.1%
  1. Surge1223

    Member

    Hey all, I have been writing a loader to load mbn, sbl, and in some cases bin files. I have written it in both. C+ and python, the python version should be loadable universally given that you have ida python installed correctly. I don't have an ida version for Mac to test on, although if someone wants to test it on a mac version I have successfully made the makefile to make both Linux (.llx?) and Mac (.pmc) versions from within the Mac or Linux env. And of course the visual Studio version, (I have vs 2013, sorry 2008, 2010 folks)

    Now this isn't labeled release because I'm having a issue with the relocation table. Note the loader loads the mbn/sbl successfully and at the right address and offsets, however the data, bss, rodata, text, and text . boot sections do not load at the right addresses (though ironically for some reason .bss does) Also the other mbn/sbl loaders out there don't do this correctly, although a guy named Ralekdev seems like he probably almost had it with his loader.

    Luckily for me I have someone that "may or may not be directly affiliated with making mbn/sbl bootloaders for a company i wish to keep private" and he/she isn't helping directly but is nice enough to let me know that the addresses for the relocation segments are incorrect (except for bss)

    Sorry for writing a diary here but I figure id open this up to any ideas or if anyone can see/know of a way we can maybe just randomly search and mark until we match some heuristic to determine the segments correctly. On arm the B instructions are basically godsend because they always occur. Just thinking out load and will gladly take suggestions.

    Ill attach the python loader first and soon the CPP versions as well (the CPP version is a bit behind since I find it easier to add/test with python script instead since I don't have to compile everytime to test.

    Thanks!
     
    hypnz, Rip Cord and storm shadow like this.
  2. Nihilus

    Well-Known Member Developer

    Well try creating a github repository as well.
     
  3. Surge1223

    Member

    Oh derp I didn't attach lol. Anyways here's where I'm at. I'll put it on my git tonight as well.

    https://github.com/Surge1223
     

    Attached Files:

    storm shadow likes this.
  4. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    Here is the windows one.
    Think it loads okay, even if im no c++ expert.

    I also looked at the python one.
    The test file you gave dosent create the segments data, bss, rodata, text, and text . boot.

    Only Code shows up here.


    Also a Reanalyze is always good after loader is loaded.
    Giving a ekstra pass.Finding more functions

    Code (Python):
    sEA = 0x0
    eEA = MaxEA()
    analyze_area(sEA, eEA)
     

    Attached Files:

    Last edited: Oct 4, 2015
    Rip Cord and Surge1223 like this.
  5. Surge1223

    Member

    I have been busy but lately I found some free time, so I went ahead and uploaded to git. Also I made quite a few changes in the CPP source and then some minor spacing and readme additions.

    Source can be found here
     
Top