Пример #1
0
        public virtual void GetFuzzBlockDescriptions(ref HashSet <FuzzBlock> blocks, int chunkSize)
        {
            if (this.Fuzz)
            {
                // Add this data argument as a fuzz
                blocks.UnionWith(FuzzBlock.GetFuzzBlockDescriptions(process, Address, Size, chunkSize, NamePrefix + Name));
            }

            if (this.PointerTarget != null)
            {
                // Forward this to the pointed to arguments description
                PointerTarget.GetFuzzBlockDescriptions(ref blocks, chunkSize);
            }
        }
Пример #2
0
        public static List <FuzzBlock> GetFuzzBlockDescriptions(Process process, Int64 address, int size, int chunkSize, string name)
        {
            HashSet <FuzzBlock> blocks = new HashSet <FuzzBlock>();

            // Add this data argument as a fuzz
            for (int i = 0; i < size; i += chunkSize)
            {
                FuzzBlockAddress block;
                if (i + chunkSize > size)
                {
                    // Partial chunk, lower the start address until it fits and decrease size if required
                    if (size < chunkSize)
                    {
                        // Break it down into multiple smaller blocks
                        int n = i;
                        while (n < size)
                        {
                            // Make one chunk that is as big as allowed.
                            int newChunkSize = size - n;
                            while (newChunkSize > 0 && !FuzzBlock.IsValidBlockSize(newChunkSize))
                            {
                                newChunkSize--;
                            }

                            if (newChunkSize <= 0)
                            {
                                continue;
                            }

                            // Add a new block of this size
                            block = new FuzzBlockAddress(process.ProcessDotNet, address + n, name + " + 0x" + i.ToString("X"), newChunkSize);
                            if (!blocks.Contains(block))
                            {
                                blocks.Add(block);
                            }

                            n += newChunkSize;
                        }

                        return(blocks.ToList());
                    }
                    else
                    {
                        // Shift down until it fits. This means two fuzz blocks will overlap, but that is alright.
                        Int64 newAddress = address + size - chunkSize;
                        block = new FuzzBlockAddress(process.ProcessDotNet, newAddress, name + " + 0x" + i.ToString("X"), chunkSize);
                    }
                }
                else
                {
                    // Full chunk
                    block = new FuzzBlockAddress(process.ProcessDotNet, address + i, name + " + 0x" + i.ToString("X"), chunkSize);
                }

                if (!blocks.Contains(block))
                {
                    blocks.Add(block);
                }
            }

            return(blocks.ToList());
        }
Пример #3
0
 public List <FuzzBlock> GetFuzzBlockDescriptions(Int64 address, int size, int blocksize, string name)
 {
     return(FuzzBlock.GetFuzzBlockDescriptions(this, address, size, blocksize, name));
 }
Пример #4
0
 public List <FuzzBlock> GetFuzzBlockDescriptions(Int64 address, int size, string name)
 {
     return(FuzzBlock.GetFuzzBlockDescriptions(this, address, size, (IsWin64 ? 8 : 4), name));
 }