• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Tazo

#1
Fun Forum™ / Compton Cookout
March 07, 2010, 02:36 PM
From http://www.racewire.org/archives/2010/02/college_ghetto-themed_parties_the_awful_racist_idea_that_just_wont_die.html :
Quote
In honor of Black History Month (I am making a mental note to myself to add "ghetto-themed" parties to this list), UCSD students organized a party with the following invitation:

February marks a very important month in American society. No, i'm not referring to Valentines day or Presidents day. I'm talking about Black History month. As a time to celebrate and in hopes of showing respect, the Regents community cordially invites you to its very first Compton Cookout.

For guys: I expect all males to be rockin Jersey's, stuntin' up in ya White T (XXXL smallest size acceptable), anything FUBU, Ecko, Rockawear, High/low top Jordans or Dunks, Chains, Jorts, stunner shades, 59 50 hats, Tats, etc.

For girls: For those of you who are unfamiliar with ghetto chicks-Ghetto chicks usually have gold teeth, start fights and drama, and wear cheap clothes - they consider Baby Phat to be high class and expensive couture...Ghetto chicks have a very limited vocabulary, and attempt to make up for it, by forming new words, such as "constipulated", or simply cursing persistently, or using other types of vulgarities, and making noises, such as "hmmg!", or smacking their lips, and making other angry noises,grunts, and faces.

Read the entire article for more. I do find it wrong but there is definitely some humor in the for girls/guys thing, especially because I attend a college where that is legitimately how a lot of the black girls I see dress or act.
#2
Using blocking sockets in c#, I have a timer on 10ms delay that checks for new data like so:

static void timerTick()
       {
           if (stmBnet.DataAvailable)
           {

               int i = stmBnet.Read(RecvData, 0, size);

               if (i > 0)
               {
                   //data exists, separate it up and remove the null bytes

                   SplitPacket(RecvData);
                   if (DataQ.Count > 0)
                   {
                       //parse the separated packets
                       ParsePackets();
                   }
                   RecvData = new byte[size]; //reset the buffer
               }
           }
       }


I receive the data fine but the issue is that sometimes it clumps together and adds a plethora of trailing 0x00 (null) bytes. Therefore I wrote the packet splitting function, which splits up thepackets and places the data into a queue (DataQ):

static void SplitPacket(byte[] bData)
       {
           for (int i = 0; i < bData.Length; i++)
           {
               if (bData[i] == (byte)0xff)
               {
                   //found 0xFF, check if it's a header
                   if (bData.Length >= i + 2) //check that we can move up 2 more bytes to check for packet size
                   {
                       //i is still the location of 0xFF
                       byte packetid = bData[i + 1];
                       int packetsize = BitConverter.ToInt16(bData, i + 2);
                       if (bData.Length >= i + (packetsize - 1) && packetsize > 3 && packetsize < 512)
                       {
                           Console.WriteLine("Packet ID: 0x{0} :: Size: {1}", packetid.ToString("x2"), packetsize);
                           string splitPacket = Encoding.Unicode.GetString(bData, i, packetsize);
                           DataFormatter.WriteToConsole(Encoding.Unicode.GetBytes(splitPacket));
                           DataQ.Add(splitPacket);
                       }
                   }
               }
           }
       }


I then go about parsing the items in the queue. However, for some reason, it will randomly occur that the end of my parsed packets have the bytes: 0xFD and 0xFF, and are 1 beyond the split size.. for example, if the real packet data is
FF 30 09 00 01 00 00 00 00
, the packet splitter function will somehow end up with
FF 30 09 00 01 00 00 00 FD FF
instead.

I think it has something to do with the data being extracted as a string:

string splitPacket = Encoding.Unicode.GetString(bData, i, packetsize);

But I'm not sure how to extract in the middle of a byte array (the equivalent of .substring for byte[]). I think the null terminator on the end of packets is getting lost when it's extracted.

I'm basically looking for the C# equivalent of the java method extractBytes.

Nevermind, ended up using Array.copy. Revised funct:

static void SplitPacket(byte[] bData)
        {
            for (int i = 0; i < bData.Length; i++)
            {
                if (bData[i] == (byte)0xff)
                {
                    //found FF, check if it's a header
                    if (bData.Length >= i + 2) //check that we can move up 2 more bytes to check for packet size
                    {
                        byte packetid = bData[i + 1];
                        int packetsize = BitConverter.ToInt16(bData, i + 2);
                        if (bData.Length >= i + (packetsize - 1) && packetsize > 3 && packetsize < 512)
                        {
                            //we have enough room to separate the packet, it is a valid BNCS packet\
                            Console.WriteLine("Packet ID: 0x{0} :: Size: {1}", packetid.ToString("x2"), packetsize);

                            byte[] tempData = new byte[packetsize];
                            Array.Copy(bData, i, tempData, 0, packetsize);
                            DataFormatter.WriteToConsole(tempData);

                            DataQ.Add(tempData);
                        }
                    }
                }
            }
        }


