Ami Aptio firmware (UEFI) dsdt firmware mod

Discussion in 'BIOS Mods' started by XpamAmAdEuS, Aug 13, 2013.

  1. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    I would like to replace build in dsdt table with my own.
    I need guide how to do it right way.
    I have modified dsdt.aml
    Any good soul willing to help me with that.
    I have try to do it with PhoenixTool and mmtool.
    mmtool dont wanna replace my modified AmiBoardinfo ffs with an error,even when i change a single byte using hexeditor.
    phoenixtool gave me a brick with a black screen and no post after replacing original file wich contains dsdt table with my modified.
    i dont know what i am doing wrong

    I dont wanna to someone do it for me but wanna to learn how to do it with phoenixtool.

    thx!
     
  2. nexus76

    nexus76 MDL Addicted

    Jan 25, 2009
    783
    296
    30
    upload

    hello XpamAmAdEuS,

    please upload both, your actual bios dump plus DSDT.aml
    maybe we can help
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    Here are all files

    I share what i try for now...
    First try wass to extract dsdt from firmware using mmtool and i found my dsdt table in here
    [​IMG]

    Then using hex editor i found where it start and where it ends in this file..
    Start
    [​IMG]
    End
    [​IMG]
    then i try to replace this region with my fixed dsdt data.
    next when try to replace this using mmtool i always get this error
    [​IMG]
    next i try to replace single data p=P in this file and again try to replace and its same error.

    No mmtool for doing this...

    next i try to replace dsdt with phoenixtool with various options and my bios always get bricked...
     
  4. fr40

    fr40 MDL Member

    Aug 21, 2007
    156
    55
    10
  5. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    Sry man but u have not understand theme of this topic...
    I have perfectly running system with even more perfect dsdt but wanna advance to next level and integrate fixed dsdt into bios...:worthy:
     
  6. LatinMcG

    LatinMcG Bios Borker

    Feb 27, 2011
    5,263
    1,422
    180
    #6 LatinMcG, Aug 14, 2013
    Last edited: Aug 22, 2013
    how do u have both modded and fixed in 1 .aml file ??
    is bios original or already modded ?

    use phoenix tool .. dsdt mod button.. check allow user to modify dsdt.
    go to DUMP folder and replace the dsdt.

    heres a post by kizwan in notebookforum
    http://forum.notebookreview.com/acer/480992-acer-laptop-phoenix-bios-bios-mod-request-116-print.html


    this is for os x .. it does partially apply but not to flash.. also if his dsdt was compiled by msasl not intel asl he will have issues.. he needs to use msasl likely.

    dsdt is used by a bootloader for apple os x hackintosh like chameleon 2. and bypasses the on bios dsdt and its not flashed aka reintegrated to bios to flash with USB flashback method on asus compatible boards.
     
  7. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    sry for my bad english.
    My dsdt.aml file its modded for OSX and have fixed all errors in it.
    Its modded using intel iasl 5 latest version.
    I have original bios and modded one with added some drivers for hfs support and other drivers we need to use with clover uefi.
    If u think if i mod it with slic then no i dont need slic.
    Clover can inject slic if i need it without bios moddings btw.
    U can see here what i try to do.
    http://www.projectosx.com/forum/index.php?showtopic=3018&st=0
    My goal its to have perfectly modded UEFI firmware for using with Clover UEFI and i have added many drivers for this soo i think i am on right way :cool:


    could u plz explain more how to do this.
    "go to DUMP folder and replace the dsdt."
    I have try this but i seems i am doing it wrong.
     
  8. LatinMcG

    LatinMcG Bios Borker

    Feb 27, 2011
    5,263
    1,422
    180
    #8 LatinMcG, Aug 15, 2013
    Last edited: Aug 15, 2013
    in phoenix tool click advanced then click dsdt options. check box allow user modify dsdt.
    add slic and it will let u change dsdt in DUMP folder of bios folder.
    if u add dsdt that doesnt work properly with windows it wont let u use some devices possibly.

    might have to add code
    if _OSI windows 2009
    return this values for windows 2009 aka windows 7
    else
    osx return code instead.
     
  9. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    #9 XpamAmAdEuS, Aug 15, 2013
    Last edited: Aug 15, 2013
    (OP)
    Sry man but i dont get dsdt in dump folder never.
    I only have module thats contains dsdt and its called 9F3A0016-AE55-4288-829D-D22FD344C347_1_47.rom
    When i hexedit this file then i get black screen after flashing this kind of bios.
    I have some success with changing dsdt like this but only when my new dsdt its same size like old one.
    i would like to insert much smaller from my first post.
    Could u plz try to do it for me since i have failed more than 10 times...

    main problem with this as i see it its that phoenixtool change 9F3A0016-AE55-4288-829D-D22FD344C347_1_47.rom after my edits with own or something ?
    This file become totally diferent from what i make....
     
  10. LatinMcG

    LatinMcG Bios Borker

    Feb 27, 2011
    5,263
    1,422
    180
    #10 LatinMcG, Aug 15, 2013
    Last edited by a moderator: Apr 20, 2017
    ahh i see why its not workign. needs to be done from Structure button.
    decompress extracted the module and im able to see the dsdt... just not sure of the ending (might need original dsdt.aml extracted to see end)
    Code:
    B_PCI0LPCBSIOWh.....÷øôæ’I²Gƒ.….t^J#¶s."Ûk.D„.¹t±.aš.ÿ......³.è|×KyF‡¨¨ØÞå.+..W*fIöG‹†ó.Aó/.Lò9wדÔ.š:..'?ÁMÿÿÿÿ....... DEBUG BUFFER OVERFLOW!!!........€.Ñ’oI•M¾~.tˆ8+.............................EFI_LOAD_ERROR...........EFI_INVALID_PARAMETER....EFI_UNSUPPORTED..........EFI_BAD_BUFFER_SIZE......EFI_BUFFER_TOO_SMALL.....EFI_NOT_READY............EFI_DEVICE_ERROR.........EFI_WRITE_PROTECTED......EFI_OUT_OF_RESOURCES.....EFI_VOLUME_CORRUPTED.....EFI_VOLUME_FULL..........EFI_NO_MEDIA.............EFI_MEDIA_CHANGED........EFI_NOT_FOUND............EFI_ACCESS_DENIED........EFI_NO_RESPONSE..........EFI_NO_MAPPING...........EFI_TIMEOUT..............EFI_NOT_STARTED..........EFI_ALREADY_STARTED......EFI_ABORTED..............EFI_ICMP_ERROR...........EFI_TFTP_ERROR...........EFI_PROTOCOL_ERROR.......EFI_INCOMPATIBLE_VERSION.EFI_SECURITY_VIOLATION...EFI_CRC_ERROR............EFI_END_OF_MEDIA.........EFI_UNDEFINED_29.........EFI_UNDEFINED_30.........EFI_END_OF_FILE..........EFI_INVALID_LANGUAGE.....EFI_COMPROMISED_DATA............EFI_INTERRUPT_PENDING....EFI_REQUEST_UNLOAD_IMAGE.EFI_NOT_AVAILABLE_YET.........EFI_DBE_EOF..............EFI_DBE_BOF............................EFI_WARN_UNKNOWN_GLYPH....EFI_WARN_DELETE_FAILURE...EFI_WARN_WRITE_FAILURE....EFI_WARN_BUFFER_TOO_SMALL.ˆ..€....EFI_WARN_INTERRUPT_SOURCE_PENDING..EFI_WARN_INTERRUPT_SOURCE_QUIESCED...Status Code.............˜..€....€..€......*ÿ......*ÿ................,...¡1.[b•Ò.Ž?.*Éir;........................................................................................................................................................................À©...À......8¤*¤¨¤......ñ...÷øôæ’I²Gƒ.….t^J#$PIR..Ò..........................øixÜcxÜbxÜ`xÜ...*`xÜ............èkxÜcxÜ`xÜbxÜ...Ð`xÜixÜbxÜcxÜ...ØjxÜ............°`xÜcxÜbxÜaxÜ...à`xÜaxÜbxÜcxÜ....`xÜaxÜbxÜcxÜ!...axÜbxÜcxÜ`xÜ"...bxÜcxÜ`xÜaxÜ....cxÜ`xÜaxÜbxÜ....`xÜaxÜbxÜcxÜ....axÜbxÜcxÜ`xÜ....bxÜcxÜ`xÜaxÜ....cxÜ`xÜaxÜbxÜ....cxÜbxÜ`xÜhxÜ....`xÜaxÜbxÜcxÜ...0cxÜ`xÜaxÜbxÜ....`xÜaxÜbxÜcxÜ....axÜbxÜcxÜ`xÜ....bxÜcxÜ`xÜaxÜ....cxÜ`xÜaxÜbxÜ....`xÜ............ `xÜaxÜbxÜcxÜ.. .`xÜ.........!...`xÜaxÜbxÜcxÜ...ÈhxÜ...........¸Þ..............$XLT‘....ðÿPCI1....àÿRP01....áÿRP02....âÿRP03....ãÿRP04....äÿRP05....åÿRP06....æÿRP07....çÿRP08....ÿPCI0.....ÿPEG0.....ÿPEG1.....ÿPEG2....0ÿPEG3................$AIR..I................................................................................................................................................................................................................................................................................................. .......................................$APD....Àþ..........A.m.i.B.o.a.r.d.I.n.f.o.....
    anyways theres a replace button there u can replace the module with the modded module of dsdt.
    then check the box to compress inserted/replaced module. (but i get some error with jit compiler bla bla.. andyp might be of help)
    im not 100% sure of this one because all dsdt mods ive done are non EFI
     
  11. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    #11 XpamAmAdEuS, Aug 18, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    i post start and end in this topic already.
    i already try this method before but have same jit error as you.:confused:
     
  12. andyp

    andyp SLIC Tools Author

    Aug 8, 2008
    1,671
    2,433
    60
    Could you retry with 2.16
    If still fails post a screenshot, instructions of what you were doing exactly, and the relevant BIOSes/modules I need to reproduce.
    Thanks
    Andy

     
  13. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    #13 XpamAmAdEuS, Aug 19, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Phoenix Tool 2.16
    1.) open this bios file.
    [​IMG]

    2.)
    i choose only this option
    [​IMG]

    3.)After this i go to EFI structure and choose this file and choose extract.
    [​IMG]

    4.)After extract i copy this file from root of modding folder to desktop.

    5.)I hex edit this file using 010 editor and delete original dsdt and after this insert dsdt.aml in same place as original dsdt. and then i get new modded file.
    [​IMG]

    When i finish modding this file then i choose replace in EFI structure and i get this error.[​IMG]
    Code:
    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    
    ************** Exception Text **************
    System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
       at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
       at Phoenix.EFI.ScanSubModules(Byte[]& sBIOS, UInt32[,]& lModules, Byte[]& sBuffer, UInt32 lModule, UInt32 lOffset, UInt32 iCommand, Boolean bReplace, String sDumpPath, Boolean bNoHeader, UInt32& lCount, Boolean bVerbose)
       at Phoenix.EFI.CopyModuleEFI(String[]& sNames, String[]& sModuleNames, UInt32[,]& lModules, String sName, String sDumpPath, Boolean bAlreadyCompressed, Boolean bHeader, Boolean bDelete, Boolean bSkipScan, UInt32 lParentModule, UInt32 lSubModule)
       at Phoenix.frmTree.cmdReplace_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5737 (QFE.050727-5700)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    PhoenixTool
        Assembly Version: 2.1.6.0
        Win32 Version: 2.1.6.0
        CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Desktop/phoenixtool216/PhoenixTool.exe
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.4463 (QFE.050727-4400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5740 (QFE.050727-5700)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.7015 (QFE.050727-7000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5740 (QFE.050727-5700)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Runtime.Remoting
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4056 (QFE.050727-4000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4425 (QFE.050727-4400)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    SevenZipSharp
        Assembly Version: 0.64.3890.29348
        Win32 Version: 0.64.3890.29348
        CodeBase: file:///C:/Documents%20and%20Settings/Administrator/Desktop/phoenixtool216/SevenZipSharp.DLL
    ----------------------------------------
    Accessibility
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    
    For example:
    
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    
    
    
    :confused:
     
  14. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    i try 2.17 and 2.18 and its still same error.
     
  15. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    10,938
    10,473
    340
    #15 Yen, Aug 21, 2013
    Last edited: Aug 21, 2013
    This won't fix the error, but make Phoenixtool to perform what you want.
    Load the EFI, choose manufacturer: other.
    At advanced tick no SLIC and tick allow user to modify other modules.

    Press go. The tool pauses. You find all the extracted modules in the DUMP folder. Do your modifications with the hexeditor right in the dump folder EXCHANGE the DSDT there. Your DSDT has become shorter from B57Bh to B066h bytes length. The right module should have an index 1 such like 9F3A0016-AE55-4288-829D-D22FD344C347_1_XX.ROM. Do not change its name in the folder, just its data!

    After you have done the modifications hit OK. The tool should detect the changes, replace the original module and repack the EFI just fine. It worked for me when I needed to modify own modules.
    The issue at andy's tool must be somewhere else at the tree view code branch....I guess.


    The contents are different the DUMP indexed file compared to the extracted module...means 9F3A0016-AE55-4288-829D-D22FD344C347.MOD(original).MOD uploaded by the OP is different compared to 9F3A0016-AE55-4288-829D-D22FD344C347_1_47.ROM in the DUMP folder.

    Andy, why is that? It seems to match the MMTOOL APTIO module extracted code, though. I assume the index file at the dump folder contains not the entire module code...

    @OP: So you have to go my way from scratch and DO NOT replace the entire module, the original seems to be different when extracted from tree view, just exchange the DSDT as you did before directly at 9F3A0016-AE55-4288-829D-D22FD344C347_1_47.ROM in the DUMP folder while the tool waits...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    Thx i already try to do just as u say but something its not right.
    My modified .rom file get changet after phoenix tool do its job.
    Its not the same file as i hex edit it after phoenix make bios. file.
    After procedure u say mmtool cannot even open this kind of bios and it crash always.

    Could u plz help me with that and try it alone with files from first post.
    It would be really nice since i try it about 20-30 times without sucess. :worthy:
     
  17. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    10,938
    10,473
    340
    It works fine. I have replaced the DSDT Table exactly at original offset 9D4h. The remaining bytes from the original table I have zero'ed... BA3Ah-BF4Eh.

    Have a look and check it by yourself....
    http://www.sendspace.com/file/7nmdrl


    Do not flash it until you have checked it...and be sure you can recover in case of a bad flash...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. andyp

    andyp SLIC Tools Author

    Aug 8, 2008
    1,671
    2,433
    60
    #18 andyp, Aug 21, 2013
    Last edited: Aug 21, 2013
    Hi both,

    It is a bug and it isn't!

    I will try and explain.

    The treeview extracts a whole module including headers and submodule headers. When a module is replaced it expects the submodule headers to be correct. In this case the module - or more specifically the second submodule starting at 20h with the 4 byte submodule header of C1 C9 00 01 - where C9C1 is the size and 01 indicates it's compressed - has shrunk but you have not corrected this submodule header - this is causing the error. Likewise the compression header and the compressed (stored) submodules.

    Yen is right, the treeview code works only in complete modules. The SLIC modification code (and hence the files in DUMP when the EFI is first loaded) are submodule based - with filenames GUID_xxx_y.ROM - where xxx is an internal number and y is the submodule - in this case xxx_1 - the submodule header (and the next 9 bytes which are the compression header) are not written - it starts at byte 2Dh of the whole module and the (sub)module headers are regenerated at integration.

    This is really an artefact of the fact the tool was never really written with the treeview and complete freedom of module manipulation in mind, however from what I learnt from the AMI and Award tools the way it does it - basically deconstructing the EFI and reintegrating the bits that change, does lend itself to this - however its not perfect.

    I will add a check - its easy if the module shrinks, but more difficult if it grows especially if the submodule that grows has other submodules after it... the relative offsets would be all wrong in a way that is difficult to detect.

    Basically, for now, you will have to correct the sizes manually. Submodule manipulation from the treeview will take some time.

    Cheers
    Andy


     
  19. XpamAmAdEuS

    XpamAmAdEuS MDL Novice

    Oct 24, 2009
    46
    14
    0
    thx.
    i try it and it worked like a charm.
    really thx.
    I didnt correct sizes soo my work wass all wrong.
    thx again!
     
  20. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    10,938
    10,473
    340
    Great, it worked.
    Thanks Andy for the explanation. :)
    So if I have got this right another way would be:
    Go to tree view and tick decompress extracted modules. Then extract the module to be modified. Then exchange the DSDT table and fill the remaining space with zero bytes (same way to mod, start offset of DSDT different, though). Then tick compress inserted / replaced modules. Then hit replace, original ROM gets .OLD extension
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...