Welcome to fsapi-tools’ documentation!

This project comprises various tools written in Ppython3` that are designed to analyze properties of firmware binaries provided by Frontier Smart (formerly Frontier Silicon - FS) and interact with the inbuilt API.

Although there are other repositories that focus on the specific API, the implementation provided here includes ALL available nodes that were invented/developed by Frontier Smart.

Features:

  • ISUTool: An inspector for Frontier Smart firmware binaries.

  • Pattern Specification: Designed for ISU binaries to be used in ImHex.

  • Python3 FSAPI implementation.

  • XDR-Decompiler: For decompiling binary packed JavaScript files.

  • FSAPI-NET Tool: Enables interaction with Frontier Smart IoT devices.

Installation via pip
pip install fsapi-tools

Note

Please make sure to install all necessary dependencies before using this project.


Reference


Basic usage

ISU API
1from fsapi.isu import ISU
2from fsapi.isu.util import DataclassPrinter
3
4isu = ISU << "firmware.isu.bin"
5# load an ISUHeader object and print the loaded data
6pp = DataclassPrinter()
7pp.print_object(isu.header)
FSAPI
 1from fsapi.net import FSDevice, wrap
 2
 3# First, create the device:
 4device = FSDevice("127.0.0.1")
 5
 6# Create an API wrapper
 7api = wrap(device)
 8
 9# Fetch and change the friendly name of a device
10name = api.friendly_name
11api.fiendly_name = "FooBar"
12
13# Query an enum value. The value's name is bound to the returned value
14state = api.nav_state
15name = state.stringvalue
16
17# Iterate over a list of items
18for item in api.ls_nav_list(_pos=-1, max_items=10): # -1 for all (optional)
19   key = item["key"]
20   item_name = iem["name"]
21   # attriutes can be accessed directly with .attrib
22
23# Select an item in a list
24api.ls_nav_list = 2
Software update URL
 1from fsapi.netconfig import FSNetConfiguration
 2from fsapi.isu import isu_find_update, isu_new_url, isu_get_update
 3
 4# 1.Find and download updates
 5# without custom netconfig -> HTTPS traffic
 6response = isu_find_update('$MAC', '$CUSTOM', '$VERSION')
 7
 8# with custom config -> force HTTP traffic
 9config = FSNetConfiguration(http_pool=urllib3.HTTPConnectionPool('$HOST'))
10response = isu_find_update('$MAC', '$CUSTOM', '$VERSION', netconfig=config)
11
12# without custom netconfig -> HTTPS traffic
13response = isu_find_update('$MAC', '$CUSTOM', '$VERSION')
14for _software in response['updates']:
15   isu_get_update('$FILE_PATH', software=_software)

Indices and tables