Go Back   The PokéCommunity Forums > ROM Hacking > ROM Hacking Hub
Reload this Page Survey [ASM]Inserting routines;How do you do them and your problems?

Notices
For all updates, view the main page.

ROM Hacking Hub General discussions about ROM Hacking and Emulation. Not sure where to start? This is the place for you.
Posting links to ROMs is illegal and is not tolerated anywhere on the forum.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #1    
Old January 3rd, 2010 (07:56 PM).
interdpth interdpth is offline
I've seen things, man.
 
Join Date: Jul 2004
Posts: 275
Usually I steal a piece of code that's about 5 instructions

so I can do a

LDR r3,=myroutine;
MOV r15,r3


then my routine executes, or i'll just edit some code.

Recently I tried the callasm function and my function executed but died, yet I know the code works.

What to do you guys do? Prefer?
__________________
yes, this is doge.

potato is not here.

bye
Reply With Quote
  #2    
Old January 3rd, 2010 (08:51 PM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
Silver Tier
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Posts: 1,816
I dunno, cause I'm not quite that ASM savvy yet... Dunno how to do that...
You sure you ended the routine correctly? (Just saying, cause everyone makes mistakes from time to time...)
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #3    
Old January 3rd, 2010 (09:00 PM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
Crystal Tier
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,592
I haven't delved deeply enough into ASM to require editing of preexisting code but I'm thinking I'll end up using your method because it's so simple^^
I assume that with your method you have to "recreate" the code that you overwrote with the 'ldr' and 'mov' in your custom routine?
__________________

Brother of Vrai
Reply With Quote
  #4    
Old January 3rd, 2010 (09:14 PM).
ZodiacDaGreat's Avatar
ZodiacDaGreat ZodiacDaGreat is offline
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Posts: 429
Send a message via ICQ to ZodiacDaGreat
Yes, you have to. And you'd also wanna make sure that the registers after executing your code must have the same values. This can be done by push and pop. Here's my way:
ldr r0, .Routine
bx r0
__________________
Reply With Quote
  #5    
Old January 3rd, 2010 (09:29 PM).
0m3GA ARS3NAL's Avatar
0m3GA ARS3NAL 0m3GA ARS3NAL is offline
Im comin' home...
Silver Tier
 
Join Date: Jan 2008
Location: Superjail Penitentiary
Age: 22
Gender: Male
Nature: Gentle
Posts: 1,816
Ahh... very helpful indeed Zodiac...
See, this is why I like the R&D department... Mature discussion about the finer points of hacking...
Good stuff indeed...
__________________
>Boot Jailbot
>Pass *****
.
.
Jailbot OS Ver 1.1.2
Greetings Warden
of Superjail Penitentiary
Awaiting user input...

>Display User_Info
╠══User Info══╣
Username:
0m3GA ARS3NAL
Age: 18
Sex: Male ♂
Race: Caucasian
Quote:
"What is this
I don't even..."

M/O: Often acts out to get attention, but recently has changed that. Has been studying up on hacking information and hopes to participate in more advanced hacking discussion.
╠══End of File══╣
Awaiting user input...

>
Reply With Quote
  #6    
Old January 4th, 2010 (05:24 AM).
Juan Juan is offline
Brazilian with a bad English
 
Join Date: Jun 2007
Location: Pindamonhangaba - SP
Age: 24
Nature: Adamant
Posts: 92
ldr Rx, offset+1
bx Rx

or

ldr Rx, offset
mov PC Rx
__________________
Reply With Quote
  #7    
Old July 23rd, 2013 (02:06 PM).
Kurapika's Avatar
Kurapika Kurapika is offline
Grudgebearer
 
Join Date: Feb 2013
Location: Lavendar Town - Morocco
Gender: Male
Nature: Naughty
Posts: 398
Quote originally posted by Juan:
ldr Rx, offset+1
bx Rx

or

ldr Rx, offset
mov PC Rx
How do you insert that offset?
I mean, when I try to compile "ldr r0, 0x08900001 bx r0" it threws an error.
Should I do:
ldr r0, .offset
bx r0
.offset: .word 0x8900001

??
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
Thread Tools

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 On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 02:30 PM.