HNHacker News
TopNewBestAskShowJobs

kbradero

110 karma · joined March 17, 2010

submissionscomments
kbradero··on Programmers of ITMO University win the ACM ICPC for the sixth time
this sounds interesting, can you elaborate?
kbradero··on Grooveshark Shuts Down
I used Grooveshark, they had the best service and they company was awesome.

Is a shame the music industry is rotten and went as far as to kill this awesome company. My best wish for the team, you guys are great, dont let this get you down.

And kudos for your all these years!

kbradero··on Beyond the Maquiladora: A Look at Mexico’s Startup Scene
Oracle, IBM, Intel and Freescale has big development buildings here, actually GDC (Guadalajara Design Campus) just opened a new building.
kbradero··on Foreign Linux: Run Linux binaries on Windows without drivers or modification
actually I'm pretty sure Bay Trail do run Linux.
kbradero··on Inside the Intel 1405: die photos of a shift register memory from 1970
is there any good book to study about this ?
kbradero··on Twitter Reports Second Quarter 2014 Results
i keep wondering how they earn money to keep going (honest question)
kbradero··on Welcome to the United States: Discriminated, detained, searched, interrogated
well done sr
kbradero··on Judge sentences Bradley Manning to 35 years
and what about all the people already killed by drones and collateral's? who in gov is in prison at least 35 years ?
kbradero··on Callbacks as our Generation's Goto Statement
Miguel is always fun/good to read.
kbradero··on Federal judge: Bitcoin, “a currency,” can be regulated under American law
money as we know it today had the same problem i guess...
kbradero··on Brazilian judge orders arrest of Google Brazil president
what the fack !!!? people of Brazil, you are very smart please do not permit this to happen on your own country.

Internet gives you power, dont let these fu*rs do whatever they want.

kbradero··on SICP taught in Python 3 - UC Berkeley online
scheme/lisp was choose by Sussman and Abelson because it does not get in the way to explain SICP.

Python can be a problem and get in the way; scheme was beautiful because it's so simple that all that rest to understand is the really big ideas described in SICP.

kbradero··on A Lua interpreter in the NetBSD kernel
can you elaborate please ?
kbradero··on John McCarthy Has Died
worst year for CompSci.
kbradero··on Why You Should Learn COBOL
'cause all you want is money but no neurons.
kbradero··on Ask HN: Do CS students enjoy C anymore?
Thanks !!!
kbradero··on Ask HN: Do CS students enjoy C anymore?
is there a link to the labs code,tgz,web ?
kbradero··on I want to compile a C program so simple I can explain all of the assembly
Lets see a really simple program you can explain all te assembly :)

We need to write our program like this:

$echo 0000000: 55 48 89 e5 b8 ff aa 00 00 c9 c3 |xxd -r > sum2.bin

Here we have the SAME little program in C: $ cat sum.c int sum(void){ return 0x00ff + 0xaa00; }

We can getLook at the results: $ gcc -c sum.c -o sum.o (get the raw opcodes in osx, intel arch )

$ otool sum.o -td|sed -n '3,$p'| awk '{ print $0}'|xxd -r > sum.bin

Now you can look at asm level your code: $ ndisasm -b 32 sum.bin 00000000 55 push ebp 00000001 48 dec eax 00000002 89E5 mov ebp,esp 00000004 B8FFAA0000 mov eax,0xaaff <-- gcc put our 'sum' final product here at compilation time 00000009 C9 leave 0000000A C3 ret

So your program is now reduced to this code: $ hexdump sum.bin 0000000 55 48 89 e5 b8 ff aa 00 00 c9 c3 000000b

Test your 2 files md5 sum.bin sum2.bin MD5 (sum.bin) = a0ccc94bcdc860a81ff28252f56c2257 MD5 (sum2.bin) = a0ccc94bcdc860a81ff28252f56c2257

We could probe our code with a selfmade userland loader: $./uloader sum2.bin Display Opcodes to exec: 55 48 89 e5 b8 ff aa 00 00 c9 c3 End opcodes code to exec address: exec_code =0x100100080 new crafted Proc : address = 0x100100080 returned value ==>aaff

----BEGIN Code--- #include <stdio.h> #include <stdlib.h>> #include <unistd.h> #include <fcntl.h>

int main( int argc, char argv[] ){ unsigned int (proc)(); unsigned int fdprog=0; unsigned int exec_code=NULL; unsigned char ptr=NULL; unsigned int returned_value=0x0; exec_code=(int ) malloc( 100 ); ptr=( char )exec_code; fdprog=open(argv[1], S_IRUSR ); printf("Display Opcodes to exec:\n"); while( read(fdprog, ptr, sizeof(unsigned char)) ){ printf(" %02x ", ptr ); ptr++; }

        printf("\nEnd opcodes\n");                                                                                      
        printf("code to exec address: exec_code =%p \n",exec_code);                                                              
        proc=(unsigned int (*)() ) exec_code;                                                                          
        printf("new crafted Proc : address = %p \n",proc);                                                                       
        returned_value= (*proc)();    //here is the magic bro! :)
                                                                                                                        
        printf("returned value ==>%lx \n",returned_value);                                                                            return 0;                                                                                                               }                        
----END Code ---

Saludos! Jorge A. Garcia.

← PreviousPage 2 of 2