{"id":478591,"date":"2026-05-05T07:15:45","date_gmt":"2026-05-05T07:15:45","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=478591"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=478591","title":{"rendered":"\u041d\u0435 \u0443\u0433\u043e\u0434\u0438\u043b\u0438 \u00ab\u041b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u043e\u0433\u043e\u00bb: \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Telegram \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0430 ZentrySpace \u0432\u043e \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0435 \u041f\u041e"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u043c\u044b \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e ZentrySpace \u0441\u00a0Telegram, \u043a\u0430\u043a\u00a0\u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u043e, \u043a\u00a0\u0447\u0435\u043c\u0443 \u043d\u0430\u0441 \u0436\u0438\u0437\u043d\u044c \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u00a0\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0430\u00a0\u2014 \u0437\u043b\u043e\u0432\u0435\u0449\u0435\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0443\u00a0\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 \u00ab\u041b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u043e\u0433\u043e\u00bb \u043e\u00a0\u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u0440\u043e\u044f\u043d\u0430 \u0432\u00a0\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041f\u043e\u00a0\u043c\u043e\u0442\u0438\u0432\u0430\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u0432\u00a0Telegram, \u0432\u00a0\u0431\u043e\u0440\u044c\u0431\u0435 \u0441\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u0438\u0439 \u043f\u0440\u0435\u0443\u0441\u043f\u0435\u043b, \u043d\u0430\u0448\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u00a0\u0436\u0435, \u043d\u0430\u0441\u0442\u043e\u0440\u043e\u0436\u0438\u043b\u0438\u0441\u044c. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0438\u0438 \u043e\u0442\u0437\u044b\u0432\u043e\u0432 \u043e\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0ZentrySpace \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0436\u0435 \u043c\u043e\u0433\u043b\u043e \u043f\u043e\u0439\u0442\u0438 \u043d\u0435\u00a0\u0442\u0430\u043a. <\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p><span class=\"habrahidden\">\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u0434\u0430\u0436\u0435 Telegram Desktop \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 false positives \u043e\u0442 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u0432. \u041c\u044b \u043a \u043d\u0435\u043c\u0443 \u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043b\u0438\u0441\u044c.<\/span> <\/p>\n<\/div>\n<\/details>\n<p><strong>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442: \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0438 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438<\/strong><\/p>\n<p>ZentrySpace \u2014 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Electron (TypeScript + React). \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Telegram \u0447\u0435\u0440\u0435\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>TDLib<\/strong> (Telegram Database Library) \u2014 \u0442\u0443 \u0441\u0430\u043c\u0443\u044e, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Telegram Desktop. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439 \u0438\u0437 Node.js \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 <code>tdl<\/code>.<\/p>\n<p>TDLib \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443: <code>tdjson.dll<\/code> \u043d\u0430 Windows, <code>libtdjson.dylib<\/code> \u043d\u0430 macOS, <code>libtdjson.so<\/code> \u043d\u0430 Linux. \u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u2014 \u043e\u043a\u043e\u043b\u043e 30 \u041c\u0411.<\/p>\n<p><strong>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430: \u043a\u0430\u043a TDLib \u0436\u0438\u0432\u0451\u0442 \u0432 Electron-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/strong><\/p>\n<p>Electron-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041a\u0440\u0430\u0442\u043a\u043e:<\/p>\n<ol>\n<li>\n<p><strong>Main process<\/strong> \u2014 Node.js, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043a\u043d\u0430\u043c\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 API, \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0424\u0421<\/p>\n<\/li>\n<li>\n<p><strong>Renderer process<\/strong> \u2014 Chromium, \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 UI, \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Utility process<\/strong> \u2014 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Node.js-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0442\u044f\u0436\u0451\u043b\u044b\u0445\/\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 TDLib \u043f\u0440\u044f\u043c\u043e \u0432 <strong>main process<\/strong>. \u042d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p><strong>\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: TDLib \u0432 main process<\/strong><\/p>\n<p>\u0412\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u043c \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>\/\/ main.tsfunction getTdjsonFileName(): string {  switch (process.platform) {    case 'darwin': return 'libtdjson.dylib';    case 'win32':  return 'tdjson.dll';    case 'linux':  return 'libtdjson.so';    default:       return 'libtdjson.so';  }}function resolveTdjsonPath(): string | null {  if (app.isPackaged) {    \/\/ Production: \u0431\u0435\u0440\u0451\u043c \u0438\u0437 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f    return path.join(process.resourcesPath, 'tdlib', getTdjsonFileName());  }  \/\/ Development: \u0431\u0435\u0440\u0451\u043c \u0438\u0437 vendor\/  const platform = process.platform;  const arch = process.arch;  let subDir: string | null = null;  if (platform === 'darwin') {    subDir = arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';  } else if (platform === 'win32') {    subDir = arch === 'ia32' ? 'win32-ia32' : 'win32-x64';  } else if (platform === 'linux') {    subDir = arch === 'arm64' ? 'linux-arm64' : 'linux-x64';  }  if (!subDir) return null;  return path.join(app.getAppPath(), 'vendor', 'tdlib', subDir, getTdjsonFileName());}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <\/strong><code>initializeExternalInstances()<\/code><strong>:<\/strong><\/p>\n<pre><code>private initializeExternalInstances() {  const userDataPath = path.join(app.getPath('userData'), 'telegram');  const tdjsonPath = resolveTdjsonPath();  this.telegramService = new ElectronTdLibClientService({    dbBaseDir: userDataPath,    tdjsonPath: tdjsonPath ?? undefined  });}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0421\u0430\u043c <\/strong><code>ElectronTdLibClientService<\/code><strong> \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <\/strong><code>init(accountId)<\/code><strong> \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b <\/strong><code>tdl<\/code><strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b TDLib-\u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 main process:<\/strong><\/p>\n<pre><code>\/\/ \u0421\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f ElectronTdLibClientServiceimport * as tdl from 'tdl'private async configureTdLibOnce(): Promise&lt;void&gt; {  if (this.configured) return;  tdl.configure({ tdjson: this.options.tdjsonPath, verbosityLevel: 1 });  this.configured = true;}async init(accountId: string): Promise&lt;void&gt; {  await this.configureTdLibOnce();  const dbDir = path.join(this.dbBaseDir, accountId);  const client = tdl.createClient({    apiId: Number(TG_API_ID),    apiHash: TG_API_HASH,    databaseDirectory: dbDir,    filesDirectory: path.join(dbDir, 'files'),    tdlibParameters: {      use_message_database: true,      use_chat_info_database: true,      system_language_code: 'en',      device_model: 'Zentry Desktop',      application_version: '1.0.0',    },  });  client.on('update', (update) =&gt; {    this.emit('update', { type: 'raw-tdlib-update', payload: update });  });  this.clients.set(accountId, client);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>Handlers \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0438\u0441\u044c \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 <\/strong><code>TelegramClientContext<\/code><strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0445 \u043e\u0442 \u043f\u0440\u044f\u043c\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 <\/strong><code>tdl<\/code><strong>:<\/strong><\/p>\n<pre><code>\/\/ handlers\/TelegramClientContext.tsinterface TelegramClientContext {  getClient(): Promise&lt;TdClientLike&gt;;  readonly service: ElectronTdLibClientService;  readonly accountId: string;}\/\/ \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 TelegramAuthHandler.tsasync getAuthState(ctx: TelegramClientContext) {  const client = await ctx.getClient();  return client.invoke({ _: 'getAuthorizationState' });}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>client.invoke()<\/code> \u2014 \u0431\u043e\u043b\u0435\u0435 30 \u0448\u0442\u0443\u043a: \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0442\u043e\u0432, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u0435\u0434\u0438\u0430, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0442.\u0434. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 main process.<\/p>\n<p><strong>\u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u0438\u0439 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b \u0438 \u043f\u043e\u0447\u0435\u043c\u0443<\/strong><\/p>\n<p>\u0414\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code><strong>PDM:Trojan.Win32.Generic<\/strong><\/code> \u2014 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f <strong>PDM (Proactive Defense Module)<\/strong>. \u042d\u0442\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u043e: PDM \u2014 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041e\u043d \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0438 \u043d\u0435 \u043d\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u0430 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 <em>\u0434\u0435\u043b\u0430\u0435\u0442<\/em> \u0432 runtime.<\/p>\n<p>\u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 TDLib \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>LoadLibraryW<\/code> \u043d\u0430 <code>tdjson.dll<\/code> \u0438\u0437 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (<code>resources\/tdlib\/<\/code>)<\/p>\n<\/li>\n<li>\n<p>DLL \u0441\u043e\u0437\u0434\u0430\u0451\u0442 SQLite-\u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 <code>%AppData%\\ZentrySpace\\telegram\\{accountId}\\<\/code><\/p>\n<\/li>\n<li>\n<p>DLL \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 Telegram (MTProto-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 1\u20132 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0435\u043d \u0434\u043b\u044f \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u0422\u0440\u043e\u044f\u043d\u043e\u0432: \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c DLL \u2192 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 AppData \u2192 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0441 C2-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. PDM \u0432\u0438\u0434\u0438\u0442 \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u2014 \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u043f\u043b\u043e\u0445\u043e\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0442\u043b\u0438\u0447\u0438\u043c\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0422\u0440\u043e\u044f\u043d\u0430.<\/p>\n<p><strong>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439: TDLib \u0432 Utility Process<\/strong><\/p>\n<p>\u041c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e main process \u2014 \u00ab\u0441\u0435\u0440\u0434\u0446\u0435\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e DLL \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0442\u044c. Electron \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u2014 <strong>Utility Process<\/strong>: \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 Node.js-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u0435\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a UI-API.<\/p>\n<p>\u0418\u0434\u0435\u044f: \u0432\u044b\u043d\u0435\u0441\u0442\u0438 TDLib \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 worker, \u0430 \u0432 main process \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e IPC-\u043f\u0440\u043e\u043a\u0441\u0438.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 <code>tdlib-worker.ts<\/code> \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:<\/p>\n<pre><code>\/\/ telegram\/tdlib-worker.tslet tdl: typeof import('tdl') | null = null;\/\/ \u041b\u0435\u043d\u0438\u0432\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u2014 tdl \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 'configure'async function loadTdl(): Promise&lt;typeof import('tdl')&gt; {  if (!tdl) tdl = await import('tdl');  return tdl;}const clients = new Map&lt;string, any&gt;();let configured = false;const parentPort = process.parentPort!;\/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c TDLib \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443async function handleConfigure(msg: { tdjsonPath: string; verbosity: number }) {  if (configured) { send({ type: 'configured' }); return; }  const lib = await loadTdl();  lib.configure({ tdjson: msg.tdjsonPath, verbosityLevel: msg.verbosity });  configured = true;  send({ type: 'configured' });}\/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c TDLib-\u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430async function handleCreateClient(msg: { accountId: string; apiId: number; apiHash: string;  databaseDirectory: string; filesDirectory: string; useTestDc: boolean; tdlibParameters: any }) {  const lib = await loadTdl();  const client = lib.createClient({    apiId: msg.apiId,    apiHash: msg.apiHash,    databaseDirectory: msg.databaseDirectory,    filesDirectory: msg.filesDirectory,    useTestDc: msg.useTestDc,    tdlibParameters: msg.tdlibParameters,  });  \/\/ \u0412\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0432 main process \u0447\u0435\u0440\u0435\u0437 IPC  client.on('update', (update: any) =&gt; {    send({ type: 'update', accountId: msg.accountId, payload: update });  });  clients.set(msg.accountId, client);  send({ type: 'client-created', accountId: msg.accountId });}\/\/ \u041f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c invoke()-\u0432\u044b\u0437\u043e\u0432\u044b \u043a TDLib APIasync function handleInvoke(msg: { id: string; accountId: string; params: any }) {  const client = clients.get(msg.accountId);  try {    const result = await client.invoke(msg.params);    send({ type: 'invoke-result', id: msg.id, result });  } catch (err) {    send({ type: 'invoke-error', id: msg.id, error: String(err) });  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0412 main process <\/strong><code>ElectronTdLibClientService<\/code><strong> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0432\u043e\u0440\u043a\u0435\u0440\u0430 \u0441 proxy-\u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c:<\/strong><\/p>\n<pre><code>\/\/ ElectronTdLibClientService.ts (\u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f)import { utilityProcess, type UtilityProcess } from 'electron\/main';export class ElectronTdLibClientService extends EventEmitter {  private worker: UtilityProcess | null = null;  private ensureWorker(): void {    if (this.worker) return;    const workerPath = path.join(__dirname, 'tdlib-worker.js');    \/\/ \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c TDLib \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c utility process    this.worker = utilityProcess.fork(workerPath);    this.worker.on('message', (msg) =&gt; this.handleWorkerMessage(msg));    this.worker.on('exit', (code) =&gt; {      console.error('[TDLib Worker] exited with code', code);      this.worker = null;      \/\/ \u041e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u043c \u0432\u0441\u0435 pending \u0432\u044b\u0437\u043e\u0432\u044b      for (const [id, { reject }] of this.pendingInvokes) {        reject(new Error('TDLib worker process exited'));      }    });  }  async init(accountId: string): Promise&lt;void&gt; {    this.ensureWorker();    \/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0440\u043a\u0435\u0440 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435    if (!this.workerConfigured) {      this.sendToWorker({ type: 'configure',        tdjsonPath: this.options.tdjsonPath, verbosity: 1 });      await this.configuredPromise; \/\/ \u0436\u0434\u0451\u043c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f    }    \/\/ \u041f\u0440\u043e\u0441\u0438\u043c \u0432\u043e\u0440\u043a\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442    this.sendToWorker({ type: 'create-client', accountId, apiId: ..., apiHash: ...,      databaseDirectory: dbDir, filesDirectory: filesDir, ... });    await createdPromise;    \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c proxy-\u043e\u0431\u044a\u0435\u043a\u0442 \u2014 \u0432\u0441\u0435 invoke() \u0443\u0439\u0434\u0443\u0442 \u0432 \u0432\u043e\u0440\u043a\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 IPC    const proxyClient = new TdLibProxyClient(accountId,      (msg) =&gt; this.sendToWorker(msg), this.pendingInvokes, this.invokeIdCounter);    this.clients.set(accountId, proxyClient);  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>TdLibProxyClient<\/code><strong> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <\/strong><code>TdClientLike<\/code><strong>, \u0447\u0442\u043e \u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 tdl-\u043a\u043b\u0438\u0435\u043d\u0442 \u2014 \u0432\u0441\u0435 30+ \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u043e\u0432 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439:<\/strong><\/p>\n<pre><code>class TdLibProxyClient implements TdClientLike {  async invoke(params: Record&lt;string, any&gt;): Promise&lt;unknown&gt; {    const id = String(++this.idCounter.value);    return new Promise((resolve, reject) =&gt; {      this.pendingInvokes.set(id, { resolve, reject });      \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432 utility process, \u0436\u0434\u0451\u043c invoke-result\/invoke-error      this.sendToWorker({ type: 'invoke', id, accountId: this.accountId, params });    });  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u0434\u0430\u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430: PDM \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 <strong>\u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/strong>, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0439.<\/p>\n<p>\u041e\u043d \u0432\u0438\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<ol>\n<li>\n<p><code>ZentrySpace.exe<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (utility process)<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e DLL<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u044d\u0442\u043e \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u2014 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u0440\u043e\u044f\u043d\u0441\u043a\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438.<\/p>\n<p><strong>\u0427\u0442\u043e \u0435\u0449\u0451 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442<\/strong><\/p>\n<ul>\n<li>\n<p>EV-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 (\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 \u0441\u0435\u0431\u0435).<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 Windows \u2014 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043d\u0438\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u044d\u0442\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f (\u043f\u0440\u0435\u0434\u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438)\u00a0 \u2014 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0443\u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u00a0\u044d\u0442\u043e\u0439\u00a0\u0436\u0435 <code>PDM:Trojan.Win 32.Generic<\/code> \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c <strong>Rocket.Chat<\/strong>, <strong>Jitsi Meet<\/strong>, <strong>OpenCode<\/strong>\u00a0\u2014 \u0443\u00a0\u0432\u0441\u0435\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 EV\u2011\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u0443\u00a0\u0432\u0441\u0435\u0445 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430\u00a0\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u0423\u00a0\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e Telegram Desktop \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435\u0442 \u043f\u043e\u00a0\u0434\u0432\u0443\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c: TDLib \u0442\u0430\u043c <strong>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d<\/strong> \u0432\u00a0\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (\u043d\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 DLL, \u043d\u0435\u0442 <code>LoadLibraryW<\/code>), \u0438 \u0443\u00a0Telegram \u0433\u043e\u0434\u0430\u043c\u0438 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f \u0432\u00a0\u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u043e\u0433\u043e (KSN). \u0423\u00a0\u043d\u0430\u0441 \u043d\u0438 \u0442\u043e\u0433\u043e, \u043d\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e.<\/p>\n<p><strong>\u041a\u0430\u043a\u00a0\u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u044b<\/strong><\/p>\n<p><strong>\u0428\u0430\u0433 1: \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0447\u0435\u0440\u0435\u0437 Virusdesk<\/strong><\/p>\n<p>\u0427\u0435\u0440\u0435\u0437 \u0444\u043e\u0440\u043c\u0443 <a href=\"http:\/\/virusdesk.kaspersky.com\" rel=\"noopener noreferrer nofollow\">virusdesk.kaspersky.com<\/a> \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c: \u0447\u0442\u043e\u00a0\u044d\u0442\u043e \u0437\u0430\u00a0\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u0430 TDLib, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u043e. \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0448\u0451\u043b \u0432\u00a0\u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u043d\u0435\u0439, false positive \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043d.<\/p>\n<p><strong>\u0428\u0430\u0433 2: \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0442\u0447\u0451\u0442 \u0441\u00a0TRACE\u2011\u0444\u0430\u0439\u043b\u0430\u043c\u0438<\/strong><\/p>\n<p>\u0414\u043b\u044f\u00a0PDM\u2011\u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0439 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u0438\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0438\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0442\u044c trace\u2011\u0444\u0430\u0439\u043b\u044b: <code>gsf.trace<\/code> \u0438 <code>avp.trace<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u00a0\u0431\u0430\u0437\u0443. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f: <u>support.kaspersky.com\/common\/diagnostics\/15898<\/u><\/p>\n<p><strong>\u0428\u0430\u0433 3: \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 Allowlist<\/strong><\/p>\n<p>\u041f\u043e\u0434\u0430\u043b\u0438 \u0437\u0430\u044f\u0432\u043a\u0443 \u0432 <u>kaspersky.com\/partners\/allowlist\u2011program<\/u>. \u041f\u043e\u0441\u043b\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u00a0\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0440\u0435\u0434\u0438\u0442 \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u0432\u043e\u00a0\u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 Kaspersky, \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435\u00a0\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u00a0\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u0449 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d, \u0430\u00a0\u0432\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a\u00a0\u043d\u0435\u00a0\u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432\u00a0\u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043b\u043e\u0432\u0443\u0448\u043a\u0443. <\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1031516\/\">https:\/\/habr.com\/ru\/articles\/1031516\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u043c\u044b \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e ZentrySpace \u0441\u00a0Telegram, \u043a\u0430\u043a\u00a0\u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u043e, \u043a\u00a0\u0447\u0435\u043c\u0443 \u043d\u0430\u0441 \u0436\u0438\u0437\u043d\u044c \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u00a0\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0430\u00a0\u2014 \u0437\u043b\u043e\u0432\u0435\u0449\u0435\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0443\u00a0\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 \u00ab\u041b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u0438\u0438 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u043e\u0433\u043e\u00bb \u043e\u00a0\u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u0440\u043e\u044f\u043d\u0430 \u0432\u00a0\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041f\u043e\u00a0\u043c\u043e\u0442\u0438\u0432\u0430\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u0432\u00a0Telegram, \u0432\u00a0\u0431\u043e\u0440\u044c\u0431\u0435 \u0441\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u0438\u0439 \u043f\u0440\u0435\u0443\u0441\u043f\u0435\u043b, \u043d\u0430\u0448\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u00a0\u0436\u0435, \u043d\u0430\u0441\u0442\u043e\u0440\u043e\u0436\u0438\u043b\u0438\u0441\u044c. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0438\u0438 \u043e\u0442\u0437\u044b\u0432\u043e\u0432 \u043e\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0ZentrySpace \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0436\u0435 \u043c\u043e\u0433\u043b\u043e \u043f\u043e\u0439\u0442\u0438 \u043d\u0435\u00a0\u0442\u0430\u043a. \u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u0434\u0430\u0436\u0435 Telegram Desktop \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 false positives \u043e\u0442 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u0432. \u041c\u044b \u043a \u043d\u0435\u043c\u0443 \u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043b\u0438\u0441\u044c. \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442: \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0438 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438ZentrySpace \u2014 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Electron (TypeScript + React). \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Telegram \u0447\u0435\u0440\u0435\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 TDLib (Telegram Database Library) \u2014 \u0442\u0443 \u0441\u0430\u043c\u0443\u044e, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Telegram Desktop. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439 \u0438\u0437 Node.js \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 tdl.TDLib \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443: tdjson.dll \u043d\u0430 Windows, libtdjson.dylib \u043d\u0430 macOS, libtdjson.so \u043d\u0430 Linux. \u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u2014 \u043e\u043a\u043e\u043b\u043e 30 \u041c\u0411.\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430: \u043a\u0430\u043a TDLib \u0436\u0438\u0432\u0451\u0442 \u0432 Electron-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438Electron-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041a\u0440\u0430\u0442\u043a\u043e:Main process \u2014 Node.js, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043a\u043d\u0430\u043c\u0438, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 API, \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0424\u0421Renderer process \u2014 Chromium, \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 UI, \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044bUtility process \u2014 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Node.js-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0442\u044f\u0436\u0451\u043b\u044b\u0445\/\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 TDLib \u043f\u0440\u044f\u043c\u043e \u0432 main process. \u042d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c.\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: TDLib \u0432 main process\u0412\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u043c \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:\/\/ main.tsfunction getTdjsonFileName(): string {  switch (process.platform) {    case &#8216;darwin&#8217;: return &#8216;libtdjson.dylib&#8217;;    case &#8216;win32&#8217;:  return &#8216;tdjson.dll&#8217;;    case &#8216;linux&#8217;:  return &#8216;libtdjson.so&#8217;;    default:       return &#8216;libtdjson.so&#8217;;  }}function resolveTdjsonPath(): string | null {  if (app.isPackaged) {    \/\/ Production: \u0431\u0435\u0440\u0451\u043c \u0438\u0437 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f    return path.join(process.resourcesPath, &#8216;tdlib&#8217;, getTdjsonFileName());  }  \/\/ Development: \u0431\u0435\u0440\u0451\u043c \u0438\u0437 vendor\/  const platform = process.platform;  const arch = process.arch;  let subDir: string | null = null;  if (platform === &#8216;darwin&#8217;) {    subDir = arch === &#8216;arm64&#8217; ? &#8216;darwin-arm64&#8217; : &#8216;darwin-x64&#8217;;  } else if (platform === &#8216;win32&#8217;) {    subDir = arch === &#8216;ia32&#8217; ? &#8216;win32-ia32&#8217; : &#8216;win32-x64&#8217;;  } else if (platform === &#8216;linux&#8217;) {    subDir = arch === &#8216;arm64&#8217; ? &#8216;linux-arm64&#8217; : &#8216;linux-x64&#8217;;  }  if (!subDir) return null;  return path.join(app.getAppPath(), &#8216;vendor&#8217;, &#8216;tdlib&#8217;, subDir, getTdjsonFileName());}\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 initializeExternalInstances():private initializeExternalInstances() {  const userDataPath = path.join(app.getPath(&#8216;userData&#8217;), &#8216;telegram&#8217;);  const tdjsonPath = resolveTdjsonPath();  this.telegramService = new ElectronTdLibClientService({    dbBaseDir: userDataPath,    tdjsonPath: tdjsonPath ?? undefined  });}\u0421\u0430\u043c ElectronTdLibClientService \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 init(accountId) \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b tdl \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b TDLib-\u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 main process:\/\/ \u0421\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f ElectronTdLibClientServiceimport * as tdl from &#8216;tdl&#8217;private async configureTdLibOnce(): Promise&lt;void&gt; {  if (this.configured) return;  tdl.configure({ tdjson: this.options.tdjsonPath, verbosityLevel: 1 });  this.configured = true;}async init(accountId: string): Promise&lt;void&gt; {  await this.configureTdLibOnce();  const dbDir = path.join(this.dbBaseDir, accountId);  const client = tdl.createClient({    apiId: Number(TG_API_ID),    apiHash: TG_API_HASH,    databaseDirectory: dbDir,    filesDirectory: path.join(dbDir, &#8216;files&#8217;),    tdlibParameters: {      use_message_database: true,      use_chat_info_database: true,      system_language_code: &#8216;en&#8217;,      device_model: &#8216;Zentry Desktop&#8217;,      application_version: &#8216;1.0.0&#8217;,    },  });  client.on(&#8216;update&#8217;, (update) =&gt; {    this.emit(&#8216;update&#8217;, { type: &#8216;raw-tdlib-update&#8217;, payload: update });  });  this.clients.set(accountId, client);}Handlers \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0438\u0441\u044c \u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 TelegramClientContext, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0445 \u043e\u0442 \u043f\u0440\u044f\u043c\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 tdl:\/\/ handlers\/TelegramClientContext.tsinterface TelegramClientContext {  getClient(): Promise&lt;TdClientLike&gt;;  readonly service: ElectronTdLibClientService;  readonly accountId: string;}\/\/ \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 TelegramAuthHandler.tsasync getAuthState(ctx: TelegramClientContext) {  const client = await ctx.getClient();  return client.invoke({ _: &#8216;getAuthorizationState&#8217; });}\u0412\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 client.invoke() \u2014 \u0431\u043e\u043b\u0435\u0435 30 \u0448\u0442\u0443\u043a: \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0442\u043e\u0432, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u0435\u0434\u0438\u0430, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0442.\u0434. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 main process.\u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u041a\u0430\u0441\u043f\u0435\u0440\u0441\u043a\u0438\u0439 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b \u0438 \u043f\u043e\u0447\u0435\u043c\u0443\u0414\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f PDM:Trojan.Win32.Generic \u2014 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f PDM (Proactive Defense Module). \u042d\u0442\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u043e: PDM \u2014 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041e\u043d \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0438 \u043d\u0435 \u043d\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u0430 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432 runtime.\u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 TDLib \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 LoadLibraryW \u043d\u0430 tdjson.dll \u0438\u0437 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (resources\/tdlib\/)DLL \u0441\u043e\u0437\u0434\u0430\u0451\u0442 SQLite-\u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 %AppData%\\ZentrySpace\\telegram\\{accountId}\\DLL \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 Telegram (MTProto-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b)\u0412\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 1\u20132 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0435\u043d \u0434\u043b\u044f \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u0422\u0440\u043e\u044f\u043d\u043e\u0432: \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c DLL \u2192 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 AppData \u2192 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0441 C2-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. PDM \u0432\u0438\u0434\u0438\u0442 \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u2014 \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u043f\u043b\u043e\u0445\u043e\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0442\u043b\u0438\u0447\u0438\u043c\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0422\u0440\u043e\u044f\u043d\u0430.\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439: TDLib \u0432 Utility Process\u041c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e main process \u2014 \u00ab\u0441\u0435\u0440\u0434\u0446\u0435\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e DLL \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0442\u044c. Electron \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u2014 Utility Process: \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 Node.js-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u0435\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a UI-API.\u0418\u0434\u0435\u044f: \u0432\u044b\u043d\u0435\u0441\u0442\u0438 TDLib \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 worker, \u0430 \u0432 main process \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e IPC-\u043f\u0440\u043e\u043a\u0441\u0438.\u0421\u043e\u0437\u0434\u0430\u043b\u0438 tdlib-worker.ts \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:\/\/ telegram\/tdlib-worker.tslet tdl: typeof import(&#8216;tdl&#8217;) | null = null;\/\/ \u041b\u0435\u043d\u0438\u0432\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u2014 tdl \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &#8216;configure&#8217;async function loadTdl(): Promise&lt;typeof import(&#8216;tdl&#8217;)&gt; {  if (!tdl) tdl = await import(&#8216;tdl&#8217;);  return tdl;}const clients = new Map&lt;string, any&gt;();let configured = false;const parentPort = process.parentPort!;\/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c TDLib \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443async function handleConfigure(msg: { tdjsonPath: string; verbosity: number }) {  if (configured) { send({ type: &#8216;configured&#8217; }); return; }  const lib = await loadTdl();  lib.configure({ tdjson: msg.tdjsonPath, verbosityLevel: msg.verbosity });  configured = true;  send({ type: &#8216;configured&#8217; });}\/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c TDLib-\u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430async function handleCreateClient(msg: { accountId: string; apiId: number; apiHash: string;  databaseDirectory: string; filesDirectory: string; useTestDc: boolean; tdlibParameters: any }) {  const lib = await loadTdl();  const client = lib.createClient({    apiId: msg.apiId,    apiHash: msg.apiHash,    databaseDirectory: msg.databaseDirectory,    filesDirectory: msg.filesDirectory,    useTestDc: msg.useTestDc,    tdlibParameters: msg.tdlibParameters,  });  \/\/ \u0412\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0432 main process \u0447\u0435\u0440\u0435\u0437 IPC  client.on(&#8216;update&#8217;, (update: any) =&gt; {    send({ type: &#8216;update&#8217;, accountId: msg.accountId, payload: update });  });  clients.set(msg.accountId, client);  send({ type: &#8216;client-created&#8217;, accountId: msg.accountId });}\/\/ \u041f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c invoke()-\u0432\u044b\u0437\u043e\u0432\u044b \u043a TDLib APIasync function handleInvoke(msg: { id: string; accountId: string; params: any }) {  const client = clients.get(msg.accountId);  try {    const result = await client.invoke(msg.params);    send({ type: &#8216;invoke-result&#8217;, id: msg.id, result });  } catch (err) {    send({ type: &#8216;invoke-error&#8217;, id: msg.id, error: String(err) });  }}\u0412 main process ElectronTdLibClientService \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0432\u043e\u0440\u043a\u0435\u0440\u0430 \u0441 proxy-\u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c:\/\/ ElectronTdLibClientService.ts (\u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f)import { utilityProcess, type UtilityProcess } from &#8216;electron\/main&#8217;;export class ElectronTdLibClientService extends EventEmitter {  private worker: UtilityProcess | null = null;  private ensureWorker(): void {    if (this.worker) return;    const workerPath = path.join(__dirname, &#8216;tdlib-worker.js&#8217;);    \/\/ \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c TDLib \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c utility process    this.worker = utilityProcess.fork(workerPath);    this.worker.on(&#8216;message&#8217;, (msg) =&gt; this.handleWorkerMessage(msg));    this.worker.on(&#8216;exit&#8217;, (code) =&gt; {      console.error(&#8216;[TDLib Worker] exited with code&#8217;, code);      this.worker = null;      \/\/ \u041e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u043c \u0432\u0441\u0435 pending \u0432\u044b\u0437\u043e\u0432\u044b      for (const [id, { reject }] of this.pendingInvokes) {        reject(new Error(&#8216;TDLib worker process exited&#8217;));      }    });  }  async init(accountId: string): Promise&lt;void&gt; {    this.ensureWorker();    \/\/ \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u043e\u0440\u043a\u0435\u0440 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435    if (!this.workerConfigured) {      this.sendToWorker({ type: &#8216;configure&#8217;,        tdjsonPath: this.options.tdjsonPath, verbosity: 1 });      await this.configuredPromise; \/\/ \u0436\u0434\u0451\u043c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f    }    \/\/ \u041f\u0440\u043e\u0441\u0438\u043c \u0432\u043e\u0440\u043a\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442    this.sendToWorker({ type: &#8216;create-client&#8217;, accountId, apiId: &#8230;, apiHash: &#8230;,      databaseDirectory: dbDir, filesDirectory: filesDir, &#8230; });    await createdPromise;    \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c proxy-\u043e\u0431\u044a\u0435\u043a\u0442 \u2014 \u0432\u0441\u0435 invoke() \u0443\u0439\u0434\u0443\u0442 \u0432 \u0432\u043e\u0440\u043a\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 IPC    const proxyClient = new TdLibProxyClient(accountId,      (msg) =&gt; this.sendToWorker(msg), this.pendingInvokes, this.invokeIdCounter);    this.clients.set(accountId, proxyClient);  }}TdLibProxyClient \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 TdClientLike, \u0447\u0442\u043e \u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 tdl-\u043a\u043b\u0438\u0435\u043d\u0442 \u2014 \u0432\u0441\u0435 30+ \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u043e\u0432 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439:class TdLibProxyClient implements TdClientLike {  async invoke(params: Record&lt;string, any&gt;): Promise&lt;unknown&gt; {    const id = String(++this.idCounter.value);    return new&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-478591","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/478591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=478591"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/478591\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=478591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=478591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=478591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}