Thread: CS2 decompiler question (answered)

Results 1 to 2 of 2
  1. #1 CS2 decompiler question (answered) 
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,555
    Thanks given
    652
    Thanks received
    640
    Rep Power
    358
    I'm using [Only registered and activated users can see links. ] to decompile my 634 scripts.

    Does anybody know what CHILD/_CHILD references? It's used as a replacement for local/args/static widgets:

    Code:
    void script_35(Widget widget0, Widget widget1, int arg2, boolean arg3) {
    	int int4;
    	int int5;
    	int4 = 0;
    	int5 = 0;
    	if (CHILD.setChild(widget0, 1)) {
    		if (_CHILD.setChild(widget0, 2)) {
    			_CHILD.setPosition(0, arg2 + 16, 0, 0);
    		}
    		if (_CHILD.setChild(widget0, 3)) {
    			_CHILD.setPosition(0, arg2 + CHILD.getHeight() - 5 + 16, 0, 0);
    		}
    		int4 = widget0.getHeight() - 32 - CHILD.getHeight();
    		if (int4 <= 0) {
    			return;
    		}
    		int5 = widget1.getScrollMaxV() - widget1.getHeight();
    		arg2 = arg2 * int5 / int4;
    		script_37(widget0, widget1, arg2, arg3);
    	}
    	return;
    }
    Code:
    void script_106(Widget widget0, int arg1, int arg2) {
    	int int3;
    	int int4;
    	int int5;
    	int int6;
    	int int7;
    	if (arg2 != 1) {
    		return;
    	}
    	int3 = 0;
    	int4 = 0;
    	int5 = 0;
    	int6 = 0;
    	int7 = 0;
    	while (int3 < getItemContainerLength(140)) {
    		if (CHILD.setChild(widget0, int3) && CHILD.isHidden()) {
    			int4 = int3;
    		}
    		int3 = int3 + 1;
    	}
    	int6 = arg1 / 5;
    	int5 = arg1 - int6 * 5;
    	if (int4 == arg1 - 1 && int5 > 0 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
    		playSoundEffect(1859, 1, 0);
    		CHILD.setPosition(56 * (int5 - 1), 56 * int6, 0, 0);
    		_CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
    		return;
    	}
    	if (int4 == arg1 + 1 && int5 < 5 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
    		playSoundEffect(1859, 1, 0);
    		CHILD.setPosition(56 * (int5 + 1), 56 * int6, 0, 0);
    		_CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
    		return;
    	}
    	if (int4 == arg1 - 5 && int6 > 0 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
    		playSoundEffect(1859, 1, 0);
    		CHILD.setPosition(56 * int5, 56 * (int6 - 1), 0, 0);
    		_CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
    		return;
    	}
    	if (int4 == arg1 + 5 && int6 < 5 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
    		playSoundEffect(1859, 1, 0);
    		CHILD.setPosition(56 * int5, 56 * (int6 + 1), 0, 0);
    		_CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
    		return;
    	}
    	return;
    }
    Nvm figured it out while reading the opcode DB:

    Code:
    # Create a new child on parent widget, call this method on either CHILD or _CHILD to bind the register to that newly created child
    150 createChild void Widget parent int type int index
    # Call on CHILD or _CHILD to delete the active child register from parent
    151 deleteChild void
    
    152 clearChildren void Widget parent
    # Call on CHILD or _CHILD register to bind that child register to an existing child or a parent interface, returns true/false if index exists and successfully bound
    200 setChild boolean Widget parent int index
    # Call on CHILD or _CHILD register to bind that register to the parent.
    201 setChild boolean Widget parent
    Project thread
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    23
    Posts
    1,448
    Thanks given
    3,133
    Thanks received
    672
    Discord
    View profile
    Rep Power
    1029
    Quote Originally Posted by clem585 View Post
    I'm using [Only registered and activated users can see links. ] to decompile my 634 scripts.

    Does anybody know what CHILD/_CHILD references? It's used as a replacement for local/args/static widgets:

    Code:
    void script_35(Widget widget0, Widget widget1, int arg2, boolean arg3) {
        int int4;
        int int5;
        int4 = 0;
        int5 = 0;
        if (CHILD.setChild(widget0, 1)) {
            if (_CHILD.setChild(widget0, 2)) {
                _CHILD.setPosition(0, arg2 + 16, 0, 0);
            }
            if (_CHILD.setChild(widget0, 3)) {
                _CHILD.setPosition(0, arg2 + CHILD.getHeight() - 5 + 16, 0, 0);
            }
            int4 = widget0.getHeight() - 32 - CHILD.getHeight();
            if (int4 <= 0) {
                return;
            }
            int5 = widget1.getScrollMaxV() - widget1.getHeight();
            arg2 = arg2 * int5 / int4;
            script_37(widget0, widget1, arg2, arg3);
        }
        return;
    }
    Code:
    void script_106(Widget widget0, int arg1, int arg2) {
        int int3;
        int int4;
        int int5;
        int int6;
        int int7;
        if (arg2 != 1) {
            return;
        }
        int3 = 0;
        int4 = 0;
        int5 = 0;
        int6 = 0;
        int7 = 0;
        while (int3 < getItemContainerLength(140)) {
            if (CHILD.setChild(widget0, int3) && CHILD.isHidden()) {
                int4 = int3;
            }
            int3 = int3 + 1;
        }
        int6 = arg1 / 5;
        int5 = arg1 - int6 * 5;
        if (int4 == arg1 - 1 && int5 > 0 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
            playSoundEffect(1859, 1, 0);
            CHILD.setPosition(56 * (int5 - 1), 56 * int6, 0, 0);
            _CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
            return;
        }
        if (int4 == arg1 + 1 && int5 < 5 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
            playSoundEffect(1859, 1, 0);
            CHILD.setPosition(56 * (int5 + 1), 56 * int6, 0, 0);
            _CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
            return;
        }
        if (int4 == arg1 - 5 && int6 > 0 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
            playSoundEffect(1859, 1, 0);
            CHILD.setPosition(56 * int5, 56 * (int6 - 1), 0, 0);
            _CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
            return;
        }
        if (int4 == arg1 + 5 && int6 < 5 && CHILD.setChild(widget0, arg1) && _CHILD.setChild(widget0, int4)) {
            playSoundEffect(1859, 1, 0);
            CHILD.setPosition(56 * int5, 56 * (int6 + 1), 0, 0);
            _CHILD.setPosition(56 * int5, 56 * int6, 0, 0);
            return;
        }
        return;
    }


    Nvm figured it out while reading the opcode DB:

    Code:
    # Create a new child on parent widget, call this method on either CHILD or _CHILD to bind the register to that newly created child
    150 createChild void Widget parent int type int index
    # Call on CHILD or _CHILD to delete the active child register from parent
    151 deleteChild void
    
    152 clearChildren void Widget parent
    # Call on CHILD or _CHILD register to bind that child register to an existing child or a parent interface, returns true/false if index exists and successfully bound
    200 setChild boolean Widget parent int index
    # Call on CHILD or _CHILD register to bind that register to the parent.
    201 setChild boolean Widget parent
    I like that you actually leave your threads in a state where others can learn from them.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 7
    Last Post: 07-04-2010, 01:15 PM
  2. Need A Easy question answer will rep
    By Jesse in forum Requests
    Replies: 3
    Last Post: 02-12-2010, 07:06 PM
  3. Replies: 6
    Last Post: 11-02-2009, 03:43 PM
  4. Decompiling question
    By supra s in forum Help
    Replies: 0
    Last Post: 09-16-2009, 10:58 AM
  5. Some (Delta) Questions Answer The 1 U Know
    By 3lou55 in forum Requests
    Replies: 2
    Last Post: 04-21-2009, 01:14 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •