[Question] How to Interpret System.getFirmware()?

Discussion in '3DS - Homebrew Development and Emulators' started by legofan623, Oct 7, 2015.

  1. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    I have a LPP app that needs to know your firmware version for something. I ran System.getFirmware(), and it returned 36569088 for a 9.0.0 console... Is there a way to translate the output to a normal firmware version or vice versa, or is there documentation of this somewhere? I've attached an app to output your 'firmware version' below.
     

    Attached Files:

    Last edited by legofan623, Oct 7, 2015 - Reason: added zip
  2. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  3. lemanuel
    This message by lemanuel has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  4. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  5. legofan623
    This message by legofan623 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  6. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  7. legofan623
    This message by legofan623 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  8. lemanuel
    This message by lemanuel has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 7, 2015
  9. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  10. legofan623
    This message by legofan623 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015


  11. Helreizer543

    Helreizer543 Member

    Newcomer
    49
    23
    Nov 24, 2014
    United States
    this is the lpp-3ds authors code straight from the library itself:
    static int lua_getFW(lua_State *L)
    { int argc = lua_gettop(L);
    if (argc != 0) return luaL_error(L, "wrong number of arguments");
    u32 fw_id = osGetFirmVersion();
    lua_pushinteger(L,GET_VERSION_MAJOR(fw_id));
    lua_pushinteger(L,GET_VERSION_MINOR(fw_id));
    lua_pushinteger(L,GET_VERSION_REVISION(fw_id));
    return 3; }
    are you passing something into the function?
    cause it seem like you should be doing system.getFirmware(lua_State *L);
    and them printing L;

    but *disclaimer* I have not used lpp-3ds nor do I know lua. This information was gathered in a short amount of time.
    It is still worth trying :-)
     
  12. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  13. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    That's very strange, because the documentation says:

    u32 System.getFirmware(void) - Returns firmware version.

    Sample usage: fw_ver = System.getFirmware()

    So I don't think I should be passing anything into it?
     
  14. Helreizer543

    Helreizer543 Member

    Newcomer
    49
    23
    Nov 24, 2014
    United States
    what storage container are you using for fw_ver?
     
  15. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    I don't think lua actually uses different data types.
     
  16. Helreizer543

    Helreizer543 Member

    Newcomer
    49
    23
    Nov 24, 2014
    United States
    Looking into it I realize this is the attached program written by you?
     
  17. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    Yeah
     
  18. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,270
    Nov 24, 2014
    Italy
    Bologna
    Current Revision returns the ID for your firmware without major,minor,revision separation (and getKernel and getFirmware are switched cause an error on old libctru).
    The source ones is patched and will come with next release.
     
  19. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    So it's just a matter of waiting for the next release then?
     
  20. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,270
    Nov 24, 2014
    Italy
    Bologna
    You can also parse current returned value but it will be much more harder.
     
  21. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    Ok, I won't worry about it for now then. Thanks for the help :).
     
  22. WulfyStylez

    WulfyStylez SALT/Bemani Princess

    Member
    1,149
    2,609
    Nov 3, 2013
    United States
    36569088 == 0x022E0000, for the record. That's [02] [2E] [00] [00], or 2.46-0/9.0 FIRM according to the list of kernel versions here. Kernel versions like this are generally only useful for apps that need to be generally compatible with specific FIRM versions, rather than specific service/application versions.
     
  23. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    Perfect! I'll just write a base 16 to 10 converter into my app, and use that chart to determine the FW version. Thanks a ton!
     
    Last edited by legofan623, Oct 8, 2015
  24. DarkFlare69
    This message by DarkFlare69 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  25. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  26. legofan623
    This message by legofan623 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  27. DarkFlare69
    This message by DarkFlare69 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  28. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  29. DarkFlare69
    This message by DarkFlare69 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  30. GoodCookie88
    This message by GoodCookie88 has been removed from public view by Veho, Oct 8, 2015, Reason: Enough.
    Oct 8, 2015
  31. RednaxelaNnamtra

    RednaxelaNnamtra GBAtemp Advanced Fan

    Member
    748
    637
    Dec 8, 2011
    Germany
    If you check the firmware in this way, firmlaunch will break it. The best way is to check kernel and cver/nver I think. Yellows8 is checking it this way in his menuhax installer.
     
  32. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    Right after I finished the code... crap. What do you mean firmlaunch will break it? What I need to do essentially is determine "if <= 9.2 then true, otherwise false", would that work for various consoles, and give correct results based on what firmware the console is on?
     
  33. RednaxelaNnamtra

    RednaxelaNnamtra GBAtemp Advanced Fan

    Member
    748
    637
    Dec 8, 2011
    Germany
    It depends on for what you need to check it, to check if you can use libkhax you should check the kernel, if yo need to know which version of a module is installed for example you should check cver and nver.
     
  34. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    It's really just a test to see if you can run CFW (e.g, <= 9.2). Isn't that kernel?
     
  35. RednaxelaNnamtra

    RednaxelaNnamtra GBAtemp Advanced Fan

    Member
    748
    637
    Dec 8, 2011
    Germany
    Yes, for this the kernel version needs to be checkt, not the firmware version itself. Also if firmlaunch is active a direct cfw boot without reboot is not possible. So when checking the kernel your application will automaticaly say its not possible to use a cfw, if you use the application in cfws.
     
  36. legofan623
    OP

    legofan623 GBAtemp Fan

    Member
    418
    196
    Oct 3, 2011
    United States
    Puyallup, WA
    Interesting... Thank's for the help. I'll mess around with it on some different systems for the time being, but If it gets to complicated for me then oh well :wacko:. I guess If you're running a CFW and you run it

    EDIT: Yeah, you're right, I tested it on a 9.0.0 with themehax and it said yes, and then tried from a ninjhax .cia from rxTools and it said no. Is there any way to determine if a CFW is currently running on the system (in lpp3ds)?
     
    Last edited by legofan623, Oct 8, 2015
  37. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,270
    Nov 24, 2014
    Italy
    Bologna
    You can use System.checkBuild but don't know if R3 ones is good (i recently patched this function also in repository).