cbox
-
Posts
1426 -
Joined
-
Last visited
-
Days Won
9
Content Type
Profiles
Forums
Downloads
Gaming News
Everything posted by yungbol
-
Lol, comcast owns the biggest building in my city. http://farm4.static.flickr.com/3213/2501408043_b6b593e337.jpg Philly baby... reppin' lol. http://www.yourimageforever.com/artforsale/IMG_7457e.jpg
-
Lol, I seen Quickkill say Ownt in the chatbox and post this topic, so I had to post mines... Someone come along and own me!!!! with todays date of course
-
http://www.speedtest.net/result/430838975.png
-
You have really nice upload speed though... My upload isn't too good, but I love my download lol.
-
Or make him look like: Athrun Zala 02♥ Jk. Jk...
-
Firefox 3 with cool skins lol. Speed doesn't really bother me with this: http://www.speedtest.net/result/430838975.png
-
Injecting Images in C# Ok, so before using this tutorial I recommend you mess around with the language a little bit. Follow my other tutorial on how to show images then, I am sure you will be ready for this. Note: In this tutorial I will only be showing pictures of the code, I want you to get used to typing it rather then copy and pasting. Overview of process: Open a file.Show the image in the container header.Add an option to save the image.Add an option to inject the image.Ok, so open C# create a new windows app and name it whatever you want. In this case I will be naming it iBotModz. Be sure to do our usual steps to the form to make sure no one can resize it or maximize it. Go to tutorial 1 for that. Now, add 3 buttons and name them "Open", "Extract", and "Inject". Also add a picturebox to your form. It should look like: Notice we made the picturebox's properties to "stretch" so the image will fill the full box. Now, double click the "open button" so that the code will appear. Now, instead of using a textbox like last time, we will be using a string. The string will act as an 'invisible' textbox. The code for a string looks like so: Below it is the OpenFileDialog coding as well. Input that and your code should look exactly like mines. Ok, now we want to add a class so that when we open a file, the image will automatically load. To input this, we add a 'void'. Enter the void like so: If you noticed I added that class to the OpenFileDialog result box. That will make this void automatically occur when a file is opened. Now we need to add some code to this void. The code we will add will display the image in the picture box. Just like my previous tutorial we will need to add the IO into the namespace. If you don't know how to do that just enter this at the top: using System.IO; Now in our void we will add the following code: Explanation of code: FileStream fs is creating the 'browsing' of the file. It is what opens the file and makes it readable like in a hex editor.BinaryReader br is what will read ASCII or hex for you.The BaseStream.Position is the offset you will be on.Creating the stream is what will read the image from hex and send it to memory so it can be used at a different time in the code.Then we load the image from the stream to show it.Now, debug you app and load a CON file. It should work flawlessly. Now we are ready to move on to the next part which is extracting or saving the image. Go double click your "extract button" so that you can enter code for it. Explanation of code - All you are really doing here is creating a SaveFileDialog and saving the image that is in the picturebox. This code is pretty self-explanatory. Now debug it, at it should now be able to save images. Now, the hard part... Injecting images. Go double click on your inject button to bring up the code. Just type in this following code and read the explanation after: Explanation of code: The open file dialog is going to allow the user to select the image he/she wants.The filestream imageReader is going to be used for reading the image selected.The byte[] imageLength is getting the length of the image they select and declaring it as a byte[] (which is basically bytes)Then the BinaryReader br is going to read the image.The int data is basically getting the length of the file in a decimal or integer rather then in hex data.Then we reset the postition to 0.Now, we read the whole image. The whole process above gives us a 'read to end' method.We then close them streams and open new ones for the container to inject.We declare a BinaryWriter and set the position to the image beginning.We need to create a loop (while) in order to null out the original image will null bytes. This prevent your image from being smaller and writing and then having all excess data at the end from the old image.We then reset the position to the image beginning and write the image.We input the showImage class to make the new image display.We close our streams.Now, that is really hard and advanced, but if you get that down, you are set to move on. That was something I just learned and it can probably be done many different ways, so if someone has another way, let me know. Now, debug your app and bam! You can now open, extract, and inject images.
-
In vb you can do a messagebox 2 ways.. either: MsgBox("text") or MessageBox.Show("text") In c# it is the same as the 2nd way in VB, MessageBox.Show("Your text here", "Your title here", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
-
False alarm!
-
I only know Covenant and Locust and I picked Locust... They are huge!
-
JUSTREC, I don't care about your "kiddy shit", I just am saying you go and insult people saying noobs and talking shit on me in the shoutbox when I am not even there. I am just spreading the knowledge of they give you a redeemable code, for collectors edition content. You are completely wrong and flame to get away from your error. Just stop, I am not the flaming type but you set me off on a bad note. I have more important things then to worry about you.
-
Noob confusion? Have I seen any research or apps come from you in any way, shape, or form?
-
Honestly I bet 90% of members never looked at the current rules... It needs to just start getting enforced a little harder.
-
Lol, I used to think the same thing. Finally I forced myself to go to C# and am proud of it!
-
Um... I don't know what to say...
-
It was edited after I posted so chill.
-
No, the maximum box to false means they can't click the maximize button in the corner. The form border style to Fixed prevents them from resizing it.
-
Lol, are you sure it wasn't a boy that was touching you JK.
-
Thanks, next time maybe I'll show how to inject images.
-
I did the same thing Peaches, when I started coding like 2 months ago, I was wandering between VB and C#. So many people told me C# will be better once you learn it and you can get help from a lot of the 'top coders'... So I went with c# at first I was confused, I kept trying getting help studying sources and it paid off. I am still not great at coding, but with a hex app, I can do a lot.
-
C#, Ah what a language! This will teach you how to start a foundation for modding applications. Most tutorials on the internet deal with editing text files, creating useless apps. If your really into modifying save games, this is the tutorial for you. Ok, create a new windows form application in C# 2008 .NET. The first thing I like to do is set up my form properties. What I do is the following settings: Maximize Box = false. Form Border Style = Fixed Single. Change the text of my form. Now we throw a button and label it open along with a textbox. Now, we will learn the basic terminology to open a file. Double click your button to bring up the code. Type the following OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "All Files|*.*"; if (ofd.ShowDialog() == DialogResult.OK) { textBox1.Text = ofd.FileName; } else { } Explanation of code - The ofd is giving the OpenFileDialog a nickname. We can now refer to it as ofd. The ofd.Filter is the type of files we can select. In this instance we want all files. Now, the if statement is basically saying "if a user selects a file and clicks ok, this will happen. The else statement is telling what happens if they cancel or X out. In this instance nothing special happens. When the OK is selected, the textbox will display the file path of the file selected so now the application knows what file to access. Now your form should look like the following: Go ahead and debug your app (by clicking the play button [circled in blue]) Now time for the real code after the file is loaded. So, navigate to the namespace (see below) and add the following code: using System.IO; Explanation of code - Adding the System.IO will give you more features into your app for Binary Reading/Writing (hex editing). Ok, now that you have set that up we will create a setup on how to display the image in the CON header into a picturebox. So, add a button and name it Show Image, and add a picturebox onto your form. Change the picturebox's properties to 'Stretch Image'. Now double click on the Show Image button so we can add some code. This is where I may lose you in the tutorial, if you don't understand something, read the explanation below. Add the following code, I will explain it after you add it: FileStream fs = File.OpenRead(textBox1.Text); BinaryReader br = new BinaryReader(fs); br.BaseStream.Position = 0x171A; Stream image = new MemoryStream(br.ReadBytes(16000)); pictureBox1.Image = Image.FromStream(image); fs.Close(); br.Close(); Explanation of code: The fs is creating a filestream or 'file browser'. What it does is will "open and read" the hex data of the file we selected. The textBox1.Text is the file location. BinaryReader is what reads the hex data we want. The BaseStream.Position is where we want to set the 'cursor' at so we can begin our read. The Memory Stream is reading 16000 (enough) bytes (which is the image's hex) and sending it to memory so we can later use it. Then the picturebox is showing the stream of the image so we can show it. The Close(); is just closing all our Streams and Readers so we don't get an error later that the file is in use with another process. Now, go debug you app and test it out. Open a file then show image. It will show the game's image. This is just a small step and soon when I get more time I will create on how to find and edit data in a save. Good luck and happy coding. Result:
-
The next good game might be a long way until COD Modern Warfare 2.
×
- Create New...