示例#1
0
 public virtual int strcmp(TPointer src1Addr, TPointer src2Addr)
 {
     //if (log.DebugEnabled)
     {
         Console.WriteLine(string.Format("strcmp '{0}', '{1}'", Utilities.readStringZ(src1Addr.Address), Utilities.readStringZ(src2Addr.Address)));
     }
     return(AbstractNativeCodeSequence.strcmp(src1Addr.Address, src2Addr.Address));
 }
示例#2
0
        public virtual int strcpy(TPointer destAddr, TPointer srcAddr)
        {
            if (destAddr.NotNull && srcAddr.NotNull)
            {
                AbstractNativeCodeSequence.strcpy(destAddr.Address, srcAddr.Address);
            }

            return(0);
        }
示例#3
0
        public virtual int strcat(TPointer destAddr, TPointer srcAddr)
        {
            if (destAddr.Null || srcAddr.Null)
            {
                return(0);
            }

            int dstLength = AbstractNativeCodeSequence.getStrlen(destAddr.Address);
            int srcLength = AbstractNativeCodeSequence.getStrlen(srcAddr.Address);

            destAddr.memcpy(dstLength, srcAddr.Address, srcLength + 1);

            return(destAddr.Address);
        }
示例#4
0
        public virtual int strncpy(TPointer destAddr, TPointer srcAddr, int size)
        {
            int srcLength = AbstractNativeCodeSequence.getStrlen(srcAddr.Address);

            if (srcLength < size)
            {
                destAddr.memcpy(srcAddr.Address, srcLength + 1);
                destAddr.clear(srcLength + 1, size - srcLength - 1);
            }
            else
            {
                destAddr.memcpy(srcAddr.Address, size);
            }

            return(destAddr.Address);
        }
示例#5
0
 public virtual int strlen(TPointer srcAddr)
 {
     return(AbstractNativeCodeSequence.getStrlen(srcAddr.Address));
 }