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.


Topics - Hdx

Pages: 1 [2] 3
16
Trash Can / Re: How can you make your own JBLS/BNLS server?
« on: February 14, 2008, 03:12:29 pm »
Lol so is anyone gunna help me?
I was gunna help you untill I head the word 'p1mp'
Thats just.... wrong....
~Hdx
You're still a retard, so no.

17
Tabletop Gaming/RPGs / Shadowrun
« on: February 07, 2008, 09:15:03 pm »
Anyone have some premade jobs for shadowrun?
A few friends and I want to try playing it over Fantasy Grounds [It'd be awesome if we could find a torrent of v2.. but eah]
Anyways. Anyone got some premade jobs, or anything that is Shadow run related?

18
Entertainment District / Traffic Prank
« on: December 23, 2007, 05:32:23 am »
http://www.collegehumor.com/video:1772718
Haven't seen anyone post this before and found it while browsing. I mean the setup is perfect!
~Hdx

19
General Programming / IAT, and qsort()
« on: June 28, 2007, 02:35:35 pm »
Ron, any ideas on how I can populate the IAT save getting a DB of all the function address in all window's DLL's?
Also, what exactly does qsort() do? I think I know what ti does, I jsut need to process how to implement it in java.
After that, lockdown is done 100%
<3
I still don't have net -.- HOPEFULLY the 6th. Bastards.
~Hdx

20
Code: [Select]
/*
 * Author: Hdx
 * Date: 05-01-07
 */

import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.swing.*;

//iago's buffer class
import util.Buffer;

public class bni{
  private ArrayList iconlist = new ArrayList();
  public boolean loadBNI(String file){
    Buffer fileData = new Buffer();
    try{
      /* Just read out the file, this will throw an error if the file is unreadble (Not found, locked, etc) */
      FileInputStream fis = new FileInputStream(file);
      int i = fis.read();
      while(i != -1){
        fileData.addByte((byte)i);
        i = fis.read();
      }
      fis.close();

      /* BNI Header format:
       * (DWORD) HeaderLength (always 0x10) - Length of this BNI header
       * (WORD) BNI Version (Only 0x01 is supported)
       * (WORD) Unused (always 0x00)
       * (DWORD) NumIcons - Number of icons
       * (DWORD) DataStart - Length of the BNI file header, and start position of TGA file
       */

      int headLen = fileData.removeDWord();
      int ver = fileData.removeWord();
      fileData.removeWord();
      int imagecount = fileData.removeDWord();
      int datastart = fileData.removeDWord();
      /*
      System.out.println("Header length: 0x" + Integer.toHexString(headLen));
      System.out.println("BNI Version: 0x" + Integer.toHexString(ver));
      System.out.println("Images: " + imagecount);
      System.out.println("Start position: 0x" + Integer.toHexString(datastart));
      */
     
      Icon[]  icons = new Icon[imagecount];
      /* Image info format:
       * (DWORD) FlagValue - User's flags must match this value after a BitwiseAnd of the two for this icon to be valid
       * (DWORD) IconWidth - Icon's width
       * (DWORD) IconHeight - Icon's height
       * (DWORD-List) Software - User's software must be one of these values for this icon to be valid. (Real games support up to 32 values for this field)
       */
      for(int x = 0; x < imagecount; x++){
        int flags = fileData.removeDWord();
        int width = fileData.removeDWord();
        int height = fileData.removeDWord();
        int[] prods = new int[32];
        int z = 0;
        i = fileData.removeDWord();
        while(i != 0){
          prods[z++] = i;
          i = fileData.removeDWord();
        }
        icons[x] = new Icon(flags, width, height, prods);
        //System.out.println(icons[x].toString());
      }
      BufferedImage fullicons = tgaToImage(fileData); //This takes in a TGA compressed image and returns a BufferedImage to be split up.
      if(fullicons == null) return false;
      int currentX = 0; int currentY = 0;
      for(int x = 0; x < icons.length; x++){
        if(currentX + icons[x].getWidth() > ((Image)fullicons).getWidth(null)){ //If this image wont fit, move down (Possile bug if all images are not the same height)
          currentX = 0;
          currentY += icons[x].getHeight();
        }
        Image icon = fullicons.getSubimage(currentX, currentY, icons[x].getWidth(), icons[x].getHeight()); //Split em up yo!
        icons[x].setIcon(icon);
        iconlist.add(icon);
        currentX += icons[x].getWidth();
      }
      return true;
    }catch(Exception e){
      e.printStackTrace();
    }
    return false; 
  }

  /* GetIcon(Flags, Product)
   * This will go through all the current icons you have loaded,
   * and pick out the appopriate one for this information.
   * Note:
   *  Order of selection is in the order they were loaded form file.
   *  This means, an icon takes presidence over any icon loaded after it.
   *  So load your custom bni first if you want it to override the real ones. :P
   *
   *  This returns the icon in an Image object, If there is no suitible icon, null is returned.
   */
  public Image getIcon(int flags, int product){
    Object[] images = iconlist.toArray();
    if(flags != 0){ //Check all icons that have flags 1st.
      for(int x = 0; x < images.length; x++){
        int iconflags = ((Icon)images[x]).getFlags();
        if((flags & iconflags) == iconflags && (iconflags != 0)) return ((Icon)images[x]).getIcon();
      }
    }

    for(int x = 0; x < images.length; x++){//Now if an icon was not found, check against each product list.
      int[] iconproducts = ((Icon)images[x]).getProducts();
      for(int i = 0; i < iconproducts.length; i++)
        if(iconproducts[i] == product) return ((Icon)images[x]).getIcon();
    }
    return null;
  }



  /* This is a simple class to hold the data for each Icon we get. Pretty self explnitory */
  private class Icon{
    private int flags = 0;
    private int width = 0;
    private int height = 0;
    private int[] prods = null;
    private Image icon = null;

    Icon(int f, int w, int h, int[] p){
      flags = f;
      width = w;
      height = h;
      prods = p;
    }

    public int getWidth(){ return width; }
    public int getHeight(){ return height; }
    public int getFlags(){ return flags; }
    public int[] getProducts(){ return prods; }
    public Image getIcon(){ return icon; }
    public void setIcon(Image i){ this.icon = i; }
    public String toString(){
      StringBuffer buff = new StringBuffer();
      buff.append("Flags: 0x");
      buff.append(Integer.toHexString(flags));
      buff.append(", Size: ");
      buff.append(width);
      buff.append("x");
      buff.append(height);
      buff.append(", Prods:");
      for(int x = 0; x < prods.length; x++){
        if(prods[x] != 0){
          buff.append(" 0x");
          buff.append(Integer.toHexString(prods[x]));
        }
      }
      return buff.toString();
    }
  }
 
  /* togToImage(Buffer)
   * This will create a BufferedImage out of the raw TGA data.
   * Currently, only supports format 10 in the TGA standards.
   * http://local.wasp.uwa.edu.au/%7Epbourke/dataformats/tga/
   */
  private BufferedImage tgaToImage(Buffer data){
    try{
      byte infoLen = data.removeByte();
      byte colorMapType = data.removeByte();
      byte imageType = data.removeByte();
      short colorMapOrigin = data.removeWord();
      short colorMapLength = data.removeWord();
      byte colorMapEntrySize = data.removeByte();
      short startX = data.removeWord();
      short startY = data.removeWord();
      short width = data.removeWord();
      short height = data.removeWord();
      byte depth = data.removeByte();
      byte descriptor = data.removeByte();

      for(int x = 1; x < infoLen; x++) data.removeByte();

      if(colorMapType != 0){
        while(colorMapEntrySize > 0){
          data.removeByte();
          colorMapEntrySize -= 4;
        }
      }
      boolean topdown = ((descriptor & 0x20) == 0x20 ? true : false); //There are two ways the image could start, top left, or bottom left
      /* System.out.println("Start: " + startX + "x" + startY + ", " +
                          "Size: " + width + "x" + height + ", " +
                          "Info Length: " + infoLen + ", " +
                          "Type: " + imageType + ", " +
                          "Depth: " + depth + ", " +
                          "Descriptor: " + descriptor + ", " +
                          "Color Map Type: " + colorMapType + ", " +
                          "Color map Orign: " + colorMapOrigin + ", " +
                          "Color Map Length: " + colorMapLength + ", " +
                          "Color Map Entry Size: " + colorMapEntrySize + ", " +
                          "Top Down: " + topdown);
      */

      BufferedImage bimage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
      Graphics g = bimage.getGraphics();
      int pixlesPainted = 0;
      int position = 0;

      while(pixlesPainted < (width*height)){
        int header = data.removeByte();
        if(header < 0){ //Repeat the same value
          header &= 127;
          header++;
          int blue = (data.removeByte()+256)%256;
          int green = (data.removeByte()+256)%256;
          int red = (data.removeByte()+256)%256;
          g.setColor(new Color(red, green, blue));
          for(int x = 0; x < header; x++){
            int w = (int)(pixlesPainted % width);
            int h = (int)(pixlesPainted / width);
            if(topdown)
              g.fillRect(w, h, 1, 1);
            else
              g.fillRect(w, height-h-1, 1, 1);
            pixlesPainted++;
          }
        }else{//Raw pixle info
          header &= 127;
          header++;
          for(int x = 0; x < header; x++){
            int blue = (data.removeByte()+256)%256; // Stupid java signed bytes -.-
            int green = (data.removeByte()+256)%256;
            int red = (data.removeByte()+256)%256;
            int w = (int)(pixlesPainted % width);
            int h = (int)(pixlesPainted / width);
            g.setColor(new Color(red, green, blue));
            if(topdown)
              g.fillRect(w, h, 1, 1);
            else
              g.fillRect(w, height-h-1, 1, 1);
            pixlesPainted++;
          }
        }
      }
      return bimage;
    }catch(IndexOutOfBoundsException e){
      return null;
    }catch(Exception e){
      e.printStackTrace();
    }
    return null;
  }
}
Comments?
There is one non-java dependency, And that would be iago's Buffer class.
~Hdx

21
Botdev / Lockdown
« on: February 24, 2007, 10:34:16 pm »
[Joe Edit: Split from *me*]

Just a note:
Lockdown is completely possible to do in Java ;)
But its not working yet.
~Hdx

