Skip to content

Instantly share code, notes, and snippets.

View Konctantin's full-sized avatar
🎯
Focusing

Konctantin Konctantin

🎯
Focusing
View GitHub Profile
def AsByteStr(s, appendZero=True):
return (" ".join("%02X" % x for x in map(ord, s))) + (" 00" if appendZero else "")
def GetClientBuild():
ref = FindBinary(0, SEARCH_DOWN, AsByteStr("<Version>", False));
if ref == BADADDR:
raise BaseException("Can't find offset for "+name);
verStr = GetString(ref, -1, ASCSTR_C);
result = re.findall("(\d{5})", verStr);
print(verStr)
def AsByteStr(s, appendZero=True):
return (" ".join("%02X" % x for x in map(ord, s))) + (" 00" if appendZero else "")
def GetClientBuild():
ref = FindBinary(0, SEARCH_DOWN, AsByteStr("<Version>", False));
if ref == BADADDR:
raise BaseException("Can't find offset for "+name);
verStr = GetString(ref, -1, ASCSTR_C);
result = re.findall("(\d{5})", verStr);
print(verStr)
@Konctantin
Konctantin / ProcessMemory.cs
Created July 19, 2016 13:56
Process memory class for x64
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace CallFsEB
{
@Konctantin
Konctantin / ida_dark_theme.clr
Last active September 13, 2018 17:46
IDA Dark theme
[DISASM]
000000 //Instruction
aaaaaa //Directive
df69d2 //Macro name
b15cb1 //Register name
7f888c //Other keywords
005500 //Dummy data name
a4cfcf //Dummy code name
b9ebeb //Dummy unexplored name
1c0adf //Hidden name
function Get-WindowsKey {
param ($targets = ".")
$hklm = 2147483650
$regPath = "Software\Microsoft\Windows NT\CurrentVersion"
$regValue = "DigitalProductId"
Foreach ($target in $targets) {
$productKey = $null
$win32os = $null
$wmi = [WMIClass]"\\$target\root\default:stdRegProv"
$data = $wmi.GetBinaryValue($hklm,$regPath,$regValue)
-- drop TEMPORARY TABLE IF EXISTS tmp;
CREATE TEMPORARY TABLE
IF NOT EXISTS tmp AS (
SELECT
t.entry,
t.`name`,
t.castBarCaption,
l.name_loc8,
l.castbarcaption_loc8
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using AgileObjects.ReadableExpressions;
using System.IO;
using System.Globalization;
namespace ConsoleApp3
@Konctantin
Konctantin / asn1.pas
Last active May 12, 2017 08:08
asn1 parser
unit ASN1;
interface
uses System.SysUtils, System.Generics.Collections, RegularExpressions, Classes, Math;
TYPE
{$REGION 'TAsn1Class'}
TAsn1Class = (
--atSequence (2 elem)
---atObjectIdentifier 1.2.840.113549.1.7.2
---atEoc
----atSequence (2 elem)
-----atInteger
-----atSet (2 elem)
------atSequence (2 elem)
-------atObjectIdentifier 1.2.643.2.2.9
-------atNull
------atSequence (3 elem)
@Konctantin
Konctantin / TAsnReader.SaveContentToStream.pas
Last active May 16, 2017 07:30
Exstract content from p7s
procedure TAsnReader.SaveContentToStream(stream: TStream);
var breader : TBinaryReader;
magik, blockType, blockLength : integer;
isEnd : boolean;
buffer : TBytes;
begin
m_stream.Seek(0, soBeginning);
breader := TBinaryReader.Create(m_stream);
magik := breader.ReadUInt16();
case magik of