Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Reader of binary serialized Type Language Schema
This code has not been tested sufficiently. It's a rewritten version of original reader in C++. If you are going to use this for code generation, please do additional tests. Recheck my implementation for errors and so on.
The Type Language (TL) was invented many years ago. It was originally used in VK, and now in Telegram. The creators of this language invented and wrote all the necessary tools to work with it. For example, a parser of the language and its binary format for serialization was developed.
To work with TL Schemes using OOP. To generate the client MTProto code using official TL parsers and binary formats.
Many Open Source MTProto client use their own implementation of parsers, which are not ultimatum. They are hardcoded for their minimal task.
Hardcode is not the way of Telegram. Official Telegram's Open Source projects take the right approach. So, for example, tdlib generates several interfaces for different languages and this is how it looks:
Raw TL Schema -> Tl Parser -> binary TL Object -> TLO reader -> code generator.
Step name | Description |
---|---|
Raw TL Schema | Can be founded here and in official Telegram repositories of client (tdesktop/Telegram/Resources/tl, tdlib/generate/scheme). |
Tl Parser | Official TL parser written in C++. Now it's a part of tdlib/td/generate/tl-parser. In the input it takes raw TL schema file. The output is TLO file. |
binary TL Object | The output of Tl Parser. |
TLO reader | This repository contains implementation of it in Python and JavaScript. Reader of binary file. Provide access to combinators, types, functions, arguments and so on via Object Oriented Programming. |
code generator | Any code generator. In tdlib/td/generate there is generator for C++, JNI, .NET and JSON interfaces. |
pip install tlo
npm install tlo
You can find TLO files for tests here.
from tlo import read_tl_config_from_file, read_tl_config
# use read_tl_config(data) to pass bytes directly
config = read_tl_config_from_file('td_api.tlo')
import {read_tl_config_from_file, read_tl_config} from 'tlo';
// use read_tl_config(data) to pass bytes directly
const config = read_tl_config_from_file('td_api.tlo')
MIT License
FAQs
Reader of binary serialized Type Language Schema
We found that tlo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.