You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

timrs

Beginner

  • "timrs" started this thread

Posts: 13

Location: MN, U.S.

  • Send private message

1

Monday, April 2nd 2007, 5:08pm

Some Help Hexxing Stuff in C using kdevelop

http://forums.halomods.com/viewtopic.php?t=21108 shows how to hex edit a file -- but 1 prob, its in visual basic, and I'd like to figure out how to port this to a simple c based kde app -- so could anyone help with this?

timrs

Beginner

  • "timrs" started this thread

Posts: 13

Location: MN, U.S.

  • Send private message

2

Monday, April 2nd 2007, 10:40pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
            FileStream fs = new FileStream((map.path, 
                 FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); 
 
             BinaryReader br = new BinaryReader(fs); 
             BinaryWriter bw = new BinaryWriter(fs); 
 
             int sig = 0; 
             long length = br.BaseStream.Length; 
 
             br.BaseStream.Position = 2048; 
 
             for (long i = 2048; i < length; i += 4) 
                 sig ^= br.ReadInt32(); 
 
             bw.BaseStream.Position = 720; 
             bw.Write(sig); 
 
             br.Close(); 
             bw.Close();
Is how to sign a map in C#, what would I do to get this into C/C++ for use in kdevelop

This post has been edited 1 times, last edit by "timrs" (Apr 2nd 2007, 10:41pm)