Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2005, 20:50
ADX
 
Posts: n/a
Post XM files in ASM [Mini-tutorial]

If you want to put a XM (Modular Music) in your assembler programs, you can follow these steps:

Quote:
To play music, I use the MiniFMOD 1.60 library.

In the RC (Resource) file:

#define IDM_MUSIC 400
IDM_MUSIC RCDATA "music.xm"


In the .asm file:
You may include the libraries:

include mfmplayer.inc
includelib mfmplayer.lib


Declare the music const:

.const
IDM_MUSIC equ 400


Add the data variables:

nMusicSize DWORD ?
pMusic LPVOID ?


Put the this code on the start of the app:

start:
;chiptune
INVOKE GetModuleHandle, NULL
mov hInstance, eax
; Load the music
push esi
INVOKE FindResource, hInstance, IDM_MUSIC, RT_RCDATA
push eax
INVOKE SizeofResource, hInstance, eax
mov nMusicSize, eax
pop eax
INVOKE LoadResource, hInstance, eax
INVOKE LockResource, eax
mov esi, eax
mov eax, nMusicSize
add eax, SIZEOF nMusicSize
INVOKE GlobalAlloc, GPTR, eax
mov pMusic, eax
mov ecx, nMusicSize
mov dword ptr [eax], ecx
add eax, SIZEOF nMusicSize
mov edi, eax
rep movsb
pop esi

...
...
end start

And the code for execute the music:

invoke mfmPlay, pMusic

To free the memory (music stops):

INVOKE GlobalFree, pMusic

The needed files and this txt is attached.

This is all!
Tested on WinXP SP2. WinAsm 5.1. Compiled with MASM 8.2 (compatible with SP2)
Be happy !
(If you find another good "minituto" like this one, you can put it here.)

this is another not-so-mini tutorial on the same topic: hxxp://www.freewebtown.com/fusionrulez/database/xmmusicasm.zip by fornix

[EDIT:JMI] DO NOT ANSWER YOUR OWN POST. USE THE EDIT BUTTION TO ADDED TO THE ORIGINAL. OTHERWISE IT LOOKS LIKE POST COUNT PADDING AND THAT WILL GET YOU BANNED.
[About the edit:ADX]Hey, sorry JMI, I'm not answered my own post (and I'm editting now), and I found this "thing" on the net, this isn't made by me, and I didn't know about the really author of that. I don't want to "padding" posts, it's only a post for the people who don't knows how to add xm files in assember (like me). In any case, sorry, I'm new.
My regards: ADX


(So, thanks to fornix for that tutorial)

Byez

ADX Note: Because we found the author (fornix) of this tutorial, I removed the attachment.

Last edited by ADX; 12-02-2005 at 22:55. Reason: Simple Mistake
Reply With Quote
  #2  
Old 12-02-2005, 13:20
Android
 
Posts: n/a
Thanks for the tutorial, but is there any one which is in C or C++ ?
Plese share it, if you have any.
Regards,
Android.
Reply With Quote
  #3  
Old 12-02-2005, 19:50
acme acme is offline
Friend
 
Join Date: Aug 2005
Posts: 30
Rept. Given: 2
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 7
Thanks Rcvd at 10 Times in 9 Posts
acme Reputation: 1
Basexm Player Sources 11 By Shub-nigurrath, from accessroot... i think

visit:
h**p://releases.accessroot.com/
Reply With Quote
  #4  
Old 12-02-2005, 21:56
diablo2oo2's Avatar
diablo2oo2 diablo2oo2 is offline
Family
 
Join Date: Mar 2004
Posts: 232
Rept. Given: 7
Rept. Rcvd 111 Times in 26 Posts
Thanks Given: 2
Thanks Rcvd at 20 Times in 7 Posts
diablo2oo2 Reputation: 100-199 diablo2oo2 Reputation: 100-199
Quote:
Originally Posted by Android
Thanks for the tutorial, but is there any one which is in C or C++ ?
Plese share it, if you have any.
Regards,
Android.
got one here
Attached Files
File Type: zip keygen_w_music_REA_c++.zip (202.3 KB, 31 views)
__________________
Thinking In Bytes
Reply With Quote
  #5  
Old 12-02-2005, 22:19
ADX
 
Posts: n/a
Some sources

Well, I found something.
A Thread about XM in ASM [English]:
hxxp://www.reversing.be/forum/viewtopic.php?p=1648
In this web you can find the sources to add XM in Delphi (you need to register) [Spanish]:
hxxp://redhawk.hispadominio.com/
Thanks

Byez
Reply With Quote
  #6  
Old 12-02-2005, 22:31
asterix asterix is offline
Friend
 
Join Date: Feb 2003
Posts: 98
Rept. Given: 1
Rept. Rcvd 4 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 4 Times in 4 Posts
asterix Reputation: 4
ufmod.lib and more examples
http://www.wasm.ru/src/4/ufmod.zip
Reply With Quote
  #7  
Old 12-03-2005, 00:13
xtiaoshi's Avatar
xtiaoshi xtiaoshi is offline
bbs.pediy.com
 
Join Date: Feb 2005
Location: China. MainLand
Posts: 1,057
Rept. Given: 142
Rept. Rcvd 432 Times in 185 Posts
Thanks Given: 21
Thanks Rcvd at 212 Times in 99 Posts
xtiaoshi Reputation: 400-499 xtiaoshi Reputation: 400-499 xtiaoshi Reputation: 400-499 xtiaoshi Reputation: 400-499 xtiaoshi Reputation: 400-499
Extremely significant.
__________________
�����ԧ�ѧާާߧ�� ��ҧ֧��֧�֧ߧڧ� �ӧ�����ܧ� �� Windows Crack ���ҧ��֧ߧڧ�
���ѧ�-Dabei Guanyin ����է�ڧ�ѧ��ӧ� ���ѧ� �ҧ֧� �ާڧ�ѧҧ��
Reply With Quote
  #8  
Old 12-03-2005, 00:58
goggles99 goggles99 is offline
Friend
 
Join Date: Aug 2004
Posts: 62
Rept. Given: 5
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 1
Thanks Rcvd at 4 Times in 4 Posts
goggles99 Reputation: 0
Channels seem reversed

Very nice contribs guys, thanks.
One small thing I noticed about these libs is that they reverse the right and left music channels VS WinAmp 5. Which one is correct?
Reply With Quote
  #9  
Old 12-04-2005, 02:23
ADX
 
Posts: n/a
Some answers

@goggles99, I'm not sure about that. You can post this in the FMOD forum (If you are talking about MiniFMOD library: mfmplay). The programmers of this libraries will answer you (I think ). Look at hxxp://www.fmod.com.
You can go here for uFMOD library, Korean site (and I think you can talk about, but in Korean language): hxxp://www.asmlove.co.kr/bbs/zboard.php?id=asm_forum&no=6.
About C++ and uFMOD: hxxp://www.wasm.ru/forum/index.php/index.php?action=vthread&forum=5&topic=8986
The Canterwood site. You can get here asm sources of keygens that uses XM, and more more much . hxxp://canterwood.online.fr/
I think this will be useful four your projects!

Byez
Reply With Quote
  #10  
Old 12-05-2005, 20:30
Android
 
Posts: n/a
Quote:
Originally Posted by diablo2oo2
got one here
Thanks for the help.
Regards.
Android.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 16:22.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )