Skip to content

Instantly share code, notes, and snippets.

View tremblerz's full-sized avatar
💭
I may be slow to respond.

Abhishek Singh tremblerz

💭
I may be slow to respond.
View GitHub Profile
timeout=0
targets="scanme.nmap.org"
filename=~/Downloads/CourseMaterial/nmap/git/testnmap/nmap/scripts/script.db
output_path=~/Downloads/CourseMaterial/nmap/tests/host_timeout
#Read from script.db file
mapfile -t SCRIPT < <(awk -F'[{=", ]+' '$1 == "Entry"{print $3}' $filename)
.data
msg1:
.asciiz "Enter a number in base 2 (-2 to quit): "
msg2:
.asciiz "\nResult: "
allOnes:
.asciiz "1111111111111111"
empty:
.space 16
newLine:
.data
fin: .asciiz "maze1.dat" # filename for input
buffer: .asciiz ""
.text
#open a file for writing
li $v0, 13 # system call for open file
la $a0, fin # board file name
li $a1, 0 # Open for reading
li $a2, 0
# count significant bits in bit battern
.text
.globl main
lui $8, 0x0029 #register 8 contains bit battern to check for sigbits
ori $8, $8, 0x8D7D
addiu $10, $0, 32 #exit upper loop counter value
@tremblerz
tremblerz / 3.asm
Created February 11, 2016 19:20 — forked from voter101/3.asm
Mips exercise 3
main:
addi $t7, $zero, 128
li $v0, 13
la $a0, filename
li $a1, 0
li $a2, 0
syscall
addi $s0, $v0, 0
readFromFile:
# print_msg function takes three arguments and is equivalent to
# snprintf(“Move disk %d from %d to %d.”, $a0, $a1, $a2);
hanoi:
slti $t0, $a0, 2
bne $t0, $0, caseOne
addiu $sp, $sp, -20
sw $a0, 0($sp)
sw $a1, 4($sp)
@tremblerz
tremblerz / guess.asm
Created February 11, 2016 19:15 — forked from charlesrubach/guess.asm
Guessing game in MIPS
.include "macros.asm"
.data
# arrays
variables: .space 16 # [random number][low][high][guesses]
range: .byte 100 # Set the range [0 t0 range]
# Constant strings
guess1: .asciiz "Guess a number between "
guess2: .asciiz " and "
@tremblerz
tremblerz / bubblesort.mips.s
Created February 11, 2016 19:14 — forked from manudatta/bubblesort.mips.s
Bubble sort in MIPS assembly.
# Copyright 2002 Manu Datta (gmail.com ID Manu dot Datta)
# All rights reserved
.data
msg1: .asciiz "\nEnter integer values followed by return (-1 terminates input): \n"
msg2: .asciiz ","
msg3: .asciiz "Bubble Sort"
msg4: .asciiz "#########pass#########"
msg5: .asciiz "\n"
msg6: .asciiz "\nNumber list has been sorted\n"
@tremblerz
tremblerz / prime_numbers.asm
Created February 11, 2016 19:14 — forked from Nicotico/prime_numbers.asm
verifica numeri primi in MIPS
.data
.text
.globl main
main:
#li $v0, 5
#syscall
move $a0, $v0 #sposto l'intero in a0
@tremblerz
tremblerz / palindrome.asm
Created February 11, 2016 19:14 — forked from computercolin/palindrome.asm
Palindrome Checking Algorithm in MIPS assembly
# Joseph Meyer
# Colin Zwiebel
# 3 Oct 2011
# Palindrome
# Recursive implimentation of Palindrome checking algorithm
.data
input: .asciiz "racecar"
input_len: .word 7