Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[TuT]Adding Muzic To Your Delphi Application

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun Oct 14, 2007 5:41 pm    Post subject: [TuT]Adding Muzic To Your Delphi Application Reply with quote

Rolling Eyes

W4R10CK @ Astatalk wrote:

Ahh... let's get to the point as we all like Wink

Requirments:

* Some Delphi Knowledge Wink

* The tools

* A Fucking Brain !

* And Astatalk Forum as your homepage ! Very Happy

The step we're going to take are acutaly, disassembling .xm files to array of bytes.

since programming languages uses AOB, right ?!

This TuT is dedicated to Encrypto @ FOFF

First of all, all the tools you need are in the following link:

Code:
http://rapidshare.com/files/62599516/Delphi.rar


Thanks to SHKODRAN @ KraX/UAC Team

Lets start noobs !

After extracting all the tools, open "eff.exe" !!

If you allready have an .xm muzic file in advanced, open it with eff !!.

Don't forget to make an output location !

After clicking "GO !!!", you may now open the Unit in delphi.

you will see const xm: array [1..XXXX] of byte = ($XX, etc, etc);

copy that whole code to your own project, and now.

go to your main form -> Object Inspector -> Events (sorry, i was lazy this time for taking pictures, but it should be visible !!)

OnCreate, we will make the sound start as soon the form creates itself (duhh..)

This little block of code should be needed.

Code:

   { Start playback. }
   if uFMOD_PlaySong(@xm,Length(xm),XM_MEMORY) <> nil then
   begin
      { Wait for user input. }
      MessageBox(0,'uFMOD ruleZ!','Delphi',0);
      { Stop playback. }
      uFMOD_StopSong
   end;
   { Exit program. }
   ExitProcess(0)


Don't forget to add the following procedures:

Code:

procedure MessageBox(hWnd:LongInt;lpText,lpCaption:PChar;uType:LongWord); stdcall; external 'user32.dll' name 'MessageBoxA';
procedure ExitProcess(uExitCode:LongWord); stdcall; external 'kernel32.dll';


it's pretty visible of what they do, 1st procedure calls MessageBox function from kernel32.dll, but it's pretty lame declaring it since it's allready declared in windows.pas (windows.h) unit file -_-"

2nd one is for exiting the process and all of its thread (pretty useful ending its own threads after)


ok ladies, time to continue on. . .

remember that block of code we've stated in OnCreate ?

there's something we need to modify, MessageBox();, we don't want an annoying message going out instead of our application, right ?

what i found out is we can simple replace it with:

<FormName>.ShowModal; //there might be other usefull ways but wha the heck.

Code:

   { Start playback. }
   if uFMOD_PlaySong(@xm,Length(xm),XM_MEMORY) <> nil then
   begin
      { Wait for user input. }
      Form1.ShowModal; //Example !!      
{ Stop playback. }
      uFMOD_StopSong
   end;
   { Exit program. }
   ExitProcess(0)


Now, while your delphi is open with your project, go to "Project -> Add Project" and add uFMOD.pas

then, copy ufmod.obj to your project folder.

And... that's all..

you'll probably hit more bugs further, but you (Yes, YOU !) must fix them yourself, you're on your own soldier ! Wink

Enjoy !!!

P.S - I'm sure there's allways these smartasses who will go like:

SmartAss wrote:
Lol !! noob you can do this instead of this !! haha


Do me a favore, STFU and GTFO you piece of shit, either you accept this or GTFO !

- Peace !,

W4R10CK @ Astatalk !



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message
fujiko
Master Cheater
Reputation: 0

Joined: 28 Aug 2007
Posts: 322
Location: Somewhere out there

PostPosted: Sun Oct 14, 2007 6:25 pm    Post subject: Reply with quote

Nice music ^^
_________________
lol
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Mon Oct 15, 2007 1:00 am    Post subject: Reply with quote

This example is for KeyGens/Patchers...

not projects like AC or wtf ?

44 Views and no comments ?

lolz
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Oct 15, 2007 3:32 am    Post subject: Reply with quote

very nice.
but you can convert it to .res and get the music from the file...
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Mon Oct 15, 2007 4:10 am    Post subject: Reply with quote

HolyBlah wrote:
very nice.
but you can convert it to .res and get the music from the file...


That's another option.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites