def METHOD_NAME (ifwi_in, ifwi_out, sbl_in, platform_data):
    ifwi_data   = bytearray (get_file_data (ifwi_in))
    ifwi_parser = IFWI_PARSER ()
    ifwi = ifwi_parser.parse_ifwi_binary (ifwi_data)
    if not ifwi:
        print ("Invalid IFWI input image!")
        return -1
    # update bios region
    bios = ifwi_parser.locate_component (ifwi, 'IFWI/BIOS')
    if not bios:
        print ("Cound not find BIOS region!")
        return -2
    bios_data = bytearray (get_file_data (sbl_in))
    bios_data = add_platform_data (bios_data, platform_data)
    if not bios_data:
        print ("Failed to parse BIOS image!")
        return -3
    padding  = bios.length - len(bios_data)
    if padding < 0:
        print ("BIOS image is too big to fit into BIOS region!")
        return -4
    bios_data = b'\xff' * padding + bios_data
    ret = ifwi_parser.replace_component (ifwi_data, bios_data, 'IFWI/BIOS')
    if ret != 0:
        print ("Failed to replace BIOS region!")
        return -5
    # create new ifwi
    print("Creating IFWI image ...")
    if ifwi_out == '':
        ifwi_out = ifwi_in
    gen_file_from_object (ifwi_out, ifwi_data)
    print ('done!')