Compare commits

...

18 Commits
0.1.1 ... main

Author SHA1 Message Date
544fbd19f4 some fixes 2024-04-16 18:15:40 +09:00
2f964b5b93 some fixes 2024-04-16 17:56:51 +09:00
52c31028c5 Add CFBF extractor 2024-04-16 17:49:11 +09:00
e391718b52 some fixes 2024-04-16 17:25:50 +09:00
ea64977098 make the worker asynchronously 2024-04-16 15:48:15 +09:00
9fdbb01bcd some fixes 2024-04-16 15:33:57 +09:00
31712d00ee some fixes 2024-04-15 18:37:39 +09:00
37fdb5016f Add submodules 2024-04-15 18:23:35 +09:00
05b6541e2a Add IP and URL extractor 2024-04-15 17:21:31 +09:00
325c9ab13e Add OpenXML metadata parser 2024-04-15 15:27:38 +09:00
5903f86ac5 some fixes 2024-04-13 12:27:03 +09:00
7d846847f6 Update the android manifest related feature 2024-04-12 18:24:02 +09:00
52ed5fe3ea Add SSDEEP 2024-04-12 16:52:43 +09:00
5d269a31ce Update ApkManifestExtractor.cs and more 2024-04-12 16:23:38 +09:00
b581a947d2 Update README.md 2024-04-08 16:09:05 +09:00
600a107861 Update Config.cs 2024-04-08 16:05:53 +09:00
9c64635baa Update README.md 2024-04-08 15:39:31 +09:00
bb02b8eb2d Remove SharpShell and update standalone version 2024-04-08 15:35:57 +09:00
67 changed files with 2588 additions and 1160 deletions

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "SsdeepNET"]
path = SsdeepNET
url = https://github.com/kolos450/SsdeepNET
[submodule "androidxmldotnet"]
path = androidxmldotnet
url = https://github.com/quamotion/androidxmldotnet

View File

@ -1,6 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -12,6 +12,21 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>게시\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -32,12 +47,58 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>socialonthefile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Crc32.NET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dc0b95cf99bf4e99, processorArchitecture=MSIL">
<HintPath>..\packages\Crc32.NET.1.2.0\lib\net20\Crc32.NET.dll</HintPath>
</Reference>
<Reference Include="MetadataExtractor, Version=2.8.1.0, Culture=neutral, PublicKeyToken=b66b5ccaf776c301, processorArchitecture=MSIL">
<HintPath>..\packages\MetadataExtractor.2.8.1\lib\net45\MetadataExtractor.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Packaging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Packaging.8.0.0\lib\net462\System.IO.Packaging.dll</HintPath>
</Reference>
<Reference Include="System.IO.Pipelines, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.8.0.0\lib\net462\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@ -47,19 +108,45 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="XmpCore, Version=6.1.10.1, Culture=neutral, PublicKeyToken=961f4f366277b80e, processorArchitecture=MSIL">
<HintPath>..\packages\XmpCore.6.1.10.1\lib\net35\XmpCore.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<Compile Include="Config.cs" />
<Compile Include="Helper\InfoHashExtractor.cs" />
<Compile Include="Model\CfbfPartInfo.cs" />
<Compile Include="Model\HashInfo.cs" />
<Compile Include="Worker1.cs" />
<Compile Include="Main.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="Main.Designer.cs">
<DependentUpon>Main.cs</DependentUpon>
</Compile>
<Compile Include="Helper\FileCompany.cs" />
<Compile Include="Helper\FileMagic.cs" />
<Compile Include="UserControl2.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControl2.Designer.cs">
<DependentUpon>UserControl2.cs</DependentUpon>
</Compile>
<Compile Include="Helper\ApkManifestExtractor.cs" />
<Compile Include="Helper\CfbfExtractor.cs" />
<Compile Include="Helper\FileHasher.cs" />
<Compile Include="Helper\FileExtensionDatabase.cs" />
<Compile Include="Helper\PeOrganizationExtractor.cs" />
<Compile Include="Helper\FileMagicExtractor.cs" />
<Compile Include="Helper\LinkExtractor.cs" />
<Compile Include="Helper\ImpHash.cs" />
<Compile Include="Helper\ExifTagExtractor.cs" />
<Compile Include="Helper\OpenXMLExtractor.cs" />
<Compile Include="Helper\Timeline.cs" />
<Compile Include="Model\Indicator.cs" />
<Compile Include="Model\AndroidPermission.cs" />
<Compile Include="Model\ExifTag.cs" />
<Compile Include="Model\TimelineMessage.cs" />
<Compile Include="Model\OpenXMLMetadata.cs" />
<Compile Include="Model\Timestamp.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserControl1.cs">
@ -68,8 +155,11 @@
<Compile Include="UserControl1.Designer.cs">
<DependentUpon>UserControl1.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControl2.resx">
<DependentUpon>UserControl2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
@ -84,6 +174,7 @@
<EmbeddedResource Include="UserControl1.resx">
<DependentUpon>UserControl1.cs</DependentUpon>
</EmbeddedResource>
<None Include="LICENSE" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@ -94,6 +185,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="socialonthefile.snk" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
@ -101,5 +193,51 @@
<ItemGroup>
<None Include="Resources\image1.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\message_bubble_conversation_speech_communication_talk_chat_icon_219299.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\data_database_icon_177024.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\document_paperclip_list_paper_icon_219544.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\2333410-android-os-smartphone_85588.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\office_18907.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\link-symbol_icon-icons.com_56927.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\tags_icon-icons.com_73382.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8%28x86 및 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\androidxmldotnet\AndroidXml\AndroidXml.csproj">
<Project>{e55ce5e9-aeec-4625-82ff-9c73dad2ba84}</Project>
<Name>AndroidXml</Name>
</ProjectReference>
<ProjectReference Include="..\SsdeepNET\Source\SsdeepNET\SsdeepNET.csproj">
<Project>{1fc34ef4-5137-4069-a18a-d35afec5181f}</Project>
<Name>SsdeepNET</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,9 @@
namespace Catswords.DataType.Client
{
public class Config
{
public static string SEARCH_URL = "https://exts.kr/extlist.xml?q=";
public static string MASTODON_HOST = "catswords.social";
public static string MASTODON_ACCESS_TOKEN = "HDVTEfLswvSJZq5MRpim2tp7DifTcgKbMl0mBM5-uHw";
}
}

View File

@ -0,0 +1,82 @@
using AndroidXml;
using Catswords.DataType.Client.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Xml.Linq;
namespace Catswords.DataType.Client.Helper
{
class ApkManifestExtractor
{
private string FilePath;
private string TempDirectory;
private string TargetPath;
public ApkManifestExtractor(string filePath)
{
FilePath = filePath;
}
public void Open()
{
// Create a temporary directory for extraction
TempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(TempDirectory);
using (ZipArchive apkArchive = ZipFile.OpenRead(FilePath))
{
foreach (ZipArchiveEntry entry in apkArchive.Entries)
{
if (entry.FullName == "AndroidManifest.xml")
{
TargetPath = Path.Combine(TempDirectory, Guid.NewGuid().ToString());
entry.ExtractToFile(TargetPath);
break;
}
}
}
}
public void Close()
{
// Delete the temporary directory and its contents
Directory.Delete(TempDirectory, true);
}
public List<AndroidPermission> GetPermissions()
{
List<AndroidPermission> permissions = new List<AndroidPermission>();
using (FileStream stream = File.OpenRead(TargetPath))
{
// Read the AndroidManifest.xml file
var reader = new AndroidXmlReader(stream);
XDocument doc = XDocument.Load(reader);
// Find all <uses-permission> elements
var permissionNodes = doc.Descendants().Where(e => e.Name.LocalName == "uses-permission");
foreach (var node in permissionNodes)
{
foreach (var attr in node.Attributes())
{
if (attr.Name.LocalName == "name")
{
permissions.Add(new AndroidPermission
{
Name = attr.Value,
Description = "",
Severity = 0,
CreatedAt = DateTime.Now
});
}
}
}
}
return permissions;
}
}
}

View File

@ -0,0 +1,71 @@
using Catswords.DataType.Client.Model;
using System.Collections.Generic;
using System.IO.Packaging;
using System.IO;
namespace Catswords.DataType.Client.Helper
{
public class CfbfExtractor
{
private string FilePath;
public CfbfExtractor(string filePath)
{
FilePath = filePath;
}
public List<CfbfPartInfo> GetParts()
{
List<CfbfPartInfo> partInfoList = new List<CfbfPartInfo>();
if (!IsValidFormat())
{
return partInfoList;
}
using (Package package = Package.Open(FilePath, FileMode.Open, FileAccess.Read))
{
foreach (PackagePart part in package.GetParts())
{
CfbfPartInfo partInfo = new CfbfPartInfo();
partInfo.URI = part.Uri.ToString();
partInfo.ContentType = part.ContentType;
using (Stream stream = part.GetStream(FileMode.Open, FileAccess.Read))
{
using (StreamReader reader = new StreamReader(stream))
{
partInfo.Content = reader.ReadToEnd();
}
}
partInfoList.Add(partInfo);
}
}
return partInfoList;
}
public bool IsValidFormat()
{
// CFBF 파일 시그니처 확인
byte[] signatureBytes = { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 };
byte[] fileBytes = new byte[signatureBytes.Length];
using (FileStream fileStream = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
{
fileStream.Read(fileBytes, 0, signatureBytes.Length);
}
for (int i = 0; i < signatureBytes.Length; i++)
{
if (fileBytes[i] != signatureBytes[i])
{
return false;
}
}
return true;
}
}
}

View File

@ -0,0 +1,44 @@
using Catswords.DataType.Client.Model;
using MetadataExtractor;
using System;
using System.Collections.Generic;
namespace Catswords.DataType.Client.Helper
{
class ExifTagExtractor
{
private string FilePath;
public ExifTagExtractor(string filePath)
{
FilePath = filePath;
}
public List<ExifTag> GetTags()
{
List<ExifTag> tags = new List<ExifTag>();
try {
IEnumerable<Directory> directories = ImageMetadataReader.ReadMetadata(FilePath);
foreach (var directory in directories)
{
foreach (var tag in directory.Tags)
{
tags.Add(new ExifTag
{
Section = directory.Name,
Name = tag.Name,
Description = tag.Description.ToString()
});
}
}
}
catch
{
// nothing
}
return tags;
}
}
}

View File

@ -0,0 +1,112 @@
using Catswords.DataType.Client.Model;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace Catswords.DataType.Client.Helper
{
class FileExtensionDatabase
{
public List<TimelineMessage> Indicators;
public FileExtensionDatabase()
{
Indicators = new List<TimelineMessage>();
}
public void Fetch(string q)
{
try
{
// 원격 주소에서 XML 다운로드
string url = Config.SEARCH_URL + q;
WebClient client = new WebClient();
client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3");
client.Encoding = Encoding.UTF8;
string xmlString = client.DownloadString(url);
// XmlDocument 객체 생성
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlString);
// 루트 노드 가져오기
XmlNodeList itemList = xmlDoc.SelectNodes("/claw/list/item");
// 각 아이템을 반복하며 정보 출력
foreach (XmlNode itemNode in itemList)
{
// organization
Indicators.Add(new TimelineMessage()
{
Id = itemNode.SelectSingleNode("id").InnerText,
CreatedAt = GetDateTimeFromString(itemNode.SelectSingleNode("datetime").InnerText),
Content = "This format published by " + itemNode.SelectSingleNode("organization").InnerText,
Url = ""
});
// description
Indicators.Add(new TimelineMessage()
{
Id = itemNode.SelectSingleNode("id").InnerText,
CreatedAt = GetDateTimeFromString(itemNode.SelectSingleNode("datetime").InnerText),
Content = itemNode.SelectSingleNode("description").InnerText,
Url = ""
});
// content
Indicators.Add(new TimelineMessage()
{
Id = itemNode.SelectSingleNode("id").InnerText,
CreatedAt = GetDateTimeFromString(itemNode.SelectSingleNode("datetime").InnerText),
Content = itemNode.SelectSingleNode("content").InnerText,
Url = ""
});
// openwith
Indicators.Add(new TimelineMessage()
{
Id = itemNode.SelectSingleNode("id").InnerText,
CreatedAt = GetDateTimeFromString(itemNode.SelectSingleNode("datetime").InnerText),
Content = "Open with " + itemNode.SelectSingleNode("openwith").InnerText,
Url = ""
});
// first reported
Indicators.Add(new TimelineMessage()
{
Id = itemNode.SelectSingleNode("id").InnerText,
CreatedAt = GetDateTimeFromString(itemNode.SelectSingleNode("datetime").InnerText),
Content = "This format first seen on " + GetDateTimeFromString(itemNode.SelectSingleNode("datetime").InnerText).ToString(),
Url = ""
});
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message);
Console.WriteLine("Error: " + ex.Message);
}
}
public static DateTime GetDateTimeFromString(string dateString)
{
DateTime parsedDateTime;
if (DateTime.TryParseExact(dateString, "yyyy-MM-dd HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out parsedDateTime))
{
return parsedDateTime;
}
else
{
parsedDateTime = DateTime.Now;
}
return parsedDateTime;
}
}
}

View File

@ -0,0 +1,194 @@
using Force.Crc32;
using SsdeepNET;
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Catswords.DataType.Client.Helper
{
public class FileHasher
{
private string FilePath;
public FileHasher(string filePath)
{
FilePath = filePath;
}
public string GetExtension()
{
string extension = string.Empty;
try
{
if (Path.GetExtension(FilePath).Length > 0)
{
extension = Path.GetExtension(FilePath).Substring(1).ToLower();
}
}
catch
{
// nothing
}
return extension;
}
public string GetMD5()
{
string checksum = string.Empty;
using (MD5 hasher = MD5.Create())
{
using (FileStream stream = File.OpenRead(FilePath))
{
byte[] hash = hasher.ComputeHash(stream);
checksum = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}
}
return checksum;
}
public string GetSHA1()
{
string checksum = string.Empty;
using (SHA1 hasher = SHA1.Create())
{
using (FileStream stream = File.OpenRead(FilePath))
{
byte[] hash = hasher.ComputeHash(stream);
checksum = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}
}
return checksum;
}
public string GetCRC32()
{
string checksum = string.Empty;
using (FileStream stream = File.OpenRead(FilePath))
{
MemoryStream ms = new MemoryStream();
stream.CopyTo(ms);
checksum = string.Format("{0:x}", Crc32Algorithm.Compute(ms.ToArray()));
}
return checksum;
}
public string GetSHA256()
{
string checksum = string.Empty;
using (SHA256 hasher = SHA256.Create())
{
using (FileStream stream = File.OpenRead(FilePath))
{
var hash = hasher.ComputeHash(stream);
checksum = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}
}
return checksum;
}
public byte[] GetFileBytes(int count = 32)
{
byte[] buffer = new byte[count];
using (var stream = File.OpenRead(FilePath))
{
int offset = 0;
while (offset < count)
{
try
{
int read = stream.Read(buffer, offset, count - offset);
if (read == 0)
throw new EndOfStreamException();
offset += read;
}
catch (EndOfStreamException)
{
break;
}
}
System.Diagnostics.Debug.Assert(offset == count);
}
return buffer;
}
public string GetMagic()
{
return new FileMagicExtractor(FilePath).GetString();
}
public string GetInfoHash()
{
string checksum = string.Empty;
string extension = GetExtension().ToLower();
if (extension == "torrent")
{
var extractor = new InfoHashExtractor(FilePath);
checksum = extractor.GetString();
}
return checksum;
}
public string GetSSDEEP()
{
string checksum = string.Empty;
using (FileStream stream = File.OpenRead(FilePath))
{
MemoryStream ms = new MemoryStream();
stream.CopyTo(ms);
FuzzyHash fuzzyHash = new FuzzyHash();
checksum = fuzzyHash.ComputeHash(ms.ToArray());
}
return checksum;
}
public string GetHexView(byte[] Data)
{
string output = string.Empty;
StringBuilder strb = new StringBuilder();
StringBuilder text = new StringBuilder();
char[] ch = new char[1];
for (int x = 0; x < Data.Length; x += 16)
{
text.Length = 0;
strb.Length = 0;
for (int y = 0; y < 16; ++y)
{
if ((x + y) > (Data.Length - 1))
break;
ch[0] = (char)Data[x + y];
strb.AppendFormat("{0,0:X2} ", (int)ch[0]);
if (((int)ch[0] < 32) || ((int)ch[0] > 127))
ch[0] = '.';
text.Append(ch);
}
text.Append("\r\n");
while (strb.Length < 52)
strb.Append(" ");
strb.Append(text.ToString());
output += strb.ToString();
}
return output;
}
}
}

View File

@ -3,18 +3,24 @@ using System.IO;
namespace Catswords.DataType.Client.Helper
{
public static class FileMagic
public class FileMagicExtractor
{
public static string Error = string.Empty;
private string FilePath;
private string Error = null;
public static string Read(string filePath)
public FileMagicExtractor(string filePath)
{
FilePath = filePath;
}
public string GetString()
{
string hexString = "";
try
{
// 파일 열기
using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
using (FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
{
// 첫 3 바이트 읽기
byte[] buffer = new byte[3] { 0x00, 0x00, 0x00 };
@ -32,5 +38,10 @@ namespace Catswords.DataType.Client.Helper
return hexString;
}
public string GetError()
{
return Error;
}
}
}

View File

@ -0,0 +1,51 @@
using System;
using System.IO;
namespace Catswords.DataType.Client.Helper
{
public class InfoHashExtractor
{
private string FilePath;
public InfoHashExtractor(string filePath)
{
FilePath = filePath;
}
public string GetString()
{
string infoHashString = "";
try
{
// 토렌트 파일을 바이트 배열로 읽어옴
byte[] torrentData = File.ReadAllBytes(FilePath);
// 토렌트 파일에서 InfoHash 추출
byte[] infoHash = ExtractInfoHash(torrentData);
// InfoHash를 문자열로 변환하여 출력
infoHashString = BitConverter.ToString(infoHash).Replace("-", "").ToLower();
}
catch (Exception ex)
{
Console.WriteLine("An error occurred: " + ex.Message);
}
return infoHashString;
}
private byte[] ExtractInfoHash(byte[] torrentData)
{
// 토렌트 파일의 구조에 따라 InfoHash 위치 파악
int start = Array.IndexOf(torrentData, (byte)'4', 0);
int end = Array.IndexOf(torrentData, (byte)'e', start);
// InfoHash 추출
byte[] infoHash = new byte[20];
Array.Copy(torrentData, start + 1, infoHash, 0, 20);
return infoHash;
}
}
}

View File

@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace Catswords.DataType.Client.Helper
{
class LinkExtractor
{
private string FilePath;
public LinkExtractor(string filePath)
{
FilePath = filePath;
}
private void ProcessFile(string srcfile, List<string> results)
{
// Read the binary file
byte[] data = File.ReadAllBytes(srcfile);
// Convert binary data to string
string binaryString = Encoding.ASCII.GetString(data);
// Regular expression to match IP address pattern
string ipPattern = @"(?<!\d)(?:\d{1,3}\.){3}\d{1,3}(?!\d)";
// Regular expression to match URL pattern
string urlPattern = @"(?:http|https):\/\/[\w\-_]+(?:\.[\w\-_]+)+[\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#]";
// Match IP addresses
MatchCollection ipMatches = Regex.Matches(binaryString, ipPattern);
foreach (Match match in ipMatches)
{
results.Add(match.Value);
}
// Match URLs
MatchCollection urlMatches = Regex.Matches(binaryString, urlPattern);
foreach (Match match in urlMatches)
{
results.Add(match.Value);
}
}
private bool IsZipFile()
{
try
{
using (FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
{
byte[] buffer = new byte[4];
int bytesRead = fs.Read(buffer, 0, 4);
if (bytesRead >= 4)
{
string fileSignature = BitConverter.ToString(buffer);
return fileSignature == "50-4B-03-04"; // "PK" signature for zip files
}
else
{
// File is too small to read signature
return false;
}
}
}
catch (Exception ex)
{
MessageBox.Show($"An error occurred: {ex.Message}");
return false;
}
}
public List<string> GetStrings()
{
List<string> results = new List<string>();
try
{
// Check if the file is a zip file
bool isZip = IsZipFile();
if (isZip)
{
// Extract files from zip archive
string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(tempDir);
using (ZipArchive apkArchive = ZipFile.OpenRead(FilePath))
{
foreach (ZipArchiveEntry entry in apkArchive.Entries)
{
string extractedFile = Path.Combine(tempDir, Guid.NewGuid().ToString());
entry.ExtractToFile(extractedFile);
ProcessFile(extractedFile, results);
}
}
// Clean up temp directory
Directory.Delete(tempDir, true);
}
else
{
// Process the file directly
ProcessFile(FilePath, results);
}
}
catch (Exception ex)
{
MessageBox.Show($"An error occurred: {ex.Message}");
}
return results;
}
}
}

View File

@ -0,0 +1,101 @@
using System;
using System.IO.Compression;
using System.IO;
using System.Xml;
using Catswords.DataType.Client.Model;
namespace Catswords.DataType.Client.Helper
{
class OpenXMLExtractor
{
private string FilePath;
private string TempDirectory;
private string TargetPath;
public OpenXMLExtractor(string filePath)
{
FilePath = filePath;
}
public void Open()
{
// Create a temporary directory for extraction
TempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(TempDirectory);
using (ZipArchive apkArchive = ZipFile.OpenRead(FilePath))
{
foreach (ZipArchiveEntry entry in apkArchive.Entries)
{
if (entry.FullName == "docProps/core.xml")
{
TargetPath = Path.Combine(TempDirectory, Guid.NewGuid().ToString());
entry.ExtractToFile(TargetPath);
break;
}
}
}
}
public void Close()
{
// Delete the temporary directory and its contents
Directory.Delete(TempDirectory, true);
}
public OpenXMLMetadata GetMetadata()
{
XmlDocument doc = new XmlDocument();
doc.Load(TargetPath);
return ExtractMetadata(doc);
}
private OpenXMLMetadata ExtractMetadata(XmlDocument doc)
{
XmlNode _author = doc.SelectSingleNode("//dc:creator", GetNamespaceManager(doc));
XmlNode _title = doc.SelectSingleNode("//dc:title", GetNamespaceManager(doc));
XmlNode _subject = doc.SelectSingleNode("//dc:subject", GetNamespaceManager(doc));
XmlNode _category = doc.SelectSingleNode("//dc:category", GetNamespaceManager(doc));
XmlNode _keywords = doc.SelectSingleNode("//dc:keywords", GetNamespaceManager(doc));
XmlNode _description = doc.SelectSingleNode("//dc:description", GetNamespaceManager(doc));
XmlNode _lastModifiedBy = doc.SelectSingleNode("//cp:lastModifiedBy", GetNamespaceManager(doc));
XmlNode _lastPrinted = doc.SelectSingleNode("//cp:lastPrinted", GetNamespaceManager(doc));
XmlNode _created = doc.SelectSingleNode("//dcterms:created", GetNamespaceManager(doc));
XmlNode _modified = doc.SelectSingleNode("//dcterms:modified", GetNamespaceManager(doc));
string author = _author != null ? _author.InnerText : "Unknown";
string title = _title != null ? _title.InnerText : "Unknown";
string subject = _subject != null ? _subject.InnerText : "Unknown";
string category = _category != null ? _category.InnerText : "Unknown";
string keywords = _keywords != null ? _keywords.InnerText : "Unknown";
string description = _description != null ? _description.InnerText : "Unknown";
string lastModifiedBy = _lastModifiedBy != null ? _lastModifiedBy.InnerText : "Unknown";
DateTime lastPrinted = _lastPrinted != null ? DateTime.Parse(_lastPrinted.InnerText) : DateTime.MinValue;
DateTime created = _created != null ? DateTime.Parse(_created.InnerText) : DateTime.MinValue;
DateTime modified = _modified != null ? DateTime.Parse(_modified.InnerText) : DateTime.MinValue;
return new OpenXMLMetadata
{
Author = author,
Title = title,
Subject = subject,
Category = category,
Keyword = keywords,
Description = description,
CreatedAt = created,
UpdatedAt = modified,
LastUpdatedBy = lastModifiedBy,
LastPrintedAt = lastPrinted
};
}
private XmlNamespaceManager GetNamespaceManager(XmlDocument doc)
{
XmlNamespaceManager nsManager = new XmlNamespaceManager(doc.NameTable);
nsManager.AddNamespace("dc", "http://purl.org/dc/elements/1.1/");
nsManager.AddNamespace("dcterms", "http://purl.org/dc/terms/");
nsManager.AddNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties");
return nsManager;
}
}
}

View File

@ -5,17 +5,19 @@ using System.Security.Cryptography.X509Certificates;
namespace Catswords.DataType.Client.Helper
{
public static class FileCompany
class PeOrganizationExtractor
{
static public string Read(string filePath)
private string FilePath;
public PeOrganizationExtractor(string filePath)
{
FilePath = filePath;
}
public string GetString()
{
// 회사 정보 추출
string[] companies = new string[] {
GetCompanyInfo(filePath),
GetProductName(filePath),
GetCopyrightInfo(filePath),
GetOrganization(filePath)
};
string[] companies = new string[] { GetCompanyInfo(), GetProductName(), GetCopyrightInfo(), GetOrganization() };
foreach (string company in companies)
{
if (company != null && !company.Equals(string.Empty))
@ -27,12 +29,12 @@ namespace Catswords.DataType.Client.Helper
return "Unknown";
}
public static string GetOrganization(string filePath)
private string GetOrganization()
{
string organization = string.Empty;
// 서명된 파일인 경우 인증서 정보 추출
X509Certificate2 certificate = GetCertificateInfo(filePath);
X509Certificate2 certificate = GetCertificateInfo();
if (certificate != null)
{
// Subject 필드에서 O (Organization) 값을 찾아 회사 정보 추출
@ -52,31 +54,31 @@ namespace Catswords.DataType.Client.Helper
return organization;
}
public static string GetCompanyInfo(string filePath)
private string GetCompanyInfo()
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(FilePath);
return versionInfo.CompanyName;
}
public static string GetProductName(string filePath)
private string GetProductName()
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(FilePath);
return versionInfo.ProductName;
}
public static string GetCopyrightInfo(string filePath)
private string GetCopyrightInfo()
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(FilePath);
return versionInfo.LegalCopyright;
}
static X509Certificate2 GetCertificateInfo(string filePath)
private X509Certificate2 GetCertificateInfo()
{
// GetCertificateInfo 구현
try
{
// 파일에 디지털 서명이 있는지 확인
Assembly assembly = Assembly.LoadFile(filePath);
Assembly assembly = Assembly.LoadFile(FilePath);
X509Certificate2 certificate = new X509Certificate2(assembly.Location);
// 서명이 유효한지 확인 (옵션)

View File

@ -12,14 +12,14 @@ namespace Catswords.DataType.Client.Helper
{
public string ApiBaseUrl;
public string AccessToken;
public List<Indicator> Indicators;
public List<TimelineMessage> Messages;
public string ResponseText;
public Timeline(string host, string access_token)
{
ApiBaseUrl = $"https://{host}/api/v1/timelines/tag";
AccessToken = access_token;
Indicators = new List<Indicator>();
Messages = new List<TimelineMessage>();
}
public static string RemoveHtmlTags(string input)
@ -33,21 +33,22 @@ namespace Catswords.DataType.Client.Helper
return result;
}
public static string FormatDateTime(string dateString)
public static DateTime GetDateTimeFromString(string dateString)
{
string formattedDateTime = "";
DateTime localTime;
// 날짜와 시간을 파싱
if (DateTime.TryParseExact(dateString, "MM/dd/yyyy HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out DateTime parsedDateTime))
{
// UTC에서 로컬 시간으로 변환
DateTime localTime = parsedDateTime.ToLocalTime();
// 현재 스레드의 문화권에 따라 날짜와 시간 출력
formattedDateTime = localTime.ToString();
localTime = parsedDateTime.ToLocalTime();
}
else
{
localTime = DateTime.Now;
}
return formattedDateTime;
return localTime;
}
public void Fetch(string q)
@ -76,9 +77,9 @@ namespace Catswords.DataType.Client.Helper
string createdAt = status["created_at"].Value<string>();
string content = status["content"].Value<string>();
Indicators.Add(new Indicator
Messages.Add(new TimelineMessage
{
CreatedAt = FormatDateTime(createdAt),
CreatedAt = GetDateTimeFromString(createdAt),
Content = RemoveHtmlTags(content)
});
}

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,6 +1,6 @@
namespace Catswords.DataType.Client
{
partial class Form1
partial class Main
{
/// <summary>
/// 필수 디자이너 변수입니다.
@ -35,7 +35,9 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(384, 469);
this.ClientSize = new System.Drawing.Size(384, 517);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = global::Catswords.DataType.Client.Properties.Resources.icon;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";

View File

@ -2,9 +2,9 @@
namespace Catswords.DataType.Client
{
public partial class Form1 : Form
public partial class Main : Form
{
public Form1()
public Main()
{
InitializeComponent();

View File

@ -0,0 +1,9 @@
namespace Catswords.DataType.Client.Model
{
public class AndroidPermission: Timestamp
{
public string Name { get; set; }
public string Description { get; set; }
public int Severity { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Catswords.DataType.Client.Model
{
public class CfbfPartInfo: Timestamp
{
public string URI { get; set; }
public string ContentType { get; set; }
public string Content { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace Catswords.DataType.Client.Model
{
public class ExifTag: Timestamp
{
public string Section { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace Catswords.DataType.Client.Model
{
class HashInfo: Timestamp
{
public string Path { get; set; }
public string Extension { get; set; }
public string MD5 { get; set; }
public string SHA1 { get; set; }
public string MAGIC { get; set; }
public string CRC32 { get; set; }
public string SHA256 { get; set; }
public string InfoHash { get; set; }
public string SSDEEP { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
namespace Catswords.DataType.Client.Model
{
public class OpenXMLMetadata: Timestamp
{
public string Author { get; set; }
public string Title { get; set; }
public string Subject { get; set; }
public string Category { get; set; }
public string Keyword { get; set; }
public string Description { get; set; }
public string LastUpdatedBy { get; set; }
public DateTime LastPrintedAt { get; set; }
}
}

View File

@ -1,10 +1,9 @@
namespace Catswords.DataType.Client.Model
{
public class Indicator
public class TimelineMessage: Timestamp
{
public string Id { get; set; }
public string Content { get; set; }
public string Url { get; set; }
public string CreatedAt { get; set; }
}
}

View File

@ -0,0 +1,10 @@
using System;
namespace Catswords.DataType.Client.Model
{
public class Timestamp
{
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
}

View File

@ -16,7 +16,7 @@ namespace Catswords.DataType.Client
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new Main());
}
}
}

View File

@ -6,12 +6,12 @@ using System.Runtime.InteropServices;
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("Catswords.DataType.Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("File reputation checker with Social media timeline")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Catswords Research, Co.")]
[assembly: AssemblyProduct("Catswords.DataType.Client")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Namhyeon Go, Opensource licensed under GPL 3.0")]
[assembly: AssemblyTrademark("Catswords")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에

View File

@ -60,6 +60,46 @@ namespace Catswords.DataType.Client.Properties {
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap _2333410_android_os_smartphone_85588 {
get {
object obj = ResourceManager.GetObject("_2333410_android_os_smartphone_85588", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap data_database_icon_177024 {
get {
object obj = ResourceManager.GetObject("data_database_icon_177024", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap document_paperclip_list_paper_icon_219544 {
get {
object obj = ResourceManager.GetObject("document_paperclip_list_paper_icon_219544", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// (아이콘)과(와) 유사한 System.Drawing.Icon 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Icon icon {
get {
object obj = ResourceManager.GetObject("icon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
@ -69,5 +109,45 @@ namespace Catswords.DataType.Client.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap link_symbol_icon_icons_com_56927 {
get {
object obj = ResourceManager.GetObject("link_symbol_icon_icons_com_56927", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap message_bubble_conversation_speech_communication_talk_chat_icon_219299 {
get {
object obj = ResourceManager.GetObject("message_bubble_conversation_speech_communication_talk_chat_icon_219299", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap office_18907 {
get {
object obj = ResourceManager.GetObject("office_18907", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap tags_icon_icons_com_73382 {
get {
object obj = ResourceManager.GetObject("tags_icon_icons_com_73382", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -118,7 +118,31 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="data_database_icon_177024" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\data_database_icon_177024.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="document_paperclip_list_paper_icon_219544" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\document_paperclip_list_paper_icon_219544.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="image1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\image1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="link_symbol_icon_icons_com_56927" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\link-symbol_icon-icons.com_56927.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="message_bubble_conversation_speech_communication_talk_chat_icon_219299" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\message_bubble_conversation_speech_communication_talk_chat_icon_219299.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="office_18907" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\office_18907.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="tags_icon_icons_com_73382" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\tags_icon-icons.com_73382.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_2333410_android_os_smartphone_85588" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\2333410-android-os-smartphone_85588.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -35,6 +35,7 @@
this.textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// listView1
@ -45,7 +46,7 @@
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(18, 125);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(347, 277);
this.listView1.Size = new System.Drawing.Size(347, 339);
this.listView1.TabIndex = 8;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
@ -57,7 +58,7 @@
//
// columnHeader2
//
this.columnHeader2.Text = "Opinion";
this.columnHeader2.Text = "Description";
this.columnHeader2.Width = 200;
//
// label1
@ -74,7 +75,7 @@
//
this.textBox1.BackColor = System.Drawing.Color.White;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Location = new System.Drawing.Point(16, 445);
this.textBox1.Location = new System.Drawing.Point(16, 496);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(349, 13);
@ -93,7 +94,7 @@
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(15, 416);
this.linkLabel1.Location = new System.Drawing.Point(13, 475);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(122, 13);
this.linkLabel1.TabIndex = 9;
@ -101,6 +102,16 @@
this.linkLabel1.Text = "Write a review to this file";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// button1
//
this.button1.Location = new System.Drawing.Point(280, 470);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(85, 23);
this.button1.TabIndex = 12;
this.button1.Text = "Expert...";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// UserControl1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -108,13 +119,14 @@
this.BackColor = System.Drawing.SystemColors.Window;
this.BackgroundImage = global::Catswords.DataType.Client.Properties.Resources.image1;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.Controls.Add(this.button1);
this.Controls.Add(this.listView1);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.linkLabel1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(433, 457);
this.Size = new System.Drawing.Size(388, 517);
this.ResumeLayout(false);
this.PerformLayout();
@ -129,5 +141,6 @@
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Button button1;
}
}

View File

@ -1,26 +1,38 @@
using Catswords.DataType.Client.Model;
using Catswords.DataType.Client.Helper;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace Catswords.DataType.Client
{
public partial class UserControl1 : UserControl
{
private string filePath;
private string fileMagic;
private string fileName;
private string fileExtension;
private ImageList imageList = new ImageList();
public string FilePath;
public string FileMagic;
public string FileName;
public string FileExtension;
public UserControl1(Form parent)
{
InitializeComponent();
// Set image size
imageList.Images.Add(Properties.Resources.data_database_icon_177024);
imageList.Images.Add(Properties.Resources.message_bubble_conversation_speech_communication_talk_chat_icon_219299);
imageList.Images.Add(Properties.Resources._2333410_android_os_smartphone_85588);
imageList.Images.Add(Properties.Resources.office_18907);
imageList.Images.Add(Properties.Resources.link_symbol_icon_icons_com_56927);
imageList.Images.Add(Properties.Resources.tags_icon_icons_com_73382);
// set image list
listView1.SmallImageList = imageList;
// Store the file path.
filePath = OpenFileDialog();
if (string.IsNullOrEmpty(filePath))
FilePath = OpenFileDialog();
if (string.IsNullOrEmpty(FilePath))
{
MessageBox.Show("Failed to get a file name", "Catswords.DataType.Client");
parent.Close();
@ -28,85 +40,34 @@ namespace Catswords.DataType.Client
}
// Get first 4 bytes from the file.
fileMagic = Helper.FileMagic.Read(filePath);
var extractor = new FileMagicExtractor(FilePath);
FileMagic = extractor.GetString();
// Show file magic to the label
label1.Text = "#0x" + fileMagic;
if (Helper.FileMagic.Error != string.Empty)
label1.Text = "#0x" + FileMagic;
if (extractor.GetError() != null)
{
textBox1.Text = Helper.FileMagic.Error;
ShowStatus(extractor.GetError());
}
// Get file name and file extension
try
{
fileExtension = Path.GetExtension(filePath);
fileName = Path.GetFileName(filePath);
if (fileExtension.Length > 0 && fileExtension.Substring(0, 1) == ".")
FileExtension = Path.GetExtension(FilePath);
FileName = Path.GetFileName(FilePath);
if (FileExtension.Length > 0 && FileExtension.Substring(0, 1) == ".")
{
fileExtension = fileExtension.Substring(1);
FileExtension = FileExtension.Substring(1);
}
}
catch
{
fileExtension = "";
fileName = "";
FileExtension = "";
FileName = "";
}
// Request a timeline
var search = new Helper.Timeline("catswords.social", "HDVTEfLswvSJZq5MRpim2tp7DifTcgKbMl0mBM5-uHw");
// fetch data by file magic
search.Fetch("0x" + fileMagic);
// if PE format (ImpHash)
if (fileMagic.StartsWith("4d5a"))
{
try
{
string imphash = Helper.ImpHash.Calculate(filePath);
search.Fetch(imphash);
string companyInfo = Helper.FileCompany.Read(filePath);
search.Fetch(companyInfo);
textBox1.Text = "ImpHash=" + imphash + "; CompanyInfo=" + companyInfo;
}
catch (Exception ex)
{
textBox1.Text = ex.Message;
}
}
// fetch data by file extension
if (fileExtension.Length > 0)
{
search.Fetch(fileExtension);
// if Office365 format
if (fileExtension.StartsWith("xls") || fileExtension.StartsWith("ppt") || fileExtension.StartsWith("doc"))
{
search.Fetch("office365");
}
}
// if it contains ransomware keywords
if (fileName.ToLower().Contains("readme") || fileName.ToLower().Contains("decrypt"))
{
search.Fetch("ransomware");
}
// if IoC (Indicators of Compomise) mode
if (fileMagic == "58354f") // EICAR test file header
{
search.Fetch("ioc");
}
// Show the timeline
foreach (Indicator ind in search.Indicators)
{
listView1.Items.Add(new ListViewItem(new string[] { ind.CreatedAt, ind.Content }));
}
// Run the worker
(new Worker1(this)).Run();
}
public string OpenFileDialog()
@ -125,9 +86,56 @@ namespace Catswords.DataType.Client
return filePath;
}
public void AddIndicator(DateTime dt, string Description, int ImageIndex)
{
if (listView1.InvokeRequired) {
listView1.Invoke(new MethodInvoker(delegate
{
listView1.Items.Add(new ListViewItem(new string[] { dt.ToString(), Description }, ImageIndex));
}));
}
else
{
listView1.Items.Add(new ListViewItem(new string[] { dt.ToString(), Description }, ImageIndex));
}
}
public void ShowStatus(string status)
{
if (textBox1.InvokeRequired)
{
textBox1.Invoke(new MethodInvoker(delegate
{
textBox1.Text = status;
}));
}
else
{
textBox1.Text = status;
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://catswords.social/auth/sign_up");
}
private void button1_Click(object sender, EventArgs e)
{
Form form = new Form
{
Text = "Expert",
FormBorderStyle = FormBorderStyle.FixedSingle,
Icon = Properties.Resources.icon,
MaximizeBox = false,
MinimizeBox = false,
Width = 450,
Height = 560,
BackColor = System.Drawing.SystemColors.Window
};
form.Controls.Add(new UserControl2(this));
form.Show();
}
}
}

View File

@ -0,0 +1,313 @@
namespace Catswords.DataType.Client
{
partial class UserControl2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.labelTitle = new System.Windows.Forms.Label();
this.txtLocale = new System.Windows.Forms.TextBox();
this.txtExtension = new System.Windows.Forms.TextBox();
this.txtHashSha256 = new System.Windows.Forms.TextBox();
this.txtMagic = new System.Windows.Forms.TextBox();
this.txtHashCrc32 = new System.Windows.Forms.TextBox();
this.txtHashSha1 = new System.Windows.Forms.TextBox();
this.txtHashMd5 = new System.Windows.Forms.TextBox();
this.labelLocale = new System.Windows.Forms.Label();
this.labelExtension = new System.Windows.Forms.Label();
this.labelSha256 = new System.Windows.Forms.Label();
this.labelHead32 = new System.Windows.Forms.Label();
this.labelCrc32 = new System.Windows.Forms.Label();
this.labelSha1 = new System.Windows.Forms.Label();
this.labelMd5 = new System.Windows.Forms.Label();
this.labelInfoHash = new System.Windows.Forms.Label();
this.txtInfoHash = new System.Windows.Forms.TextBox();
this.labelTools = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.txtSsdeep = new System.Windows.Forms.TextBox();
this.labelSsdeep = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// labelTitle
//
this.labelTitle.AutoSize = true;
this.labelTitle.BackColor = System.Drawing.Color.Transparent;
this.labelTitle.Font = new System.Drawing.Font("Arial", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTitle.Location = new System.Drawing.Point(136, 65);
this.labelTitle.Name = "labelTitle";
this.labelTitle.Size = new System.Drawing.Size(105, 34);
this.labelTitle.TabIndex = 0;
this.labelTitle.Text = "Expert";
//
// txtLocale
//
this.txtLocale.Location = new System.Drawing.Point(129, 415);
this.txtLocale.Name = "txtLocale";
this.txtLocale.Size = new System.Drawing.Size(284, 20);
this.txtLocale.TabIndex = 1;
//
// txtExtension
//
this.txtExtension.Location = new System.Drawing.Point(129, 308);
this.txtExtension.Name = "txtExtension";
this.txtExtension.Size = new System.Drawing.Size(284, 20);
this.txtExtension.TabIndex = 1;
this.txtExtension.Text = "Calculating...";
//
// txtHashSha256
//
this.txtHashSha256.Location = new System.Drawing.Point(129, 272);
this.txtHashSha256.Name = "txtHashSha256";
this.txtHashSha256.Size = new System.Drawing.Size(284, 20);
this.txtHashSha256.TabIndex = 1;
this.txtHashSha256.Text = "Calculating...";
//
// txtMagic
//
this.txtMagic.Location = new System.Drawing.Point(129, 236);
this.txtMagic.Name = "txtMagic";
this.txtMagic.Size = new System.Drawing.Size(284, 20);
this.txtMagic.TabIndex = 1;
this.txtMagic.Text = "Calculating...";
//
// txtHashCrc32
//
this.txtHashCrc32.Location = new System.Drawing.Point(129, 200);
this.txtHashCrc32.Name = "txtHashCrc32";
this.txtHashCrc32.Size = new System.Drawing.Size(284, 20);
this.txtHashCrc32.TabIndex = 1;
this.txtHashCrc32.Text = "Calculating...";
//
// txtHashSha1
//
this.txtHashSha1.Location = new System.Drawing.Point(129, 166);
this.txtHashSha1.Name = "txtHashSha1";
this.txtHashSha1.Size = new System.Drawing.Size(284, 20);
this.txtHashSha1.TabIndex = 1;
this.txtHashSha1.Text = "Calculating...";
//
// txtHashMd5
//
this.txtHashMd5.Location = new System.Drawing.Point(129, 132);
this.txtHashMd5.Name = "txtHashMd5";
this.txtHashMd5.Size = new System.Drawing.Size(284, 20);
this.txtHashMd5.TabIndex = 1;
this.txtHashMd5.Text = "Calculating...";
//
// labelLocale
//
this.labelLocale.AutoSize = true;
this.labelLocale.Location = new System.Drawing.Point(30, 419);
this.labelLocale.Name = "labelLocale";
this.labelLocale.Size = new System.Drawing.Size(39, 13);
this.labelLocale.TabIndex = 0;
this.labelLocale.Text = "Locale";
//
// labelExtension
//
this.labelExtension.AutoSize = true;
this.labelExtension.Location = new System.Drawing.Point(30, 311);
this.labelExtension.Name = "labelExtension";
this.labelExtension.Size = new System.Drawing.Size(53, 13);
this.labelExtension.TabIndex = 0;
this.labelExtension.Text = "Extension";
//
// labelSha256
//
this.labelSha256.AutoSize = true;
this.labelSha256.Location = new System.Drawing.Point(30, 275);
this.labelSha256.Name = "labelSha256";
this.labelSha256.Size = new System.Drawing.Size(47, 13);
this.labelSha256.TabIndex = 0;
this.labelSha256.Text = "SHA256";
//
// labelHead32
//
this.labelHead32.AutoSize = true;
this.labelHead32.Location = new System.Drawing.Point(30, 239);
this.labelHead32.Name = "labelHead32";
this.labelHead32.Size = new System.Drawing.Size(36, 13);
this.labelHead32.TabIndex = 0;
this.labelHead32.Text = "Magic";
//
// labelCrc32
//
this.labelCrc32.AutoSize = true;
this.labelCrc32.Location = new System.Drawing.Point(30, 204);
this.labelCrc32.Name = "labelCrc32";
this.labelCrc32.Size = new System.Drawing.Size(41, 13);
this.labelCrc32.TabIndex = 0;
this.labelCrc32.Text = "CRC32";
//
// labelSha1
//
this.labelSha1.AutoSize = true;
this.labelSha1.Location = new System.Drawing.Point(30, 169);
this.labelSha1.Name = "labelSha1";
this.labelSha1.Size = new System.Drawing.Size(35, 13);
this.labelSha1.TabIndex = 0;
this.labelSha1.Text = "SHA1";
//
// labelMd5
//
this.labelMd5.AutoSize = true;
this.labelMd5.Location = new System.Drawing.Point(30, 135);
this.labelMd5.Name = "labelMd5";
this.labelMd5.Size = new System.Drawing.Size(30, 13);
this.labelMd5.TabIndex = 0;
this.labelMd5.Text = "MD5";
//
// labelInfoHash
//
this.labelInfoHash.AutoSize = true;
this.labelInfoHash.Location = new System.Drawing.Point(30, 348);
this.labelInfoHash.Name = "labelInfoHash";
this.labelInfoHash.Size = new System.Drawing.Size(50, 13);
this.labelInfoHash.TabIndex = 0;
this.labelInfoHash.Text = "InfoHash";
//
// txtInfoHash
//
this.txtInfoHash.Location = new System.Drawing.Point(129, 343);
this.txtInfoHash.Name = "txtInfoHash";
this.txtInfoHash.Size = new System.Drawing.Size(284, 20);
this.txtInfoHash.TabIndex = 1;
this.txtInfoHash.Text = "Calculating...";
//
// labelTools
//
this.labelTools.AutoSize = true;
this.labelTools.Font = new System.Drawing.Font("Segoe UI", 9F);
this.labelTools.Location = new System.Drawing.Point(31, 452);
this.labelTools.Name = "labelTools";
this.labelTools.Size = new System.Drawing.Size(34, 15);
this.labelTools.TabIndex = 6;
this.labelTools.Text = "Tools";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Segoe UI", 9F);
this.button1.Location = new System.Drawing.Point(129, 452);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(284, 23);
this.button1.TabIndex = 3;
this.button1.Text = "View on ByteViewer...";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Font = new System.Drawing.Font("Segoe UI", 9F);
this.button2.Location = new System.Drawing.Point(129, 481);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(284, 23);
this.button2.TabIndex = 7;
this.button2.Text = "View on VirusTotal...";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// txtSsdeep
//
this.txtSsdeep.Location = new System.Drawing.Point(129, 378);
this.txtSsdeep.Name = "txtSsdeep";
this.txtSsdeep.Size = new System.Drawing.Size(284, 20);
this.txtSsdeep.TabIndex = 9;
this.txtSsdeep.Text = "Calculating...";
//
// labelSsdeep
//
this.labelSsdeep.AutoSize = true;
this.labelSsdeep.Location = new System.Drawing.Point(30, 383);
this.labelSsdeep.Name = "labelSsdeep";
this.labelSsdeep.Size = new System.Drawing.Size(50, 13);
this.labelSsdeep.TabIndex = 8;
this.labelSsdeep.Text = "SSDEEP";
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window;
this.BackgroundImage = global::Catswords.DataType.Client.Properties.Resources.document_paperclip_list_paper_icon_219544;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(441, 526);
this.Controls.Add(this.txtSsdeep);
this.Controls.Add(this.labelSsdeep);
this.Controls.Add(this.button2);
this.Controls.Add(this.labelTools);
this.Controls.Add(this.button1);
this.Controls.Add(this.txtInfoHash);
this.Controls.Add(this.txtLocale);
this.Controls.Add(this.txtExtension);
this.Controls.Add(this.labelTitle);
this.Controls.Add(this.txtHashSha256);
this.Controls.Add(this.labelMd5);
this.Controls.Add(this.txtMagic);
this.Controls.Add(this.labelSha1);
this.Controls.Add(this.txtHashCrc32);
this.Controls.Add(this.labelCrc32);
this.Controls.Add(this.txtHashSha1);
this.Controls.Add(this.labelHead32);
this.Controls.Add(this.txtHashMd5);
this.Controls.Add(this.labelSha256);
this.Controls.Add(this.labelInfoHash);
this.Controls.Add(this.labelLocale);
this.Controls.Add(this.labelExtension);
this.Name = "Form2";
this.Text = "Expert";
this.Load += new System.EventHandler(this.Form2_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelTitle;
private System.Windows.Forms.TextBox txtLocale;
private System.Windows.Forms.TextBox txtExtension;
private System.Windows.Forms.TextBox txtHashSha256;
private System.Windows.Forms.TextBox txtMagic;
private System.Windows.Forms.TextBox txtHashCrc32;
private System.Windows.Forms.TextBox txtHashSha1;
private System.Windows.Forms.TextBox txtHashMd5;
private System.Windows.Forms.Label labelLocale;
private System.Windows.Forms.Label labelExtension;
private System.Windows.Forms.Label labelSha256;
private System.Windows.Forms.Label labelHead32;
private System.Windows.Forms.Label labelCrc32;
private System.Windows.Forms.Label labelSha1;
private System.Windows.Forms.Label labelMd5;
private System.Windows.Forms.Label labelInfoHash;
private System.Windows.Forms.TextBox txtInfoHash;
private System.Windows.Forms.Label labelTools;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox txtSsdeep;
private System.Windows.Forms.Label labelSsdeep;
}
}

View File

@ -0,0 +1,102 @@
using Catswords.DataType.Client.Helper;
using Catswords.DataType.Client.Model;
using System;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Catswords.DataType.Client
{
public partial class UserControl2 : UserControl
{
private UserControl1 Parent;
private HashInfo CalculatedHashInfo = new HashInfo();
public UserControl2(UserControl1 parent)
{
InitializeComponent();
Parent = parent;
}
private void Form2_Load(object sender, EventArgs e)
{
new Task(() =>
{
var hasher = new FileHasher(Parent.FilePath);
txtExtension.Invoke(new MethodInvoker(delegate
{
txtExtension.Text = hasher.GetExtension();
CalculatedHashInfo.Extension = txtExtension.Text;
}));
txtMagic.Invoke(new MethodInvoker(delegate
{
txtMagic.Text = hasher.GetMagic();
CalculatedHashInfo.Extension = txtMagic.Text;
}));
txtHashMd5.Invoke(new MethodInvoker(delegate
{
txtHashMd5.Text = hasher.GetMD5();
CalculatedHashInfo.MD5 = txtHashMd5.Text;
}));
txtHashSha1.Invoke(new MethodInvoker(delegate
{
txtHashSha1.Text = hasher.GetSHA1();
CalculatedHashInfo.SHA1 = txtHashSha1.Text;
}));
txtHashCrc32.Invoke(new MethodInvoker(delegate
{
txtHashCrc32.Text = hasher.GetCRC32();
CalculatedHashInfo.CRC32 = txtHashCrc32.Text;
}));
txtHashSha256.Invoke(new MethodInvoker(delegate
{
txtHashSha256.Text = hasher.GetSHA256();
CalculatedHashInfo.SHA256 = txtHashSha256.Text;
}));
txtInfoHash.Invoke(new MethodInvoker(delegate
{
txtInfoHash.Text = hasher.GetInfoHash();
CalculatedHashInfo.InfoHash = txtInfoHash.Text;
}));
txtSsdeep.Invoke(new MethodInvoker(delegate
{
txtSsdeep.Text = hasher.GetSSDEEP();
CalculatedHashInfo.SSDEEP = txtSsdeep.Text;
}));
CalculatedHashInfo.CreatedAt = DateTime.Now;
CalculatedHashInfo.UpdatedAt = CalculatedHashInfo.CreatedAt;
}).Start();
}
private void button1_Click(object sender, EventArgs e)
{
ByteViewer bv = new ByteViewer();
bv.SetFile(Parent.FilePath); // or SetBytes
Form newForm = new Form();
newForm.Size = new System.Drawing.Size(650, 600);
newForm.Text = "ByteViewer";
newForm.Icon = Properties.Resources.icon;
newForm.MinimizeBox = false;
newForm.MaximizeBox = false;
newForm.FormBorderStyle = FormBorderStyle.FixedSingle;
newForm.Controls.Add(bv);
newForm.Show();
}
private void button2_Click(object sender, EventArgs e)
{
Process.Start("https://www.virustotal.com/gui/file/" + CalculatedHashInfo.SHA256);
}
}
}

View File

@ -0,0 +1,167 @@
using Catswords.DataType.Client.Helper;
using Catswords.DataType.Client.Model;
using MetadataExtractor;
using System;
using System.Threading.Tasks;
namespace Catswords.DataType.Client
{
public class Worker1
{
private UserControl1 Parent;
public Worker1(UserControl1 parent)
{
Parent = parent;
}
public void FromFileExtension()
{
var search = new FileExtensionDatabase();
search.Fetch(Parent.FileExtension);
foreach (TimelineMessage ind in search.Indicators)
{
Parent.AddIndicator(ind.CreatedAt, ind.Content, 0);
}
}
public void FromTimeline()
{
// Request a timeline
var search = new Timeline(Config.MASTODON_HOST, Config.MASTODON_ACCESS_TOKEN);
// fetch data by file magic
search.Fetch("0x" + Parent.FileMagic);
// if PE format (ImpHash)
if (Parent.FileMagic.StartsWith("4d5a"))
{
try
{
string imphash = ImpHash.Calculate(Parent.FilePath);
search.Fetch(imphash);
string organization = (new PeOrganizationExtractor(Parent.FilePath)).GetString();
search.Fetch(organization);
Parent.AddIndicator(DateTime.Now, "This file are distributed by " + organization, 4);
Parent.ShowStatus("ImpHash=" + imphash + "; Organization=" + organization);
}
catch (Exception ex)
{
Parent.ShowStatus(ex.Message);
}
}
// fetch data by file extension
if (Parent.FileExtension.Length > 0)
{
search.Fetch(Parent.FileExtension);
// if Office365 format
if (Parent.FileExtension.StartsWith("xls") || Parent.FileExtension.StartsWith("ppt") || Parent.FileExtension.StartsWith("doc"))
{
if (Parent.FileExtension == "xlsx" || Parent.FileExtension == "pptx" || Parent.FileExtension == "docx")
{
FromOpenXML();
}
search.Fetch("msoffice");
search.Fetch("office365");
}
}
// if it contains ransomware keywords
if (Parent.FileName.ToLower().Contains("readme") || Parent.FileName.ToLower().Contains("decrypt"))
{
search.Fetch("ransomware");
}
// if IoC (Indicators of Compomise) mode
if (Parent.FileMagic == "58354f") // EICAR test file header
{
search.Fetch("malware");
}
// Show the timeline
foreach (TimelineMessage ind in search.Messages)
{
Parent.AddIndicator(ind.CreatedAt, ind.Content, 1);
}
}
public void FromAndroidManifest()
{
if (Parent.FileExtension == "apk")
{
var extractor = new ApkManifestExtractor(Parent.FilePath);
extractor.Open();
foreach (AndroidPermission perm in extractor.GetPermissions())
{
Parent.AddIndicator(perm.CreatedAt, perm.Name + ' ' + perm.Description, 2);
}
extractor.Close();
}
}
public void FromOpenXML()
{
var extractor = new OpenXMLExtractor(Parent.FilePath);
extractor.Open();
var metadata = extractor.GetMetadata();
Parent.AddIndicator(DateTime.Now, "Author: " + metadata.Author, 3);
Parent.AddIndicator(DateTime.Now, "Title: " + metadata.Title, 3);
Parent.AddIndicator(DateTime.Now, "Subject: " + metadata.Subject, 3);
Parent.AddIndicator(DateTime.Now, "Category: " + metadata.Category, 3);
Parent.AddIndicator(DateTime.Now, "Description: " + metadata.Description, 3);
Parent.AddIndicator(DateTime.Now, "Created: " + metadata.CreatedAt.ToString(), 3);
Parent.AddIndicator(DateTime.Now, "Last updated: " + metadata.UpdatedAt.ToString(), 3);
Parent.AddIndicator(DateTime.Now, "Last updated by: " + metadata.LastUpdatedBy, 3);
Parent.AddIndicator(DateTime.Now, "Last printed: " + metadata.LastPrintedAt, 3);
extractor.Close();
}
public void FromLinks()
{
var extractor = new LinkExtractor(Parent.FilePath);
var strings = extractor.GetStrings();
foreach (string str in strings)
{
Parent.AddIndicator(DateTime.Now, str, 4);
}
}
public void FromExif()
{
var extractor = new ExifTagExtractor(Parent.FilePath);
var tags = extractor.GetTags();
foreach (ExifTag tag in tags)
{
Parent.AddIndicator(DateTime.Now, $"{tag.Name} ({tag.Section}): {tag.Description}", 5);
}
}
public void FormCfbf()
{
var extractor = new CfbfExtractor(Parent.FilePath);
var parts = extractor.GetParts();
foreach (CfbfPartInfo part in parts)
{
Parent.AddIndicator(DateTime.Now, $"CFBF: {part.Content} ({part.ContentType}, {part.URI})", 5);
}
}
public void Run()
{
new Task(() =>
{
FromFileExtension(); // Get data from file extension database
FromAndroidManifest(); // Get data from Android manifest
FromTimeline(); // Get data from timeline
FromLinks(); // Get links from file
FromExif(); // Get EXIF tags from file
FormCfbf(); // Get CFBF (aka. OLE) parts from file
}).Start();
}
}
}

View File

@ -1,4 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Crc32.NET" version="1.2.0" targetFramework="net48" />
<package id="MetadataExtractor" version="2.8.1" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net48" />
<package id="System.IO.Packaging" version="8.0.0" targetFramework="net48" />
<package id="System.IO.Pipelines" version="8.0.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="XmpCore" version="6.1.10.1" targetFramework="net48" />
</packages>

Binary file not shown.

View File

@ -1,5 +1,5 @@
# SocialOnTheFile
Social on the file - Mastodon integration to Windows File Property Sheet
Social on the file - File reputation checker with Social media timeline
## Screenshot
![Screenshot](screenshot.png)
@ -7,11 +7,12 @@ Social on the file - Mastodon integration to Windows File Property Sheet
## Key features
* Get a reputations by file magic header, file extension from ActivityPub network
* ImpHash support for PE file format
* Torrent InfoHash support
## Related projects
* [github.com/Mastodon/Mastodon](https://github.com/Mastodon/Mastodon)
* [github.com/dwmkerr/sharpshell](https://github.com/dwmkerr/sharpshell)
* [Catswords FileType Directory](https://exts.kr)
* [github.com/gnh1201/CatswordsTab](https://github.com/gnh1201/CatswordsTab)
* [github.com/Mastodon/Mastodon](https://github.com/Mastodon/Mastodon)
## Contact me
- abuse@catswords.net

View File

@ -3,10 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocialOnTheFile", "SocialOnTheFile\SocialOnTheFile.csproj", "{35CC3E28-05C8-478B-B5A2-15FCE468CE34}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Catswords.DataType.Client", "Catswords.DataType.Client\Catswords.DataType.Client.csproj", "{72A9E640-F785-4202-9CEA-BEC46A9B09B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SsdeepNET", "..\..\..\OneDrive\문서\GitHub\SsdeepNET\Source\SsdeepNET\SsdeepNET.csproj", "{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AndroidXml", "..\..\..\OneDrive\문서\GitHub\androidxmldotnet\AndroidXml\AndroidXml.csproj", "{607EEB2C-6B7C-409E-959E-3B458A109426}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -17,18 +19,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Debug|x64.ActiveCfg = Debug|x64
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Debug|x64.Build.0 = Debug|x64
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Debug|x86.ActiveCfg = Debug|x86
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Debug|x86.Build.0 = Debug|x86
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Release|Any CPU.Build.0 = Release|Any CPU
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Release|x64.ActiveCfg = Release|x64
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Release|x64.Build.0 = Release|x64
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Release|x86.ActiveCfg = Release|x86
{35CC3E28-05C8-478B-B5A2-15FCE468CE34}.Release|x86.Build.0 = Release|x86
{72A9E640-F785-4202-9CEA-BEC46A9B09B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72A9E640-F785-4202-9CEA-BEC46A9B09B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72A9E640-F785-4202-9CEA-BEC46A9B09B8}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -41,6 +31,30 @@ Global
{72A9E640-F785-4202-9CEA-BEC46A9B09B8}.Release|x64.Build.0 = Release|Any CPU
{72A9E640-F785-4202-9CEA-BEC46A9B09B8}.Release|x86.ActiveCfg = Release|Any CPU
{72A9E640-F785-4202-9CEA-BEC46A9B09B8}.Release|x86.Build.0 = Release|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Debug|x64.ActiveCfg = Debug|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Debug|x64.Build.0 = Debug|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Debug|x86.ActiveCfg = Debug|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Debug|x86.Build.0 = Debug|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Release|Any CPU.Build.0 = Release|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Release|x64.ActiveCfg = Release|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Release|x64.Build.0 = Release|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Release|x86.ActiveCfg = Release|Any CPU
{B1244C5A-CDEB-4D1D-8807-BF40251ABCAB}.Release|x86.Build.0 = Release|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Debug|Any CPU.Build.0 = Debug|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Debug|x64.ActiveCfg = Debug|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Debug|x64.Build.0 = Debug|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Debug|x86.ActiveCfg = Debug|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Debug|x86.Build.0 = Debug|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Release|Any CPU.ActiveCfg = Release|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Release|Any CPU.Build.0 = Release|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Release|x64.ActiveCfg = Release|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Release|x64.Build.0 = Release|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Release|x86.ActiveCfg = Release|Any CPU
{607EEB2C-6B7C-409E-959E-3B458A109426}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,101 +0,0 @@
using System;
using System.Diagnostics;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
namespace SocialOnTheFile.Helper
{
public static class FileCompany
{
static public string Read(string filePath)
{
// 회사 정보 추출
string[] companies = new string[] {
GetCompanyInfo(filePath),
GetProductName(filePath),
GetCopyrightInfo(filePath),
GetOrganization(filePath)
};
foreach (string company in companies)
{
if (company != null && !company.Equals(string.Empty))
{
return company;
}
}
return "Unknown";
}
public static string GetOrganization(string filePath)
{
string organization = string.Empty;
// 서명된 파일인 경우 인증서 정보 추출
X509Certificate2 certificate = GetCertificateInfo(filePath);
if (certificate != null)
{
// Subject 필드에서 O (Organization) 값을 찾아 회사 정보 추출
string[] fields = certificate.Subject.Split(',');
foreach (string field in fields)
{
string[] keyValue = field.Trim().Split('=');
if (keyValue.Length == 2 && keyValue[0].Trim().Equals("O", StringComparison.OrdinalIgnoreCase))
{
organization = keyValue[1].Trim();
}
}
}
return organization;
}
public static string GetCompanyInfo(string filePath)
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
return versionInfo.CompanyName;
}
public static string GetProductName(string filePath)
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
return versionInfo.ProductName;
}
public static string GetCopyrightInfo(string filePath)
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
return versionInfo.LegalCopyright;
}
static X509Certificate2 GetCertificateInfo(string filePath)
{
// GetCertificateInfo 구현
try
{
// 파일에 디지털 서명이 있는지 확인
Assembly assembly = Assembly.LoadFile(filePath);
X509Certificate2 certificate = new X509Certificate2(assembly.Location);
// 서명이 유효한지 확인 (옵션)
X509Chain chain = new X509Chain();
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; // 여러 인증서를 사용하는 경우 인증서 연쇄를 무시할 수 있습니다.
if (chain.Build(certificate))
{
return certificate;
}
else
{
return null;
}
}
catch
{
return null;
}
}
}
}

View File

@ -1,36 +0,0 @@
using System;
using System.IO;
namespace SocialOnTheFile.Helper
{
public static class FileMagic
{
public static string Error = string.Empty;
public static string Read(string filePath)
{
string hexString = "";
try
{
// 파일 열기
using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
// 첫 3 바이트 읽기
byte[] buffer = new byte[3] { 0x00, 0x00, 0x00 };
int bytesRead = fs.Read(buffer, 0, 3);
// 16진수로 변환하여 출력
hexString = BitConverter.ToString(buffer).Replace("-", string.Empty).ToLower();
}
}
catch (Exception ex)
{
hexString = "000000";
Error = ex.Message;
}
return hexString;
}
}
}

View File

@ -1,68 +0,0 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace SocialOnTheFile.Helper
{
public static class ImpHash
{
public static string Calculate(string filePath)
{
string imphash = "";
using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
using (BinaryReader binaryReader = new BinaryReader(fileStream))
{
// DOS Header 크기만큼 스킵
binaryReader.BaseStream.Seek(0x3C, SeekOrigin.Begin);
int peHeaderOffset = binaryReader.ReadInt32();
// PE Header로 이동
binaryReader.BaseStream.Seek(peHeaderOffset, SeekOrigin.Begin);
// Signature 확인
uint signature = binaryReader.ReadUInt32();
if (signature != 0x00004550) // "PE\0\0"
{
throw new InvalidOperationException("Invalid PE file");
}
// Optional Header에서 Import Table Offset 찾기
binaryReader.BaseStream.Seek(20, SeekOrigin.Current); // COFF 파일 헤더 크기만큼 스킵
ushort optionalHeaderSize = binaryReader.ReadUInt16();
binaryReader.BaseStream.Seek(42, SeekOrigin.Current); // ImageBase 크기만큼 스킵
int importTableOffset = peHeaderOffset + 24 + optionalHeaderSize;
binaryReader.BaseStream.Seek(importTableOffset, SeekOrigin.Begin);
// Import Table에서 imphash 생성
StringBuilder imphashBuilder = new StringBuilder();
while (true)
{
uint lookupTableRVA = binaryReader.ReadUInt32();
if (lookupTableRVA == 0)
{
break;
}
binaryReader.BaseStream.Seek(12, SeekOrigin.Current); // 다른 필드들을 스킵
binaryReader.BaseStream.Seek(4, SeekOrigin.Current); // 항상 0인 TimeDateStamp 필드를 스킵
imphashBuilder.Append(lookupTableRVA.ToString("X8"));
}
// MD5 해시 생성
using (MD5 md5 = MD5.Create())
{
byte[] hashBytes = md5.ComputeHash(Encoding.ASCII.GetBytes(imphashBuilder.ToString()));
imphash = BitConverter.ToString(hashBytes).Replace("-", string.Empty).ToLower();
}
}
}
return imphash;
}
}
}

View File

@ -1,90 +0,0 @@
using Newtonsoft.Json.Linq;
using SocialOnTheFile.Model;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SocialOnTheFile.Helper
{
public class Timeline
{
public string ApiBaseUrl;
public string AccessToken;
public List<Indicator> Indicators;
public string ResponseText;
public Timeline(string host, string access_token)
{
ApiBaseUrl = $"https://{host}/api/v1/timelines/tag";
AccessToken = access_token;
Indicators = new List<Indicator>();
}
public static string RemoveHtmlTags(string input)
{
// 정규 표현식을 사용하여 HTML 태그 제거
string pattern = "<.*?>";
string replacement = "";
Regex regex = new Regex(pattern);
string result = regex.Replace(input, replacement);
return result;
}
public static string FormatDateTime(string dateString)
{
string formattedDateTime = "";
// 날짜와 시간을 파싱
if (DateTime.TryParseExact(dateString, "MM/dd/yyyy HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out DateTime parsedDateTime))
{
// UTC에서 로컬 시간으로 변환
DateTime localTime = parsedDateTime.ToLocalTime();
// 현재 스레드의 문화권에 따라 날짜와 시간 출력
formattedDateTime = localTime.ToString();
}
return formattedDateTime;
}
public void Fetch(string q)
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {AccessToken}");
try
{
// 데이터 요청
Task<HttpResponseMessage> responseTask = client.GetAsync($"{ApiBaseUrl}/{q}");
responseTask.Wait();
// 응답 본문 저장
HttpResponseMessage response = responseTask.Result;
Task<string> readAsStringTask = response.Content.ReadAsStringAsync();
readAsStringTask.Wait();
ResponseText = readAsStringTask.Result;
// JSON 파싱
JArray statuses = JArray.Parse(ResponseText);
foreach (var status in statuses)
{
string createdAt = status["created_at"].Value<string>();
string content = status["content"].Value<string>();
Indicators.Add(new Indicator
{
CreatedAt = FormatDateTime(createdAt),
Content = RemoveHtmlTags(content)
});
}
}
catch { }
}
}
}
}

View File

@ -1,10 +0,0 @@
namespace SocialOnTheFile.Model
{
public class Indicator
{
public string Id { get; set; }
public string Content { get; set; }
public string Url { get; set; }
public string CreatedAt { get; set; }
}
}

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("SocialOnTheFile")]
[assembly: AssemblyDescription("SocialOnTheFile")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Catswords Research")]
[assembly: AssemblyProduct("SocialOnTheFile")]
[assembly: AssemblyCopyright("(C) 2023, Catswords Research.")]
[assembly: AssemblyTrademark("SocialOnTheFile")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(true)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("35cc3e28-05c8-478b-b5a2-15fce468ce34")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,73 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SocialOnTheFile.Properties {
using System;
/// <summary>
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
/// </summary>
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
// 클래스에서 자동으로 생성되었습니다.
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SocialOnTheFile.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
/// 재정의합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap image1 {
get {
object obj = ResourceManager.GetObject("image1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="image1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\image1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,135 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{35CC3E28-05C8-478B-B5A2-15FCE468CE34}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>SocialOnTheFile</RootNamespace>
<AssemblyName>SocialOnTheFile</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>true</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>signature.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SharpShell, Version=2.7.2.0, Culture=neutral, PublicKeyToken=f14dc899472fe6fb, processorArchitecture=MSIL">
<HintPath>..\packages\SharpShell.2.7.2\lib\net40-client\SharpShell.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Helper\FileCompany.cs" />
<Compile Include="Helper\ImpHash.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SocialOnTheFileSheet.cs" />
<Compile Include="Helper\FileMagic.cs" />
<Compile Include="Helper\Timeline.cs" />
<Compile Include="Model\Indicator.cs" />
<Compile Include="SocialOnTheFilePage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SocialOnTheFilePage.Designer.cs">
<DependentUpon>SocialOnTheFilePage.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="SocialOnTheFilePage.resx">
<DependentUpon>SocialOnTheFilePage.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="signature.snk" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\image1.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,133 +0,0 @@
namespace SocialOnTheFile
{
partial class SocialOnTheFilePage
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(123, 63);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(118, 42);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(13, 126);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(347, 277);
this.listView1.TabIndex = 3;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "CreatedAt";
this.columnHeader1.Width = 120;
//
// columnHeader2
//
this.columnHeader2.Text = "Content";
this.columnHeader2.Width = 200;
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(10, 417);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(122, 13);
this.linkLabel1.TabIndex = 4;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "Write a review to this file";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(127, 46);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(118, 16);
this.label2.TabIndex = 5;
this.label2.Text = "Conversations with";
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.Color.White;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Location = new System.Drawing.Point(11, 446);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(349, 13);
this.textBox1.TabIndex = 6;
//
// SocialOnTheFilePage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.BackgroundImage = global::SocialOnTheFile.Properties.Resources.image1;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.listView1);
this.Controls.Add(this.label1);
this.DoubleBuffered = true;
this.Name = "SocialOnTheFilePage";
this.Size = new System.Drawing.Size(491, 477);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox1;
}
}

View File

@ -1,149 +0,0 @@
using SharpShell.Attributes;
using SharpShell.SharpPropertySheet;
using SocialOnTheFile.Model;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace SocialOnTheFile
{
[ComVisible(true)]
[COMServerAssociation(AssociationType.AllFiles)]
public partial class SocialOnTheFilePage: SharpPropertyPage
{
private string filePath;
private string fileMagic;
private string fileName;
private string fileExtension;
/// <summary>
/// Initializes a new instance of the <see cref="SocialOnTheFilePage"/> class.
/// </summary>
public SocialOnTheFilePage()
{
InitializeComponent();
// Set the page title.
PageTitle = "FileToots";
// Note: You can also set the icon to be used:
// PageIcon = Properties.Resources.SomeIcon;
}
/// <summary>
/// Called when the page is initialised.
/// </summary>
/// <param name="parent">The parent property sheet.</param>
protected override void OnPropertyPageInitialised(SharpPropertySheet parent)
{
// Store the file path.
filePath = parent.SelectedItemPaths.First();
// Get first 4 bytes from the file.
fileMagic = Helper.FileMagic.Read(filePath);
// Show file magic to the label
label1.Text = "#0x" + fileMagic;
if (Helper.FileMagic.Error != string.Empty)
{
textBox1.Text = Helper.FileMagic.Error;
}
// Get file name and file extension
try
{
fileExtension = Path.GetExtension(filePath);
fileName = Path.GetFileName(filePath);
if (fileExtension.Length > 0 && fileExtension.Substring(0, 1) == ".")
{
fileExtension = fileExtension.Substring(1);
}
}
catch
{
fileExtension = "";
fileName = "";
}
// Request a timeline
var search = new Helper.Timeline("catswords.social", "HDVTEfLswvSJZq5MRpim2tp7DifTcgKbMl0mBM5-uHw");
// fetch data by file magic
search.Fetch("0x" + fileMagic);
// if PE format (ImpHash)
if (fileMagic.StartsWith("4d5a"))
{
try
{
string imphash = Helper.ImpHash.Calculate(filePath);
search.Fetch(imphash);
string companyInfo = Helper.FileCompany.Read(filePath);
search.Fetch(companyInfo);
textBox1.Text = "ImpHash=" + imphash + "; CompanyInfo=" + companyInfo;
}
catch (Exception ex)
{
textBox1.Text = ex.Message;
}
}
// fetch data by file extension
if (fileExtension.Length > 0)
{
search.Fetch(fileExtension);
// if Office365 format
if (fileExtension.StartsWith("xls") || fileExtension.StartsWith("ppt") || fileExtension.StartsWith("doc"))
{
search.Fetch("office365");
}
}
// if it contains ransomware keywords
if (fileName.ToLower().Contains("readme") || fileName.ToLower().Contains("decrypt"))
{
search.Fetch("ransomware");
}
// if IoC (Indicators of Compomise) mode
if (fileMagic == "58354f") // EICAR test file header
{
search.Fetch("ioc");
}
// Show the timeline
foreach (Indicator ind in search.Indicators)
{
listView1.Items.Add(new ListViewItem(new string[] { ind.CreatedAt, ind.Content }));
}
}
/// <summary>
/// Called when apply is pressed on the property sheet, or the property
/// sheet is dismissed with the OK button.
/// </summary>
protected override void OnPropertySheetApply()
{
// code here
}
/// <summary>
/// Called when OK is pressed on the property sheet.
/// </summary>
protected override void OnPropertySheetOK()
{
// code here
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://catswords.social/");
}
}
}

View File

@ -1,44 +0,0 @@
using SharpShell.Attributes;
using SharpShell.SharpPropertySheet;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
namespace SocialOnTheFile
{
/// <summary>
/// The ResourcesPropertySheet is a shell extension to show the managed
/// and unmanaged resources containing in binary files.
/// </summary>
[ComVisible(true)]
[COMServerAssociation(AssociationType.AllFiles)]
public class SocialOnTheFileSheet : SharpPropertySheet
{
/// <summary>
/// Determines whether this instance can show a shell property sheet, given the specified selected file list.
/// </summary>
/// <returns>
/// <c>true</c> if this instance should show a shell property sheet for the specified file list; otherwise, <c>false</c>.
/// </returns>
protected override bool CanShowSheet()
{
// We will only show the resources pages if we have ONE file selected.
return SelectedItemPaths.Count() == 1;
}
/// <summary>
/// Creates the pages.
/// </summary>
/// <returns>
/// The property sheet pages.
/// </returns>
protected override IEnumerable<SharpPropertyPage> CreatePages()
{
// Create the property sheet page.
var page = new SocialOnTheFilePage();
// Return the pages we've created.
return new[] { page };
}
}
}

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="SharpShell" publicKeyToken="f14dc899472fe6fb" culture="neutral" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="SharpShell" version="2.7.2" targetFramework="net472" />
</packages>

Binary file not shown.

1
SsdeepNET Submodule

@ -0,0 +1 @@
Subproject commit d784d516ee0a39be5deca0cd56fd2ebc7bca5aec

1
androidxmldotnet Submodule

@ -0,0 +1 @@
Subproject commit 58401c6c90a41c43fdcc610259e13ffcf520fe69

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 326 KiB