I'll leave the thread here on the off chance that someone else has a similar issue.
#3
In order to dual-boot XP and Vista on my dell laptop that came with Vista, I had to change the SATA identification mode in the BIOS from AHCI to IDE. Otherwise, the XP setup would fail, because it wouldn't recognize a hard drive.

If I had installed XP properly to the new partition, I would have kept the HDD in AHCI and booted the drivers in from a floppy or thumb drive. However, because the XP setup would recognize the HDD and run properly if I configured the BIOS to set the SATA drive to IDE, I did that instead.

The problem is that Vista won't boot if the HDD is in IDE mode... if I want to boot into XP, I have to set the BIOS SATA mode to IDE, and if I want Vista, I have to set it to AHCI.

Is it possible to install the SATA drivers to XP without reinstalling the OS so that I can boot into both of my OS's without having to tinker with the BIOS beforehand?

Thanks.
#5
.NET Platform / FindWindowEx failing me.
June 10, 2008, 09:43 PM
For some reason, FindWindowEx is not working as it should be for me.

If I find the window using Spy++, it shows my parent window as what I'd expect, the .NET created Form1:


Therefore, using that same handle with the window open, I would expect a FindWindowEx to return as it should, giving the child window (code made in VB for simplicity; plus, the .NET project had to stay open and running for me to test it)
Debug.Print FindWindowEx(&H308B6, ByVal 0&, "#32770", vbNullString)

As you can see, I took the window handle right from Spy++, and used the same window class. Spy++ actually shows the window class as "#32770 (Dialog)" but just "#32770" works fine. VB6 returns '0' when I try this, indicating failure (MSDN).

Now. To recap, using FindWindowEx in VB6 using the specified Parent window, shown by Spy++ to be the parent which should therefore make FindWindowEx work as intended, right? Now, it is not an error in my WindowClass, the third variable passed to the FindWindowEx funct, because if I try it like this:
Debug.Print FindWindowEx(ByVal 0&, ByVal 0&, "#32770", vbNullString)
It returns as expected, showing the hWnd of the window I'm looking for, not '0'. Setting the first parameter, the parent window, to 0 will search all windows instead of only children of the specified parent.

HOWEVER! I cannot rely on setting the parent window variable passed to the FindWindowEx function as null. If I do that, I can't verify that it's the child of my C# program, which is what I'm looking for. On top of that, if I have NOD32 open, using FindWindowEx with a null parent window returns the NOD32 window first, not the C# window I'm looking for.

Now I'm not sure why Spy++ shows the parent window as my .NET window but yet FindWindowEx fails to work properly with it. I need this function to work properly and I will be grateful for any help concerning the matter.

Thanks in advance.

-sorry about any major grammatical errors or if my typing is distracting you from what I'm trying to get across; it's late, I've been staring at this for far too long lol

NOTE: I had the code for FindWindowEx written in .NET but because the window I'm looking for is created by C# in my program it's easier to use an outside app to test. Here's the .NET code, basically the same but not using a constant for the parent window obviously:

private void tmrDialog_Tick(object sender, EventArgs e)
        {
            IntPtr ret = FindWindowEx(this.Handle, IntPtr.Zero, "#32770 (Dialog)", string.Empty);

            if (ret != IntPtr.Zero)
            {
                this.txt.Text += "dialog present: " + ret.ToString() + "\r\n";
                return;
            }

            this.txt.Text += "dialog NOT present\r\n";

        }


#6
.NET Platform / GetType() problems
June 04, 2008, 09:22 PM
Hi all.

I'm trying to expand my VB6 code to C#, but one of my projects is presenting a large problem.

Using Microsoft HTML DOM in VB6, I can use TypeName() to find out what kind of HTML element I'm looking at, like so:

For x = 0 To oIE.Document.All.length - 1
       
        If TypeName(oIE.Document.All(x)) = "HTMLFrameElement" Then


Trying to do the same in C# gives me poor results. Using this code:

            HTMLDocument hdoc = new HTMLDocumentClass();
            hdoc = (HTMLDocument)this.wbMain.Document.DomDocument;

            for (int i = 0; i < hdoc.all.length ; i++)
            {
                this.txtMain.Text += hdoc.all.item(null, i).GetType().ToString() +"\r\n";
            }

The output looks like this:

mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass
mshtml.HTMLHtmlElementClass

But in VB6, I'd get a more specific list, looking like

HTMLHtmlElement
HTMLHeadElement
HTMLTitleElement
HTMLScriptElement
HTMLMetaElement
HTMLMetaElement
HTMLMetaElement
HTMLStyleElement
HTMLStyleElement
HTMLScriptElement
HTMLFrameSetSite
HTMLFrameElement
HTMLFrameElement
HTMLFrameElement

