Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "nasm"
-
Hi I am new here!
My friend told me that devRant has a great community, he told me to post here and see what happens...14 -
Fuck yeah!!! After five days of fiddeling round in assembly without any sort of tutorial finally, im there :)16
-
!rant
A rather long(it's 8 hrs long to be precise) story
So I just finished an amazing homework assignment. The goal was to open a new shell on Linux using a C program. We were asked to follow instructions from http://phrack.org/issues/49/14.html . However the instructions given were for 32 bit processors and we had to do same for 64 bit machines. In a nutshell we had to write a 64 bit shell code and use buffer-overflow technique to change the return address if the function to our shell code.
I was able to write my own shellcode within 1hr and was able to confirm that it's working by compiling with nasm and all. Also the "show-off-dev" inside me told me to execute "/bin/bash" instead of "/bin/sh"(which everyone else was going to do). After my assembly code was properly executing shellcode, I was excited to put it in my C code.
For that, I needed opcodes of assembly code in a string. Following again the "show-off-dev" inside me, I wrote a shell script which would extract the exact opcodes out of objdump output. After this I put it in my C code, call my friend and tell him that "hell yeah bro, I did it. Pretty sure sir is gonna give me full marks etc etc etc". I compiled the code and BOOM, IT SEGFAULTS RIGHT IN FRONT OF MY FRIEND. Worst, friend had copied a "/bin/sh" code from shellstorm and already had it working.
Really burned my ego, I sat continuously for 8 hrs in front of my laptop and didn't talk to anyone. I was continuously debugging the code for 8 hrs. Just a few minutes ago, I noticed that the shellcode which I'm actually putting in my C code is actually 2 bytes shorter than actual code length. WHAT THE F. I ran objdump manually and copied the opcodes one by one into the string (like a noob) and VOILA ! IT WORKED !!!
TURNS OUT I DIDN'T CUT THE LAST COLUMN OF OPCODES IN MY SHELL SCRIPT. I FIXED THAT AND IT WORKED !!
THE SINGLE SHITTY NUMBER MADE ME STRUGGLE 8 HRS OF MY LIFE !! SMH
Lessons learnt :
1)Never have such an ego that makes you think you're perfect, cuz you're retarded not perfect
2)Examine your scripts properly before using them
3)Never, I repeat NEVER!! brag about your code before compiling and testing it.
That's it!
If you've read this long story, you might as well press the "++" button.6 -
College student here.
What are the most important skills/assets one should bring to the workplace? As a developer and a colleague.5 -
Not quite a interview question, but in a competition (I had build a compiler) the jury (they all told me they had all studied informatics) asked me what a compiler is... Not in a "lets try to catch him off manner" but rather in a "i am too stupid for this world manner" he asked me what a compiler was... And it got even worse: my compiler is based on linuxes utils (nasm+ld) the guy didnt know about linux. Assembler was much too much for him and when my compiler threw an error (I wanted to show them the error system) he told me I shouldnt present unfinished projects... Atleastthe other two were really nice and i still got 2nd place (behind a person who prorammed an Nxt thingy)7
-
WTF IS WRONG WITH ASSEMBLY LANGUAGE?!
I was just modifying an existing program for adding a sequence of numbers from the data section and through console input. I studied the code and started modifying it one step at a time. I needed to modify it into a multiplication program. So I started by changing the ADD functions, replaced the result and buffer registers with bigger size and thought I completed it. WELL GUESS WHAT? SHIT JUST GIVES ME SEGMENTATION FAULT! NOW I HAVE TO REDO THE WHOLE THING! WHY DOESN'T IT TELL ME WHICH LINE OF THE CODE I FUCKED UP AT?! STUPID NASM COMPILER.9 -
WHY IS IT SO FUCKIN ABSURDLY HARD TO PUSH BITS/BYTES/ASM ONTO PROCESSOR?
I have bytes that I want ran on the processor. I should:
1. write the bytes to a file
2a. run a single command (starting virtual machine (that installed with no problems (and is somewhat usable out-of-the-box))) that would execute them, OR
2b. run a command that would image those bytes onto (bootable) persistent storage
3b. restart and boot from that storage
But nooo, that's too sensible, too straightforward. Instead I need to write those bytes as a parameter into a c function of "writebytes" or whatever, wrap that function into an actual program, compile the program with gcc, link the program with whatever, whatever the program, build the program, somehow it goes through some NASM/MASM "utilities" too, image the built files into one image, re-image them into hdd image, and WHO THE FUCK KNOWS WHAT ELSE.
I just want... an emulator? probably. something. something which out of the box works in a way that I provide file with bytes, and it just starts executing them in the same way as an empty processor starts executing stuff.
What's so fuckin hard about it? I want the iron here, and I want a byte funnel into that iron, and I want that iron to run the bytes i put into the fuckin funnel.
Fuckin millions of indirection layers. Fuck off. Give me an iron, or a sensible emulation of that iron, and give me the byte funnel, and FUCK THE FUCK AWAY AND LET ME PLAY AROUND.8 -
I've been laughed at a lot for thinking this way, but I'm honestly frustrated by how little information exists on the web for people who want to take Operating System development a step further. I mean, the OSDev Community is amazing and offers pretty, much everything one needs to know at the system level. But my issue is: What if someone didn't want to use existing compilers and assemblers like GCC and NASM, and do everything from total scratch? I mean, the original Unix came from somewhere, right? I know you're going to think "Why not? It works.". Well, I just think it's crazy how few people (such as Linus and the GNU foundation) are out there that have the ability to create such things without help from existing software tools. Sure, it could take me decades of careful practice and experience, but my passion is for creating software at this level and becoming one of those people is very strong. I just wish I knew where to begin and who to learn from.4
-
Holy shiiittttt I finally got 64bit NASM working on windows with cmake. Cmake documentation is fkn bad man.
I’ve got a c++ file that calls a procedure in an assembly file that calls win32 APIs to show dialogs and other cool shit. Compiling was working fine, linking turned out to be a bit of a pain in the ass, but figuring out how to enable NASM in cmake was a nightmare. Why is the cmake docs so horrific 🥺1 -
what do you recommend for me to learn about next?
I have learnt about:
- web frontend/backend (php)
- android and java
- c, c++, nasm, gnu assembler
- parallel computing
- cli operating systems
with that background, what would you recommend?
I'm considering:
- neural networks
- making a server
- ethical hacking
- starting a blog7 -
So, I've been trying to learn assembly. However, I can't find any assembly docs online, so I can't really do anything. I tried NASM and FASM but I just can't understand assembly. Do y'all know any decent way to learn assembly? (My dad said it's better to do it on my pi or should I do it on my desktop?)8
-
Colleague wants to start programming (he is seriously hopeless, always tries to make stuff look "cool" - in which he fails - and just copypasta everything from youtube -not even SO).
I told him to start making a website in NASM...
he still doesn't realize that HTML is a thing...5 -
I've read that devRant is using javascript and the likes, what I'm wondering is how one uses javascript for android apps. I know PhoneGap exists, but I also read that there is some performance issues with it. what does devRant use?2
-
*le me being frustrated af trying to compile asm.
.section won't work for fasm. And some other things won't work for Nasm.
Now I got the .obj aka .o from the .asm. But ldrdf.exe from the nasm compiler isn't working properly. And I can't find a troubleshoot online. Seems like this will be a sleepless night...2 -
mov al, [var]
var db 07h
Error on line 1: undefined operation size.
Silly me defining a byte, using mov on a byte-wide register with said byte-wide variable. What size it could be, the byte-wide variable is soo fucken unknown i'm so sorry.1 -
Its a confession...
So yesterday we had a practical in our uni... It was on Assembly Language (NASM and TASM)... Its a horrible language to work on... Trust me... I hate it, infact... We all hate it at the uni... But the thing is... We need to pass the practical in order to sit for the theory, and it is really hard language.... So most of my friends brought pen drives... And some brought chits... And sadly... All of them got caught... And were marked as fail right away... But the thing is I also cheated... And I copied successfully... I didnt use any pendrive or removable media... But I used ssh to my cloud server... And since I code on vi, it was pretty easy for me to cheat in the practical... I feel bad that I cheated.... But then I feel proud as well because I used the tech of this generation to copy, and not some grandpa shit like pendrives...
Yeah... That was it... The codes did rain in the exam..
I know I am a horrible person.. But common guys.. Who am I kidding... I am proud that I didnt use any clichè methods... And was talented enough to do so without getting caught...5 -
First post on devRant... Aaaaand it's university hw... I can't wrap my head around this...
So, the problem is: I have to implement writing and printing 64 bit decimal integers (negative and positive with 2s complement) in NASM Assembly. There are no input parameters, and the result should be in EDX:EAX. The use of 64 bit registers is prohibited.
There is a library which I can use: mio.inc
It has these functions:
- mio_writechar (writes the character which corresponds to the ASCII code stored in AL to console)
- mio_readchar (reads an ASCII character from console to AL)
It also has to manage overflow and backspace. An input can be considered valid or invalid only after the user hits Enter... It's actually a lot of work, and it's just the first exercise out of 10... 😭
The problem is actually just the input - printing should be easy, once I have valid data...
Please help me!3 -
- I have done this, this and this. I'm an amazing programmer even though i copied it from SO.
- Allright, could you explain this part since you did not write one single comment.
- (insert generic bullshit excuse)
you don't think he's the one getting the internship amd the summer job since he's the loudest? dear god, my fist, his face.3 -
section .data
msg: db "ASM, Love Or Hate?",10
msglen: equ $-msg
GLOBAL _start
_start:
mov rdx, [msg]
mov rdi, msglen
call print_stdout
mov rax, 0x3c
mov rdi, 0
syscall
print_stdout:
mov rax, SYS_WRITE
mov rdi, STDOUT
syscall
ret5 -
A big development company needed summer interns, the job required java and the likes and it was the first big interview i've had. This wasn't a problem, i thought, until i got there. worth noting is that Im still in school and and the last time i used java extensivly was a year prior to the interview. I completly blanked on the, rather basic, questions. needless to say, I didnt get it.2
-
when I get the assignment of debugging my group members uncommented Java Swing application, I seriously have to untangle that mess for days
-
2005, after I tried to program my computer to be quicker. By the time I realized that it was impossible, I was hooked.