Archive

Archive for the ‘Rants’ Category

Pancaaaaaaaaaaaakes

June 3rd, 2008

I had blueberry pancakes for breakfast today. The cafeteria at my employer is the bomb.

robin Rants, Work

Comcast woes

April 6th, 2008

Comcast has been down for over a day now. Good lord, this is ridiculous. Internet over my phone comes only at DSL speeds. I WANT MY CABLE BACK!

robin Internet, Rants, Robin

On second thought…

March 27th, 2008

It may just be that the wireless driver is fux0red. I got it to work, somehow, when I lived at Winding Woods though. Oh well.

UPDATE:

I still can’t decide whether it is the wireless drivers or not. SSH stalled on the wrong places. Over the ethernet port, everything seemed fine. I guess there’s one test I can make: I’ll put tautology behind the DLink box, and see if I can ssh into it then. That will tell me pretty definitively whether it is the wifi driver or outside interference.

robin Rants, Technology

Security problem

March 27th, 2008

Well, I’ve encountered a nasty security problem here at home. Somebody is interfering with the wireless. Somebody is interfering with ssh, specifically. On the box I just set up, ssh both incoming and outbound hangs whenever it uses the wireless for its connection. However, it uses the wireless to do http just fine.

I tried connecting it through my laptop, itself connected through EVDO. Magically, it worked perfectly. I also tried sshing into the box from the laptop when they were connected by the ethernet cable instead of over the wifi. That worked perfectly too. But as soon as I switch to the wireless connection, everything fails.

It’s like somebody is blocking packets. Everything is incredibly slow, for no apparent reason. But only on the wifi.

robin Rants, Technology

Impossible puzzle

March 21st, 2008

As part of my duties as a TA for CS367, I need to be able to help the students with their homeworks. This most recent assignment has been a devil. I can’t for the life of my figure out the last part. The gist of it is this:

Students are given a customized executable “bomb”. This is a program which takes six inputs from the user in sequence. Each input must be correct, or the “bomb” will “explode” and they lose 1/4 point on the homework. There is also a “quiet” bomb that won’t report their failures to the teacher, but won’t report their successes either. Each correct input earns them 10 points.

The students are not given the source code for the bomb. They have to figure out what it does and how it does it by themselves. Armed with a trusty copy of gdb, they are to disassemble the bomb, trace through its execution, and otherwise scrutinize it in order to figure out what the correct inputs are.

Because I am a sneaky guy, and it wasn’t forbidden, I took the liberty of applying a decompiler to the bomb. It helped a lot in defusing input 4, which became trivial once I saw the decompiled source. Of course, you need to know C inside and out to understand the decompiler’s outputted source, because the stuff is in many cases practically unreadable.

I have the disassembled and decompiled source code for phase 6, but I have yet to understand what the heck they are doing. The decompiled source isn’t much help either. It’s a mess, and barely better than the assembler version. I’ve been busting my brain about how this sucker works, and haven’t figured it out. I’ve spent a good 3 or 4 hours on this one phase, and I’ve gotten nowhere.

Just for grins, here’s the relevant assembler and source code:

08048d12 <phase_6>:
 8048d12:	55                   	push   %ebp
 8048d13:	89 e5                	mov    %esp,%ebp
 8048d15:	83 ec 08             	sub    $0x8,%esp
 8048d18:	6a 00                	push   $0x0
 8048d1a:	6a 0a                	push   $0xa
 8048d1c:	6a 00                	push   $0x0
 8048d1e:	ff 75 08             	pushl  0x8(%ebp)
 8048d21:	e8 da fa ff ff       	call   8048800 <__strtol_internal@plt>
 8048d26:	83 c4 10             	add    $0x10,%esp
 8048d29:	a3 1c a6 04 08       	mov    %eax,0x804a61c
 8048d2e:	68 1c a6 04 08       	push   $0x804a61c
 8048d33:	e8 8a ff ff ff       	call   8048cc2 <fun6>
 8048d38:	ba 01 00 00 00       	mov    $0x1,%edx
 8048d3d:	83 c4 04             	add    $0x4,%esp
 8048d40:	8b 40 08             	mov    0x8(%eax),%eax
 8048d43:	42                   	inc    %edx
 8048d44:	83 fa 04             	cmp    $0x4,%edx
 8048d47:	7e f7                	jle    8048d40 <phase_6+0x2e>
 8048d49:	8b 00                	mov    (%eax),%eax
 8048d4b:	3b 05 1c a6 04 08    	cmp    0x804a61c,%eax
 8048d51:	74 05                	je     8048d58 <phase_6+0x46>
 8048d53:	e8 3a 06 00 00       	call   8049392 <explode_bomb>
 8048d58:	c9                   	leave
 8048d59:	c3                   	ret    

