Skip to content

Instantly share code, notes, and snippets.

View samyk's full-sized avatar

samy kamkar samyk

View GitHub Profile
@smx-smx
smx-smx / XZ Backdoor Analysis
Last active May 1, 2024 18:04
[WIP] XZ Backdoor Analysis and symbol mapping
XZ Backdoor symbol deobfuscation. Updated as i make progress
@thesamesam
thesamesam / xz-backdoor.md
Last active May 4, 2024 04:35
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

struct ContentView: View {
var body: some View {
VStack {
HStack {
Spacer()
Button { } label: {
Image(systemName: "power")
.resizable()
.aspectRatio(contentMode: .fill)
.padding()
@x27
x27 / MainCpuFirmwareExtract.cs
Created January 3, 2024 02:29
Extract Main CPU firmware from ICOM IC-R8600 firmware bundle (1.01-1.35 USA and non-USA versions)
/// <summary>
/// Extract Main CPU firmware from ICOM IC-R8600 firmware bundle (1.01-1.35 USA and non-USA versions)
/// non-USA versions:
/// https://www.icomjapan.com/support/firmware_driver/?product=IC-R8600(EUR)&frm_type=Firmware&old=true
/// USA versions:
/// https://www.icomjapan.com/support/firmware_driver/?product=IC-R8600&frm_type=Firmware&old=true
/// </summary>
/// <param name="bundle">Firmware bundle</param>
/// <returns>Unpacked data</returns>
static byte[] MainCpuFirmwareExtract(byte[] bundle)
@zckly
zckly / prompt.js
Created November 23, 2023 16:15
gpt-4-v skateboarding coach prompt
// model: gpt-4-vision-preview
const input = 'can you help me land this skateboarding trick?'
const frames = [
// Frames should be a list of image URLs or bytes
]
const messages = [
...messages,
@cedrickchee
cedrickchee / llama-7b-m1.md
Last active May 2, 2024 12:47
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

#define _WIN32_WINNT 0x0502
#define WINVER 0x0502
#include <windows.h>
#include <errhandlingapi.h>
#include <process.h>
#include "beacon.h"
WINBASEAPI PVOID WINAPI KERNEL32$AddVectoredExceptionHandler (ULONG First, PVECTORED_EXCEPTION_HANDLER Handler);
DECLSPEC_IMPORT uintptr_t __cdecl MSVCRT$_beginthreadex(void *_Security,unsigned _StackSize,_beginthreadex_proc_type _StartAddress,void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr);
DECLSPEC_IMPORT void __cdecl MSVCRT$_endthreadex(unsigned _Retval);
484e4f4a403f52430039200c50affaac00000137738aea3e0000017f0700001400023e000a140003070001140002413d000d0211020811000143011400024111000242021102000700024301340009110201070003133232421102023a07000426423e0004140001413d004111021007000507000644024a12000711020312000843013400250205000000933b0111020312000b323400111102043a0700042633000611020412000c4301424108421100014a120009430007000a254211020544004a12000d4300421100013a070004253400051100010225470004070000421100013a07000e2547001011000147000607000f45000307001042110001421100023247000607001114000207000014000311000114000411000403002947002e1100031100021102064a1200121102064a12001343001100021200141a430113181700033549170004204945ffc91100034205000000003b0114010f05000000273b00140109050000003d3b0014010b05000000463b0014010a05000000a13b0014010c05000000ad3b0114010d05000000e33b0214010e0842001500204a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a1103066c4f4f7343420d6c06034a4d405f490c48434f59414942586143484909594248494a454249480b4f43425f585e594f58435e01450458495f580b64786160
@robinst
robinst / twitter-archive-following-followers.md
Last active February 20, 2024 01:02
Twitter: How to archive your following/followers data (usernames, etc)

Twitter allows users to download parts of their data, see How to download your Twitter archive.

But what's not included in that data dump is the usernames/handles of the people that you follow or are following you. All you get is account IDs which is just an internal number and so a bit useless when it comes to archival.

Here's a way to get that data (you need to know how to run stuff in the terminal):

  1. Go to your Twitter profile in a desktop browser (Firefox or Chrome)
  2. Right click on page → Inspect → Network tab
  3. Click on the Following link (e.g. https://twitter.com/{yourusername}/following)