Which would allow me to actually manage the objects and use them as I see fit.

Why am I just receiving HTMLElements in C#? Yes, they are all BASE HTMLElements, but it's not specific enough and it doesn't tell me anything about the object.

Basically, instead of seeing HTMLElement, I need to see HTMLFrameElement, or HTMLInputElement, etc.

Thanks in advance, all help is appreciated.
#7
Edit: Someone on USWest was kind enough to pass me on some keys for free, so no need to trade. Thanks anyways, guys!

Hey everyone. I've always wanted to play War3/War3:TFT but I've never quite been able to pinch a penny for it knowing I can probably trade for it  ;D

I'm offering 2 D2 + D2:LoD key sets for Warcraft 3 and Warcraft 3: TFT cd keys.

The D2 and D2 LoD cd keys are not originally mine, a large list was given to me. However, I do test my keys before trading them, and if the CD keys are ever in use, I will replace your keys without a question.

I will only be using the keys on East, so if you're a West player, that works.  :)

PM me, thanks.

EDIT: See bottom post, I'm now offering 8 SC Keys for a War3 key and 8 SC Keys for a TFT key (a total of 16 keys).
#8
EDIT: Nevermind. See this page: http://forum.valhallalegends.com/index.php?topic=16238.0

Quote from http://www.bnetdocs.org/?op=packet&pid=367:
Quote
(WORD) Request Id
(DWORD) Index
(BYTE) Number of players in game
(DWORD) Status
(STRING) Game name
(STRING) Game description
   
Remarks:   Instead of receiving a single response that has a list of all the games, the client will receive this packet once for every game listed by the server.

Request Id:
    Like a cookie. This value will be whatever you sent the server in MCP_GAMELIST.
Index:
    The game's index on the server.
Number of players in game:
    Self explanatory.

Status:
    0x00300004: Game is available to join 0xFFFFFFFF: Server is down


I'm not sure if the Status code for 'Game is available to join' is correct. Using a level 1 expansion barbarian in normal difficulty, I receive 04 00 10 00 (0x00100004). Using a 77 Sorceress in act Hell, I receive 04 20 10 00 (0x00102004). Does anyone have more information on these status codes?
#9
Gaming Discussion / Amazing Steam game.
February 16, 2008, 01:09 AM
AUDIOSURF!

Play it, it's amazing.
#10
(posted in general programming because this isn't necessarily vb6-specific)

The Javascript in the page that I'm trying to interact with in VB6 contains the following code:

function upchat(thecdata)
{

    if(top.OldChat==null)
    {
       top.OldChat=new Array("","");

(...)


I need to change the data inside of this array.

I am not sure how to reference this object, or array rather, using HTML DOM. It does not show up as a frame under Document.FRames and I'm not sure if I can even access arrays created like this. I just thought that items using "top." were frames. (edit: looks like that's actually top.frames.framename) I've been trying for awhile, but if anyone can give me a definite answer, that'd be great. Thanks
#11
Warcraft / Post your latest uber screenshots
November 05, 2007, 02:14 PM



:D
#12
The mouse coordinates within a child window are different than those of the screen. GetCursorPos returns the cursor position on the screen, which unfortunately isn't what I need. Is it possible to grab the mouse coordinates as determined by the child/parent target window? For example, when I use Spy++ to track WM_LBUTTONDOWN/UP events, they are 400,300 in the child window, but when using GetCursorPos, hovering over the same point returns 400,375. The coordinates I'm attempting to grab are not within the actual program (I do have hWnds of the child/parent target windows, though).
#13
When I create a game using Starcraft, if someone joins my game, I receive 0x0F, event 0x12 (EID_INFO). It contains the user's record.

(source/dest info removed)
0030   -- -- -- -- -- -- ff 0f 3c 00 12 00 00 00 00 00  .9.<....<.......
0040   00 00 4e 00 00 00 00 00 00 00 0d f0 ad ba 0d f0  ..N.............
0050   ad ba 54 61 7a 6f 2d 23 34 00 66 72 61 67 63 68  ..Tazo123.fragch
0060   65 61 70 73 68 6f 74 27 73 20 72 65 63 6f 72 64  eapshot's record
0070   3a 00                                            :.


For some reason, if I create a game using my bot, I never receive 0x0F, and I have no way to tell if people are even joining my games. I have only tested this joining my own game using another bot. If I perform a /who on the bots, both appear to be in the game, but my "host" bot is never notified. I have no trouble starting a game using my "host" bot after I have sent my other bot in the game, even though I was never even notified of the join.

Does Starcraft do something special to request stats from the server that my bot isn't? I didn't notice anything in the packetlog.
#14
Testing Forum / test
August 05, 2007, 05:51 PM
#15
Ok, this is a pretty complex problem. I currently use PostMessage to send mouse clicks to Internet Explorer to manipulate a game. However, every now and then (it's random), a "security check" will show up. It displays an image with boxes in it and asks you to click a button corresponding to the number of boxes (see http://img106.imageshack.us/img106/1058/boxesgj6.png). I already have the child handle of the IE window I need (obviously), but first I need to know how to either retrieve the image or the image's name/location on the server. After that, I need VB to process the number of white squares.

I am assuming that the game tells  IE to re-dimension the image because if I open the image's location, it is only an 8x8 bmp (see http://img106.imageshack.us/img106/9905/1185938089iw6.png). They are actually bitmaps but imageshack conveniently made it a png.

I am not sure if the server changes these images, so it'd be best to retrieve it directly from IE rather than comparing saved security data with the image's name (ex. 37366123.bmp).

Any help on either of these 2 tasks is appreciated.
#17
Well, I just formatted my hard drive yesterday, and oddly enough, my computer is running worse than it was before I formatted. After I open a window it will take 1-2 seconds for it to show in the taskbar, and when it does, you can slowly see itself animating in. Also, the computer will randomly freeze, sort of pause, for anywhere from 2 - 10 seconds.

I have no idea what the issue is here and I'm open to all suggestions. It is important to note the computer did nothing like this before the format. Would a damaged hard drive cause said problems?

thanks in advance.
#18
I'm guessing by default, windows media player places album info (album art is all i care about) in a \Album\ folder on the MP3 device. However, my MP3 player requires it to be placed in \MUSIC\(artist)\(album\Album Art.jpg

How can I go about correcting this problem? Thanks in advance.
#19
Visual Basic Programming / More SendMessage issues.
February 03, 2007, 09:14 AM
Once again I'm trying to simulate a mouse click to an inactice window... here's what I have so far:


Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Const WM_PARENTNOTIFY = &H210
Private Const WM_MOUSEACTIVATE = &H21
Private Const HTCLIENT = 1


Private hWndParent As Long
Private hWndChild As Long


Private Sub cmdClickSub_Click()

    Dim lngResult As Long

    lngResult = SendMessage(hWndParent, WM_PARENTNOTIFY, WM_LBUTTONDOWN, MAKELPARAM(466, 301))
       
        Debug.Print "Result: " & lResult
   
    'lngResult = SendMessage(hWndParent, WM_PARENTNOTIFY, WM_LBUTTONUP, MAKELPARAM(466, 301))
    'in Winspector it doesn't show a WM_LBUTTONUP being sent after the WM_LBUTTONDOWN so i'll
    'hold off on that

    lngResult = SendMessage(hWndChild, WM_MOUSEACTIVATE, hWndParent, MAKELPARAM(HTCLIENT, 513))

        Debug.Print "Result: " & lResult

End Sub

Private Sub Form_Load()

    hWndParent = FindWindow("IEFrame", "Fiji - Windows Internet Explorer")
   
    Debug.Print "Parent:    0x" & Hex(hWndParent)

    hWndChild = FindWindowEx(hWndParent, 0&, "TabWindowClass", vbNullString)

    Debug.Print "Child:     0x" & Hex(hWndChild)
   
End Sub

'pulled off the internet, not my code
Public Function MAKELPARAM(wLow As Long, wHigh As Long) As Long
    MAKELPARAM = MAKELONG(wLow, wHigh)
End Function
Public Function MAKELONG(wLow As Long, wHigh As Long) As Long
    MAKELONG = LOWORD(wLow) Or (&H10000 * LOWORD(wHigh))
End Function
Function LOWORD(ByVal dw As Long) As Integer
    If dw And &H8000& Then
        LOWORD = dw Or &HFFFF0000
    Else
        LOWORD = dw And &HFFFF&
    End If
End Function


SendMessage isn't returning anything in the cmdClickSub_click event.
The hWnds match what I see in Winspector.
Can someone point me in the right direction? thanks.
#20
I am trying to access a website using the winsock control. Apparently, the website uses javascript. I can connect fine, and I receive the data fine. However, right after I connect, I get these 3 things:

HTTP/1.1 100 Continue





HTTP/1.1 200 OK
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Wed, 24 Jan 2007 22:16:51 GMT
Connection: close






<script language="JavaScript">
<!--

function SymError()
{
  return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
  return (new Object());
}

window.open = SymWinOpen;

//-->
</script>

<script src=../i.txt></script><script>st()</script>



After receiving this data, I am disconnected. I cannot figure out why. Am I supposed to re-connect and continue sending my data? Or am I missing something? All help is appreciated :)



edit: if you think it has something to do with the "i.txt", you can view it at http://racewarkingdoms.com/i.txt