08048cc2 <fun6>:
 8048cc2:	55                   	push   %ebp
 8048cc3:	89 e5                	mov    %esp,%ebp
 8048cc5:	56                   	push   %esi
 8048cc6:	53                   	push   %ebx
 8048cc7:	8b 75 08             	mov    0x8(%ebp),%esi
 8048cca:	8b 5e 08             	mov    0x8(%esi),%ebx
 8048ccd:	c7 46 08 00 00 00 00 	movl   $0x0,0x8(%esi)
 8048cd4:	85 db                	test   %ebx,%ebx
 8048cd6:	74 34                	je     8048d0c <fun6+0x4a>
 8048cd8:	89 f2                	mov    %esi,%edx
 8048cda:	89 f1                	mov    %esi,%ecx
 8048cdc:	85 f6                	test   %esi,%esi
 8048cde:	74 15                	je     8048cf5 <fun6+0x33>
 8048ce0:	8b 06                	mov    (%esi),%eax
 8048ce2:	3b 03                	cmp    (%ebx),%eax
 8048ce4:	7e 0f                	jle    8048cf5 <fun6+0x33>
 8048ce6:	89 d1                	mov    %edx,%ecx
 8048ce8:	8b 52 08             	mov    0x8(%edx),%edx
 8048ceb:	85 d2                	test   %edx,%edx
 8048ced:	74 06                	je     8048cf5 <fun6+0x33>
 8048cef:	8b 02                	mov    (%edx),%eax
 8048cf1:	3b 03                	cmp    (%ebx),%eax
 8048cf3:	7f f1                	jg     8048ce6 <fun6+0x24>
 8048cf5:	39 d1                	cmp    %edx,%ecx
 8048cf7:	74 05                	je     8048cfe <fun6+0x3c>
 8048cf9:	89 59 08             	mov    %ebx,0x8(%ecx)
 8048cfc:	eb 02                	jmp    8048d00 <fun6+0x3e>
 8048cfe:	89 de                	mov    %ebx,%esi
 8048d00:	8b 4b 08             	mov    0x8(%ebx),%ecx
 8048d03:	89 53 08             	mov    %edx,0x8(%ebx)
 8048d06:	89 cb                	mov    %ecx,%ebx
 8048d08:	85 c9                	test   %ecx,%ecx
 8048d0a:	75 cc                	jne    8048cd8 <fun6+0x16>
 8048d0c:	89 f0                	mov    %esi,%eax
 8048d0e:	5b                   	pop    %ebx
 8048d0f:	5e                   	pop    %esi
 8048d10:	c9                   	leave
 8048d11:	c3                   	ret    

// address: 0x8048d12
void phase_6(int param2, int param1) {
    int local0; 		// r24{40}
    int local1; 		// r24{54}
    int local10; 		// r26
    int local11; 		// r28
    int local2; 		// r24{33}
    int local3; 		// r26{55}
    int local4; 		// r24{28}
    int local7; 		// local1{54}
    int local8; 		// r24

    *(int*)(local11 - 4) = param1;
    *(int*)(local11 - 16) = 0;
    *(int*)(local11 - 20) = 10;
    *(int*)(local11 - 24) = 0;
    *(int*)(local11 - 28) = param2;
    __strtol_internal();
    node0[0] = local8;
    *(int*)(local11 - 16) = 0x804a61c;
    local4 = fun6(0x804a61c, local8);
    local7 = local4;
    local10 = 1;
    do {
        local1 = local7;
        local3 = local10;
        local2 = *(int*)(local1 + 8);
        local10 = local3 + 1;
        local7 = local2;
    } while (local3 + 1 <= 4);
    local0 = *(int*)*(int*)(local1 + 8);
    if (local0 != local8) {
        explode_bomb(local11 - 4);
    }
    return;
}

