Skip to content

Instantly share code, notes, and snippets.

View pts's full-sized avatar

Péter Szabó pts

View GitHub Profile
@pts
pts / hello86.nasm
Created January 23, 2023 00:02
hello86.nasm: hello-world program for Xenix 86 (and Xenix 286)
; by pts@fazekas.hu at Sun Jan 22 01:50:33 CET 2023
;
; Compile: nasm -O0 -f bin -o hello86 hello86.nasm
;
; !! This is experimental code for hello-world.
;
; Xenix 86 syscall ABI (reverse engineered):
;
; Call: mov ax, syscall_number; mov bx, arg1; mov cx, arg2; mov si, arg3; mov di, arg4; call section_text+0x17
; On error, sets CF=1, AX=errno (error code), destroys BX, CX, DX, SI, DI, BP, FLAGS.
Memory map for hellowr.com (DOS 8086 hello-world with write(2)) with
OpenWatcom 2 libc.
* = unreferenced symbol
+ = symbol only referenced locally
.text: (code)
mem_ptr size symbol
---------------------------
@pts
pts / sesamessh
Created April 29, 2018 14:36
sesamessh
#! /bin/sh --
# Passphrase-based SSH client. https://github.com/pts/sesamessh
# This is free software, GNU GPL >=2.0. There is NO WARRANTY. Use at your risk.
#
# wget https://github.com/pts/sesamessh/blob/master/sesamessh | sh
#
if true; then # Read entire script before running it.
rmtmp() { # Will be overwritten later.
:
@pts
pts / better_afm2tfm.pl
Last active August 30, 2017 12:26
better_afm2tfm.pl
#! /bin/sh
eval '(exit $?0)' && eval 'PERL_BADLANG=x;export PERL_BADLANG;: \
;exec perl -x -S -- "$0" ${1+"$@"};#'if 0;
eval 'setenv PERL_BADLANG x;exec perl -x -S -- "$0" $argv:q;#'.q+
#!perl -w
package Htex::better_afm2tfm; $0=~/(.*)/s;unshift@INC,'.';do($1);die$@if$@;__END__+if !1;
# This Perl script was generated by JustLib2 at Sun Nov 9 21:48:57 2003.
# Don't touch/remove any lines above; http://www.inf.bme.hu/~pts/justlib
package just; BEGIN{$INC{'just.pm'}='just.pm'}
BEGIN{ $just::VERSION=2 }
from ctypes import *
from struct import *
winmm = windll.winmm
vol = c_ulong()
print('res', winmm.waveOutGetVolume(0, byref(vol)))
print('left:', vol.value & 0xffff, 'right:',vol.value >> 16)
@pts
pts / tinygccpe.scr
Last active April 17, 2024 02:12
GNU ld linker script for smaller PE .exe output
/* tinygccpe.scr: GNU ld linker script for smaller PE .exe output
* by pts@fazekas.hu at Fri Feb 3 15:41:13 CET 2017
*
* It's different from the default by:
*
* * It drops initializers (e.g. .init, .ctors), and fails if the code tries
* to use them.
* * It drops exceptions (e.g. .pdata), and fails if the code tries
* to use them.
* * It merges .data and .rdata.
#! /usr/bin/python
import _multiprocessing
import os
import socket
import sys
import time
import thread

Keybase proof

I hereby claim:

  • I am pts on github.
  • I am pts (https://keybase.io/pts) on keybase.
  • I have a public key whose fingerprint is 537D 2E8D 6FAB 3265 9A1F 8767 33BB 974C 2FE0 93F2

To claim this, I am signing this object:

#!perl -w
# let's learn pod!
=head1 NAME
ladder - Finds a word letter between two words
=head1 SYNOPSIS
B<ladder> I<word1> I<word2> [I<dictfile>]