{"id":31729874,"url":"https://github.com/ron4fun/pattern_finder","last_synced_at":"2025-10-09T07:18:20.320Z","repository":{"id":56836576,"uuid":"411722614","full_name":"ron4fun/pattern_finder","owner":"ron4fun","description":"pattern_finder is a compact library used for signature matching and/or wildcard pattern finder in byte streams. ","archived":false,"fork":false,"pushed_at":"2021-10-15T06:23:43.000Z","size":202,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-08-20T22:53:38.696Z","etag":null,"topics":["bytecode","bytes","bytestreams","dart","pattern-matching","wildcard-matches"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ron4fun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-29T15:10:10.000Z","updated_at":"2021-10-15T06:23:45.000Z","dependencies_parsed_at":"2022-08-26T13:50:56.311Z","dependency_job_id":null,"html_url":"https://github.com/ron4fun/pattern_finder","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/ron4fun/pattern_finder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2Fpattern_finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2Fpattern_finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2Fpattern_finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2Fpattern_finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ron4fun","download_url":"https://codeload.github.com/ron4fun/pattern_finder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ron4fun%2Fpattern_finder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000985,"owners_count":26082972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bytecode","bytes","bytestreams","dart","pattern-matching","wildcard-matches"],"created_at":"2025-10-09T07:18:18.245Z","updated_at":"2025-10-09T07:18:20.307Z","avatar_url":"https://github.com/ron4fun.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"## pattern_finder [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ron4fun/pattern_finder/blob/main/LICENSE) [![Build Status](https://travis-ci.com/ron4fun/pattern_finder.svg?branch=main)](https://travis-ci.com/ron4fun/pattern_finder)\n\n**`pattern_finder`** is a compact library written in **Dart** language that is primarily used for signature matching and/or wildcard pattern finder in byte streams.\n\nIn addition, you can pass an anonymous function that will be called once signature is found. This function only accepts one parameter `the 'offset' where pattern was found`.\n\n## Usage\n\nA simple usage example:\n\n```dart\nimport 'dart:typed_data';\nimport 'package:pattern_finder/pattern_finder.dart';\n\nmain() {\n  /* Search for patterns using PatternFinder.Find and PatternFinder.Find_B functions */\n  var pattern = PatternFinder.Transform('456?89?B');\n\n  var buf1 = [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF];\n  var buf2 = [0x01, 0x23, 0x45, 0x66, 0x89, 0x6B, 0xCD, 0xEF];\n  var buf3 = [0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11];\n\n  int foundOffset1 =\n      PatternFinder.Find_B(buf1, 8, pattern); // foundOffset1: 2\n  int foundOffset2 =\n      PatternFinder.Find(buf2, 8, '456?89?B'); // foundOffset2: 2\n  int foundOffset3 =\n      PatternFinder.Find_B(buf3, 8, pattern); // foundOffset3: -1\n\n  /* Search for patterns using signatures */\n  var buf = [\n    0x01,\n    0x23,\n    0x45,\n    0x67,\n    0x89,\n    0xAB,\n    0xCD,\n    0xEF,\n    0x45,\n    0x65,\n    0x67,\n    0x89\n  ];\n\n  Signature sig1 = new Signature(\"pattern1\", \"456?89?B\",\n      func: (offset) =\u003e print('Found Pattern1!!! @ ${offset}'));\n  Signature sig2 = new Signature(\"pattern2\", \"1111111111\",\n      func: () =\u003e print('Will I make it?'));\n  Signature sig3 =\n      new Signature(\"pattern3\", \"AB??EF\", func: () =\u003e print('Found pattern3'));\n  Signature sig4 = new Signature(\"pattern4\", \"45??67\", func: (int offset) {\n    // do something\n    int new_offset = offset + 4;\n    print('Found pattern4!!! Old Offset: ${offset}, New Offset: ${new_offset}');\n  });\n  List\u003cSignature\u003e signatures = [sig1, sig2, sig3, sig4];\n\n  // Run `Scan` to execute founded signatures function\n  SignatureFinder.Scan(buf, buf.length, signatures);\n\n  //  Found Pattern1!!! @ 2\n  //  Found pattern3\n  //  Found pattern4!!! Old Offset: 8, New Offset: 12\n}\n```\n\nLicense\n----------\n    Copyright (c) 2021 Mbadiwe Nnaemeka Ronald ron2tele@gmail.com\n\n    This software is provided 'as-is', without any express or implied\n    warranty. In no event will the author be held liable for any damages\n    arising from the use of this software.\n    Permission is granted to anyone to use this software for any purpose,\n    including commercial applications, and to alter it and redistribute it\n    freely, subject to the following restrictions:\n    \n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation must be\n    specified.\n    \n    2. Altered source versions must be plainly marked as such, and must not be\n    misrepresented as being the original software.\n    \n    3. This notice may not be removed or altered from any source distribution.\n        \n     \n#### Tip Jar\n* :dollar: **Bitcoin**: `1Mcci95WffSJnV6PsYG7KD1af1gDfUvLe6`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fron4fun%2Fpattern_finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fron4fun%2Fpattern_finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fron4fun%2Fpattern_finder/lists"}