It is currently 23 Apr 2024, 06:41
   
Text Size

Memory Address Blocks

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Memory Address Blocks

Postby 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).

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`;
i don`t know much about coding, but i would like to make some cards.
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

Postby 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.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times


Return to Development

Who is online

Users browsing this forum: No registered users and 11 guests


Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 11 guests

Login Form