Oni Central Forum

A forum for the Oni community

You are not logged in.

#26 01/30/10 07:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: C/C++ Programming discussion

Gumby and debuggers don't seem to get along.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#27 01/30/10 15:01

3llense'g
Member
From: Europe, Hungary, Budapest
Registered: 07/05/09

Re: C/C++ Programming discussion

Script_10k wrote:

I like java too. Just program something and it will almost work with all os. (I use eclipse)

However for this case it doesn't seem the best solution at all.

If that's for me, I'm not talking about Java. I'm talking about Netbeans. smile


You can call me 3llen. It's shorter and simpler. wink

Offline

#28 01/30/10 16:01

s10k
Member
Registered: 01/14/07
Website

Re: C/C++ Programming discussion

Sorry. I didn't notice.

Offline

#29 03/23/10 23:03

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: C/C++ Programming discussion

Found a college course on programming and they are teaching C.  You can watch the lectures.
http://cs50.tv/2009/fall/

Offline

#30 05/18/10 12:05

s10k
Member
Registered: 01/14/07
Website

Re: C/C++ Programming discussion

Reviving the topic. Just learned C at the university. I was doing some kind of shells for linux, but I think now that I have absorbed the sintax and the basis.

Maybe I can help you now in future in something that requires this.

I was looking at the Daodan_Cheater.c, I got confuse with the memory hacking, because I have not touch this yet in any lessons. For example the defines that you have there like:

#define GSA_camera        (0x00000080)

Seems be like a pointer to that memory position, but I was wondering how you could calculate that? Isn't oni memory code allocated differently every time you run it?

I believe that you have a algorithm that does calculate it, there is any source that I can look at, so I can have a little more notion how it works?

Also I started programming c with gcc and gedit, and it was ok for little when the program was little lines, but I couldn't resist and I migrated to complete eclipse c/c++ ide. Love it and how it show the errors.

AEInstaller's GUI is written in a framework called WxWidgets (if I remember correctly). This is what makes it cross-platform (running on both Windows and Mac OS.) It's also the same framework used to write Audacity.

Yeah seems it is a quite popular, pidgin which I use to talk with yahoo guys from here, seems also written with it.

I believe that I will work in next lessons with Windows and it's owns libraries or maybe guis. I will see.

Offline

#31 05/18/10 12:05

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: C/C++ Programming discussion

It's a reference to an offset of a struct. A really ugly one. tongue In the beta\unlrealeased version of the Daodan, I scrapped them for real structs.

typedef struct
{
  int TimerMode;
  char TimerName[32];
  int TimerDuration;
  char field_28;
  char gap_29[3];
  int field_2C;
  Letterbox Letterbox;
  char gap_3a[2];
  char field_3C;
  char gap_3d[3];
  int field_40;
  int CutsceneSyncMark;
  char field_48;
  char gap_49[3];
  int field_4C;
  int field_50;
  int field_54;
  int field_58;
  int field_5C;
  int field_60;
  int field_64;
  int field_68;
  int field_6C;
  int field_70;
  int FadeStartTime;
  int FadeEndTime;
  char field_7C;;
  int Camera;
/**more stuff* */
} GameState;

If you add up all the bytes before Camera, you get 0x80 smile

For example...

#define GSA_CAMERA 0x80
GameState tempGS;
GameState* ONgGameState = &tempGS;

//this
GameState->Camera = 1;
//this
*(int *)((char)GameState + offsetof(GameState, Camera)) = 1;
//and this
*(int *)((char)GameState + GSA_CAMERA) = 1;
//Are all the same.

If you do decide to compile that code to check it out, make sure you set alignments to 1 byte boundries: http://msdn.microsoft.com/en-us/library … S.80).aspx


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#32 05/18/10 13:05

s10k
Member
Registered: 01/14/07
Website

Re: C/C++ Programming discussion

Thanks. I will look at it. Where can I find some more oni hacking source codes?

Last edited by s10k (05/18/10 13:05)

Offline

#33 05/18/10 13:05

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: C/C++ Programming discussion

The Daodan source repository: http://svn.oni2.net/Daodan/

That code only compiles with GCC though, if you are an MSVC user (like me) you will need the beta-beta code. I'll upload that soon, I've been meaning to.


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

Board footer

Powered by FluxBB