Thread: How To Incorporate input_byte In For Loop Query ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2023
    Posts
    39

    How To Incorporate input_byte In For Loop Query ?

    I have the following part of a C# Code :-

    Code:
    while(current_input_position <= input_max_valid_position) {
    
                    input_byte = input_data[current_input_position];
                    current_input_position++;
    
    
                    for (int i = 0xFF; i >= 0x00; --i)
    
    
                        if (input_byte == 0xFF) {
                        //==============
                        // Fin de chunk
                        //==============
                        Save();
                        current_output_index++;
    
    
                        RLE_sumador            = 0;
                        line_min_length        = int.MaxValue;
                        line_max_length        = 0;
                        width_current        = 0;
                        image_height        = 0;
    
    
                    } else if(input_byte == 0xFF) {
                        //=================
                        // Siguiente linea
                        //=================
                        if(width_current < line_min_length) line_min_length = width_current;
                        if(width_current > line_max_length) line_max_length = width_current;
    
    
                        if(forced_image_width!=null) {
                            count = forced_image_width.Value - width_current;
                            if(count > 0) {
                                for(n=0; n<count; n++) {
                                    output_buffer.Add(0);
                                }
                            }
                        }
    
    
                        image_height++;
                        width_current = 0;
    I am adapting a Code to try to brute force all combinations of input_byte combinations, going backwards from 0xFF to 0x00, if possible I would like to exclude, all combinations of Hex Values for input_byte being numbers i.e 00 01 02 etc, as these will never produce Bitmaps.There are five input_byte == blocks of Code I have typed each one as 0xFF as that is the Hex Value, where the For Loop starts from. When I use --i in the for loop line of code, it runs for a few seconds, so not working for me.

    I tried --input_byte instead however it just runs and runs, and I know it isn't trying out all combinations of input_byte, as in the attached image, to this Thread, the number in the () stays at 636, the numbers should be a variety.

    The Program extracts images, from a DOS Games Graphics Files, and saves them as Greyscale Bitmap Files. I could provide more Code if needed, input_byte is declared as a byte higher up in the Code. Is the for loop in the wrong place ? How do I incorporate, input_byte, in the for loop ?

    Any help would be much appreciated.

    Regards

    Eddie Winch
    Attached Images Attached Images How To Incorporate input_byte In For Loop Query ?-unpac-program-jpg 

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. While Loop Query - code displayed
    By darren78 in forum C Programming
    Replies: 13
    Last Post: 02-17-2009, 10:44 AM
  2. first look incorporate assembly?
    By stabu in forum C Programming
    Replies: 8
    Last Post: 09-25-2008, 08:53 AM
  3. Loop Query
    By (TNT) in forum C# Programming
    Replies: 5
    Last Post: 02-13-2006, 06:16 PM
  4. How can I incorporate this code into a web page?
    By MisterRob in forum C Programming
    Replies: 6
    Last Post: 11-02-2005, 05:43 PM
  5. Best way to incorporate upgrades
    By Shadow12345 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-26-2002, 07:41 AM

Tags for this Thread