Memory Address Blocks
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Memory Address Blocks
by infernal » 14 Mar 2010, 00:41
Hi, i'm trying to make some cards but i don`t wanna mess with other developers address blocks so i wanna "claim" the block 2,105,000 - 2,200,000, just after harrypitfall.
The problem is, when i change "build.pl" and i compile it, it still points to
address 20024BA (5 more than the previous address).
thank you in advance
The problem is, when i change "build.pl" and i compile it, it still points to
address 20024BA (5 more than the previous address).
- Code: Select all
use strict;
use warnings;
use File::Copy;
# Open ManalinkEh.asm and add in the new card / function
my $new_function = $ARGV[0];
if( $new_function ){
my $skip = 0;
$new_function = "_card_$new_function";
my $extern = 0;
my $jmp = 0;
my $hex;
open my $fh, '<', 'ManalinkEh.asm';
my @lines;
while( my $line = <$fh>){
if( $line =~ $new_function and not $skip ){
print "You already added that card.\n";
$skip = 1;
}
if( $line =~ /extern/ ){ $extern = 1; }
if( $extern and $line !~ /extern/ and not $skip){
push @lines, "extern $new_function\n";
$extern = 0;
}
if( $line =~ /jmp near/ ){
$jmp = 1;
($hex) = $line =~ /;\s+([A-Z0-9]+)/i;
}
if( $jmp and $line !~ /jmp near/ and not $skip){
my $a = eval( "0x020024BF" ); -----------------> here's my change
my $new_hex = sprintf "%x", $a;
push @lines, " jmp near $new_function ; $new_hex\n";
$jmp = 0;
print "Adding $new_function at $new_hex\n";
}
push @lines, $line;
}
close $fh;
# Re-write the file
open $fh, '>', 'ManalinkEh.asm';
print { $fh } @lines;
close $fh;
}
# Run make
`make`;
# Copy the new dll to the magic directory
copy('ManalinkEh.dll','c:\magic\ManalinkEh.dll') or die "Copy failed: $!";
#clean up
#`make clean`;
thank you in advance
- infernal
- Posts: 2
- Joined: 14 Mar 2010, 00:30
- Has thanked: 0 time
- Been thanked: 0 time
Re: Memory Address Blocks
by jatill » 14 Mar 2010, 12:05
New cards are coded in C, not ASM. Therefore, you don't need to worry about memory addresses at all. build.pl will put code in the appropriate places and report where it put it.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests