Skip to content

Instantly share code, notes, and snippets.

View CynicRus's full-sized avatar
🌴
On vacation

Aleksandr Vorobiev CynicRus

🌴
On vacation
View GitHub Profile
@CynicRus
CynicRus / guide.txt
Last active May 9, 2025 16:27
simple zlib install for Mingw64 for Windows
1) Download source code from https://github.com/madler/zlib/
2) Unpack
3) Using powershell or cmd and navigate to the unpacked source folder
4) mkdir build
5) cd build
6) cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:/mingw64 ..
7) mingw32-make
8) mingw32-make install
same for liblzma
@CynicRus
CynicRus / .py
Created April 14, 2025 20:34
watcom_rtti_parser
# Скрипт для IDA => 9, для разбора RTTI от Watcom C++ какой-то версии 1999 года
# Воссоздает структуру классов
# Автор: CynicRus, 2025 год.
import idautils
import idaapi
import idc
import ida_bytes
import ida_name
import ida_funcs
program UsbMonitor;
{$mode objfpc}{$H+}
uses
dl, BaseUnix, Unix, SysUtils;
const
LIBUDEV_SO = 'libudev.so.1';
@CynicRus
CynicRus / read_mft.ps1
Created February 13, 2025 11:12
Read Master Fat Table by Powershell > 7
param(
[Parameter(Mandatory=$true)]
[ValidatePattern('^[A-Za-z]$')]
[string]$DriveLetter
)
# Структура загрузочного сектора NTFS
$NTFSBootSectorFormat = @{
JumpInstruction = 0..2
OemID = 3..10
@CynicRus
CynicRus / gist:5a2bd5a06a699cd0139aaff887f5cab5
Created May 11, 2024 17:41
build python2 on ubuntu 22.04
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
sudo tar xzf Python-2.7.9.tgz
cd Python-2.7.9
sudo ./configure --enable-optimizations
sudo make altinstall
sudo ln -sfn '/usr/local/bin/python2.7' '/usr/bin/python2'
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
@CynicRus
CynicRus / unfinder.py
Last active February 10, 2024 16:56
The script to output files in which the substring is not found
import os
import io
import argparse
def unfind_substr(directory, word):
files = os.listdir(directory)
finalFiles = []
for file in files:
filename = os.path.join(directory, file)
if os.path.isfile(filename):
USAGE: clang.exe [options] file...
OPTIONS:
-### Print (but do not run) the commands to run for this compilation
--amdgpu-arch-tool=<value>
Tool used for detecting AMD GPU arch in the system.
--analyzer-output <value>
Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).
--analyze Run the static analyzer
-arcmt-migrate-emit-errors
@CynicRus
CynicRus / .pas
Last active August 6, 2021 13:15
get windows key
const
CharMap: array [0..23] of char = 'BCDFGHJKMPQRTVWXY2346789';
var
ProductID: array of byte;
IdPart: array [0..14] of byte;
Registry: TRegistry;
DataSize: integer;
Key: ansistring;
i, j, c: integer;
begin
unit winevt_h;
{$ifdef FPC}
{$mode objfpc}{$H+}
{$EndIF}
interface
uses
Classes, SysUtils, Windows;
procedure SnappyDecompress(Input: TByteArray; Offset,
Length: integer; var Output: TByteArray);
var
i, l, o, c,targetIndex,SourceIndex,targetLength: integer;
function incPP(var AVal: integer): integer;
begin
result := AVal;
inc(AVal);
end;