https://github.com/wakeward/playground
General repository for experimenting with different coding languages
https://github.com/wakeward/playground
Last synced: 3 months ago
JSON representation
General repository for experimenting with different coding languages
- Host: GitHub
- URL: https://github.com/wakeward/playground
- Owner: wakeward
- Created: 2024-09-09T08:30:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-04T23:04:11.000Z (over 1 year ago)
- Last Synced: 2025-02-05T00:18:35.831Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code Playground
General repository for experimenting with different coding languages
## Assembly
`ww.asm` - "Hello World" example which prints "wakeward"
`rs.asm` - reverse shell in assembly [Thx Xre0uS](https://github.com/Xre0uS/linux-reverse-shell-in-assembly/blob/main/reverse.asm)
### Build and Execution
#### ww.asm
```bash
nasm -f elf32 ww.asm -o ww.o
ld -m elf_i386 ww.o -o ww
./ww
```
#### rs.asm
Setup `nc` listener
```bash
nc -nlvp 4444
```
Build and Execute
```bash
nasm -f elf64 rs.asm -o rs.o
ld rs.o -o rs
./rs
```
### Notes from code reviewing
From `rs.asm`
- `CDQ` - Covert Doubleword to Quadword is an instruction that extends the sign bit of `EAX` into the `EDX` register.
- `syscall` - is default way of entering kernel mode on x86-64. This instruction is not available in 32 bit modes of operation on Intel processors.
- `XCHG` - Exchanges (swaps) the value of 2 registers
- `JNS` - Jump if not sign
- `SIL` - General purpose register (64-bit, the least significant bit 8 bits is assessible)
[Ref](https://www.aldeid.com/wiki/Main_Page)
## Go
Testing
```go
go run main.go
```
Build for Linux (current environment)
```go
go build -o rs main.go
```
## C
Build
```bash
gcc rs.c -o rs
```