// address: 0x8048cc2
fun6(int param1, int param2) {
    int local10; 		// r30
    int local3; 		// r27{58}
    int local4; 		// m[r27 + 8]{39}
    int local5; 		// r26{65}
    int local6; 		// r25
    int local7; 		// r26
    int local8; 		// r27
    int local9; 		// r28

    local10 = param1;
    local8 = *(int*)(param1 + 8);
    *(int*)(param1 + 8) = 0;
    if (local8 != 0) {
        do {
            local3 = local8;
            local7 = local10;
            local6 = local10;
            if (local10 != 0) {
                param2 = *(int*)local10;
                if (*(int*)local10 > *(int*)local3) {
                    do {
                        local5 = local7;
                        local6 = local5;
                        local7 = *(int*)(local5 + 8);
                        if (*(int*)(local5 + 8) == 0) {
                            goto L4;
                        }
                        param2 = *(int*)*(int*)(local5 + 8);
                    } while (param2 > *(int*)local3);
                }
            }
L4:
            if (local6 == local7) {
                local10 = local3;
            } else {
                *(int*)(local6 + 8) = local3;
            }
            local4 = local7;
            local8 = *(int*)(local3 + 8);
        } while (*(int*)(local3 + 8) != 0);
    }
    return local10;
}

As you can see, the stuff is practically useless. fun6, in particular, is bizarre beyond measure. The assembler is riddled with things that don’t do anything, and the decompiled source looks like somebody took a crap on a keyboard.

Oh well.

robin Rants, Robin, School

When IRC gets old…

March 12th, 2008

Some days, there’s just nothing to do. IRC has gotten old. The web has gotten old. Listening to audiobooks has gotten old. Listening to classical music is getting old. Programming has gotten old. Grading assignments has gotten old.

What is there left to do?

TV is old too.

robin Rants, Robin

Compiler bug

February 21st, 2008

Apparently gcc has a bug in how it handles left-shifting of signed integers by values 32 or greater. I ran into this doing a programming assignment for CS367, a class I am a TA for. When left-shifting a constant by a constant, the expected result of 0 is attained, since the left-shift is beyond the range of the signed integer’s 32 bits. However, when left-shifting at runtime, only the rightmost 5 bits are examined when doing the left-shift. Thus, a left-shift of 32 bits is the same as a left-shift of 0 bits.

It’s most frustrating.

robin Rants, Technology

The follies of the student body

February 15th, 2008

I’m an undergrad TA for CS105, which is basically a computer ethics course that all students of the university are required to take to graduate. My responsibilities are twofold: I am to answer questions on the class discussion board, and to grade assignments. I am currently in the process of grading assignment 1.

I have never seen such nonsense.

There has been a near total lack of following of directions. The assignment is pretty clear, and the answer key is pretty clear, but at least half of the students do not address the issues that they are required to by the assignment. I try to be a good grader, but this is a bit ridiculous.

I now feel sorry for a lot of professors. This is a 100 level class, so it’s not going to be a very advanced one, but you would think that following directions is a skill that college students should have developed by the time they attend university.

Oh well. At least I get paid.

robin Rants, Robin, School

GPS Arrived!

January 9th, 2008

The FedEx curse is finally lifted. My bluetooth GPS transceiver finally arrived, and it works beautifully with Google Maps. Awesome. The thing is tiny, too. Here’s a pic:

DSCF1384.JPG

robin Rants

No more grades…

December 24th, 2007

I still haven’t gotten my CS306 grade. It’s been 11 days. I suppose the teacher has an excuse, though. Apparently she had a baby, which has complicated the grading process, on Dec 19. She says they should be in within a week. Hopefully that will be before Christmas, so I can brag about my awesomeness to relatives. Oh well.

robin Rants, Robin, School