Programming General

Jun 13, 2015 at 8:01 AM
Senior Member
"Fly, Fly, Fly!"
Join Date: Sep 19, 2013
Location: C:\Users\Shinigami\Dirty_Videos
Posts: 125
Age: 25
Hey there! I know there are quite a few programmers here, so I thought we could make a thread to discuss such matters! Talk about your new non-game programs, ask questions, whatever as long as it's programming related! I'll kick things off with 2 things:

1. My image glitching program "Glitch It!". Program and source available at http://shinigamimachine.com/projects.html

2. Does anybody know how to edit hex in VB2012? I know how to read the data from a file, but not how to read it as hex. I want to be able to make a CS profile editor (it won't be anything special or different really, just a test to see if I know what I'm doing)
 
Jun 13, 2015 at 1:59 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
Jun 13, 2015 at 2:55 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
imo you should just use a dedicated hex editor, XVI32 has never done me wrong
 
Jun 13, 2015 at 3:28 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
ShinigamiMachine said:
Does anybody know how to edit hex in VB2012? I know how to read the data from a file, but not how to read it as hex. I want to be able to make a CS profile editor (it won't be anything special or different really, just a test to see if I know what I'm doing)
I'm not sure what you mean, are you asking for a way to display an integer as a hex string? Because then it's just:
Code:
Dim i As Integer
i.ToString("X")
There is no way to read something as "Hex", you can either read a file as a text or binary file but nothing else. What you're asking about is probably how to encode/decode your input/output.
 
Jun 13, 2015 at 4:39 PM
Senior Member
"Wahoo! Upgrade!"
Join Date: Aug 11, 2014
Location:
Posts: 57
things aren't stored in hex. As far as I'm aware hex was just a notation for programmers because it's more convenient than binary or base 10.

you would need to read the file in as binary, convert it to hex, let the programmer edit that, then convert back to binary and store it in the file.
 
Jun 13, 2015 at 5:44 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
What I did was read the .dat file into a byte array, then access specific parts of the array to convert the values back into integers or chars or whatever. I don't remember if there was a different syntax for reading bytes, but I'm pretty sure it was really simple. Once I'm back at home I can find my code for you.
 
Jun 13, 2015 at 7:41 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: Sep 19, 2013
Location: C:\Users\Shinigami\Dirty_Videos
Posts: 125
Age: 25
Thanks for all the help guys!


Noxid said:
imo you should just use a dedicated hex editor, XVI32 has never done me wrong
But I want to make a program that edits specific values so that it could do something like a CS profile editor.
 
Jun 13, 2015 at 8:55 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Lots of those already exist though
 
Jun 13, 2015 at 10:08 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: Sep 19, 2013
Location: C:\Users\Shinigami\Dirty_Videos
Posts: 125
Age: 25
Noxid said:
Lots of those already exist though
I know, there are other things I want to do with hex editing. That was just an example so people could understand what I was trying to achieve
 
Jun 14, 2015 at 1:23 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 22, 2015
Location:
Posts: 249
As the only programmer here, I think we need a thread for translators, not for programmers ;)
 
Jun 14, 2015 at 1:52 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
q3hardcore said:
As the only programmer here
I guess I better just fade away...........
 
Jun 14, 2015 at 6:29 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 31
q3hardcore said:
As the only programmer here, I think we need a thread for translators, not for programmers ;)
You're a programmer?!?
 
Jun 15, 2015 at 4:11 AM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Mar 14, 2015
Location: my house :)
Posts: 175
Well, I can make a smiley face using Javascript.
 
Jun 15, 2015 at 4:09 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Aug 2, 2014
Location: inactivity.
Posts: 115
ShinigamiMachine said:
Thanks for all the help guys!


But I want to make a program that edits specific values so that it could do something like a CS profile editor.
Getting to the point: It seems you want to manipulate byte values.
That's simple in VB.Net: Use "File.ReadAllBytes" to get a byte array, get bytes out of it, modify bytes, etc, and use "File.WriteAllBytes" to write back to the file. (To make a new file, create a new byte array, put whatever data into it and use File.WriteAllBytes)

Note to those who would prefer using FileStream: I'm assuming I should keep it simple, and that he's working with fixed-size files with known layouts(like a CS profile editor).
 
Jun 18, 2015 at 6:11 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: Sep 19, 2013
Location: C:\Users\Shinigami\Dirty_Videos
Posts: 125
Age: 25
gamemanj said:
Getting to the point: It seems you want to manipulate byte values.
That's simple in VB.Net: Use "File.ReadAllBytes" to get a byte array, get bytes out of it, modify bytes, etc, and use "File.WriteAllBytes" to write back to the file. (To make a new file, create a new byte array, put whatever data into it and use File.WriteAllBytes)

Note to those who would prefer using FileStream: I'm assuming I should keep it simple, and that he's working with fixed-size files with known layouts(like a CS profile editor).
Thank you for your help, and I much prefer ReadAllBytes to FileStream. Now let's change this thread's topic from my little question to programming stuff in general (as the title suggests!)
 
Jun 19, 2015 at 4:17 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
ok but uhhh
what do you want to talk about
 
Jun 19, 2015 at 4:20 AM
Senior Member
"Fly, Fly, Fly!"
Join Date: Sep 19, 2013
Location: C:\Users\Shinigami\Dirty_Videos
Posts: 125
Age: 25
Well, I don't know. Are any programmers here working on non-game projects? Those could be fun to discuss!
 
Jun 19, 2015 at 6:03 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 22, 2015
Location:
Posts: 249
ShinigamiMachine said:
Well, I don't know. Are any programmers here working on non-game projects? Those could be fun to discuss!
Sure, I'm trying to re-write OrgView's org-loading code, so I can load external orgs.
 
Top