22
Botdev / New CRev
« on: August 23, 2006, 07:22:21 am »
Maby its jsut cuz its 4AM
But I can't seem to get it working >.<
http://jbls.org/CheckRevision.java
Any pointers.
I'll come back to it in the morning after some well needed sleep.
Btw <3 Skywing/Myndfry.
Anyone who looks at the code should see what I'm trying to do.
Thats what they changed in the new ix86 files.
Anyone know why it is returning the wrong values >.<
~-~(HDX)~-~

23
General Programming / [Java] Platform information
« on: May 24, 2006, 02:16:15 am »
Well, does anyone have any clue how to get platform imforation with Java?
Basic information, Country, Operating system, Archatecture (CPU), and anything else.
My crappy first idea was simply checking the current directory, seeing if there was a drive letter, if not :P
Anyways, anyone got any ideas?
~-~(HDX)~-~

24
General Programming / Java 3D
« on: May 15, 2006, 09:47:29 pm »
Does anyone know ANYTHING about Java 3d?
I am really interested in making basic 3d aplications.
A basic cube will be <3!
All I could find were applet examples, but no applications, So anyone know anything?
~-~(HDX)~-~

25
General Programming / [VB6] RTB Colors, SendMessage
« on: April 24, 2006, 12:09:41 pm »
Well, I kinda have a problem, I'm trying to append a rich text box, The text gets sent, but it is always the color of the background, so I can't see it.

How would you specify the color of the text when using SendMessage() to append it.
Code: [Select]
Dim X As CharFormat
X.cbSize = LenB(X)
X.crTextColor = vbRed
X.dwMask = CFM_COLOR

A = SendMessage(Z, WM_GETTEXTLENGTH, 0, 0) + 1
SendMessage Z, EM_SETSEL, A, 1
SendMessage Z, EM_SETCHARFORMAT, SCF_SELECTION, ByVal X
SendMessage Z, EM_REPLACESEL, 0, ByVal "Testing" & vbNewLine
SendMessage Z, EM_SCROLL, SB_LINEDOWN, 0
All of the constants are there proper formats, as far as I know:
Code: [Select]
Private Const WM_GETTEXTLENGTH As Long = &HE
Private Const EM_SETSEL& = &HB1
Private Const EM_REPLACESEL& = &HC2
Private Const EM_SCROLL& = &HB5
Private Const SB_LINEDOWN& = 1
Private Const SCF_SELECTION& = 1
Private Const EM_SETCHARFORMAT& = &H444
Private Const EM_GETCHARFORMAT& = &H43A
Private Const CFM_COLOR& = &H40000000

Private Type CharFormat
    cbSize As Long
    dwMask As Long
    dwEffects As Long
    yHeight As Long
    yOffset As Long
    crTextColor As Long
    bCharSet As Byte
    bPitchAndFamily As Byte
    szFaceName(32) As Byte
End Type
Z of corse is the handle for the RTB.
But please, Don't think I don't know how to use .SelColor -.- its not the point of this program, the point is to do it via sendmessage, for experiance.

Unless you know a way of Java using the SendMessage/FindWindow/FindWindowEx APis, it needs to be in VB, BTW, it does NOT have to be cross platform of corse :P
~-~(HDX)~-~

26
General Discussion / Disc Imaging
« on: April 20, 2006, 09:30:26 pm »
Ok, I need a program that will copy a exact disc from one to another.
In linux.
Simmilar to Nortan Ghost, but for linux.
When I say disc I mean HD not CD.
I need to copy the contents of my 160GB to my 250GB and then zero my 160GB cuz i'm adding another 300GB HDD.
the 160GB is my boot disc, so ya, it needs to copy everything exactly.
Any suggestions???
~-~(HDX)~-~

27
General Programming / Java GUI's
« on: March 07, 2006, 01:10:33 am »
Well, I need help, how do you set the background of a JFrame?
Code: [Select]
import javax.swing.JFrame;
import java.awt.Graphics;
import java.awt.Color;

public class Form extends JFrame {
public Form() {
super("Helo homies!");
this.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
this.setSize(300, 300);
this.setVisible(true);
setBackground(Color.BLACK);
}

public void paint(Graphics g){
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth, getHeight);
g.setColor(Color.RED);
g.drawLine(10, 0, 200, 20);

}
}
I'm trying to have a black background, and a red line.
The black background shows up, untill i start re-sizing.
then it reverts tot he defult grey-ish color.
Anyone have suggestions?
~-~(HDX)~-~

28
General Discussion / Alg2 Problem
« on: February 08, 2006, 09:30:50 pm »
Code: [Select]
13^13+13^20/80^-42^(16^-2\4^-1-(32^2)/(2^6-4^2))This is an actuall problem my Math teacher gave our class.
This was the VARY FIRST problem of the new semester.
Note: All notation is VB notation.
It took me a whole 1 min to figure it out ;)
He made us show the work.
So, can you solve it? If so show ALL of your work (scann the paper if you can) I wana see the processes you all take.
~-~(HDX)~-~

29
Botdev / JBLS Legacy Clients
« on: January 23, 2006, 11:52:12 pm »
Well I was bored, so I added Legacy Client support to JBLS
It's something i've always wanted to see in BNLS, but there not gona do it.
These are the following new Product IDS:
DRTL 0x09
DSHR 0x0A
SSHR 0x0B

They are mearly extentions of the following BNLS Packets:
BNLS_VERSIONCHECK 0x09
BNLS_REQUESTVERSIONBYTE 0x10
BNLS_VERSIONCHECKEX 0x18

They will return the correct information for these clients, jsut as those messages would for the other clients.
Meh anyways I jsut wanted to sell people, see if anyone would use it, if it's worth the 5 mins it took to implament.
If it is, and a bunch of bots start supporting this, I'm sure we can get Skywing to add it to the real BNLS <3
~-~(HDX)~-~

30
General Programming / Programming class
« on: September 28, 2005, 01:11:21 am »
Well... My class sucks, were learning Java.. And we're going REALLY slow.
We're in what the 3rd-4th week and werer only to If statements -.-
If yall wana look you can find out course work here:
http://hdx.no-ip.org/Labs/
Post comments, Code, etc..etc.. anything you have to say about my shitty class :P
~-~(HDX)~-~

Pages: 1 [2] 3