Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shamrocksu88/89a938e64a75551b5a70d5f03f66daa7 to your computer and use it in GitHub Desktop.

Select an option

Save shamrocksu88/89a938e64a75551b5a70d5f03f66daa7 to your computer and use it in GitHub Desktop.

Revisions

  1. @tillson tillson renamed this gist May 10, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @tillson tillson created this gist May 10, 2020.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    from pydriller import RepositoryMining
    import re
    import base64

    foundSet = set()
    for commit in RepositoryMining('./').traverse_commits():
    for mod in commit.modifications:
    if mod.source_code_before != None:
    regex = re.findall(r"<text encoding=\"base64\">[^>]+</text>", mod.source_code_before)
    for result in regex:
    based = str(base64.b64decode(result[len("<text encoding='base64'>"):-len("</text>")]))
    if based not in foundSet:
    print(based)
    foundSet.add(based + "\n")