PDA

View Full Version : Problem writing script



kraze1984
13-08-2004, 05:48 PM
Hi!

I am making a conversion of Viruz patch from g3n0lite with possibility to send also a Siemens Virus. But i have some problems:

When i run the written script, the program shows me the following
(Verbose level 3):



# Processing started

# Verbose level: 3

# Input flash: 3310_607.fls
# Loading... OK

# Processing: viruz.nrx
# Invalid character in program
# Invalid character in program "('7b'X)"

# Dropping environment pool variables:
sys:
nokix_version = 0.91 beta1 [0x0] (const)
flash_size = 1900544 [0x1D0000] (const)
verbose = 3 [0x3] (const)
nokix_mode = processing [0x0] (const)
project_file = [0x0] (const)
input_flash = D:\Install\NOKIA\NokiX-mod\3310_607.fls [0x0] (const)
output_flash = D:\Install\NOKIA\NokiX-mod\3310_607_1.fls [0x0] (const)

# Script error!


I don't understand what it means (the strings in orange). I' ve tried to comment the strings untill it gets no errors, and it seems that this happens after the code sms_for_3310
(source REMOVED).

Thank you for reply...

mestrini
13-08-2004, 06:13 PM
The problem's in tthe brackets you're using.

Late night script writing hmm?? :lol:


/*create sms_for_3310*/
code=x2c{00030303030000210000}
create "code"; sms_for_3310=rc

I used your script with normal brackets and no errors given ;)

cheers and thanks for helping improving this great prog

kraze1984
13-08-2004, 06:23 PM
The problem's in tthe brackets you're using.

Late night script writing hmm?? :lol:



I used your script with normal brackets and no errors given ;)

cheers and thanks for helping improving this great prog

Nope, early morning ;) And VERRRY small font :lol:

Thanks a lot! I shall temporarily remove the script to test it further...

kraze1984
13-08-2004, 06:37 PM
I'm also making a port of Netgraph, but it is harder. i have to find patterns for following functions:

disp_msg
seccode_routine
setfaid_routine
n_malloc
read_eeprom
write_eeprom
calc_eeprom_chk

And create code sections of following functions:
-own_get_ram
-own_set_ram
-own_mul
-own_graph_yrel
-own_graph_credits (or even to change this :) )
-own_draw_coord
-own_draw_hor_line
-own_bar_show_strength
-own_enable_values_task1
-own_enable_values_task2
-own_show_values_task
-own_bar_store_strength
-own_idle_keycheck
-own_hook_temp
-own_nop
-own_set_strength
-own_hook_temp

Others can be located with NokiX 'locate' command.

If you know something, please post :)

mestrini
14-08-2004, 03:07 AM
I don't understand what you mean about finding those patterns because they are nearly all present in locate.rx

read_eeprom is same as eeprom_read_bytes ?
write_eeprom is same as eeprom_write_bytes?
and others

please check with me

cheers

nEMO
14-08-2004, 09:48 AM
here you have Virus (nokia & siemens) script :]
But "i" is in polish, it's not my script...

yak
14-08-2004, 02:21 PM
as mestrini said, you can locate some functions using locate.rx script like this:

write_eeprom=locate("write_eeprom")

or

call locate "write_eeprom"; write_eeprom=result

properly converting to NokiX would requiere more work and attention. for example NokiX uses own get/set_ram functions with dynamic ids creation (check the create_ram_id.rx script). if i remember it correctly the seccode_routine and the other one are searched to obtain malloc (and some other functions) pointer. most of it is already done in locate.rx so you probably won't have to search for seccode_routine.

n_malloc is named malloc in locate.rx
disp_msg is named display_msg (or display_message, don't remember now) in locate.rx

ok, have to go now, happy programming!

ShadoW2004
14-08-2004, 04:00 PM
here you have Virus (nokia & siemens) script :]
But "i" is in polish, it's not my script...

Great script! All works in my 3310!!!

Thank you!

kraze1984
14-08-2004, 04:39 PM
here you have Virus (nokia & siemens) script :]
But "i" is in polish, it's not my script...

Hmmm... Someone overcame me :) Maybe someone has also written the Netgraph script?

If it is working - ok, because mine doesn't. Everytime i call my 5E0's - the fone restarts with Pin.

Ok, then i 'll concentrate on Netgraph.

kraze1984
14-08-2004, 06:02 PM
@yak
U are right, i have to pay more attention to routine names. I didn't know U changed them in NokiX:



g3n0lite:disp_msg nokiX: display_msg
g3n0lite:n_malloc nokiX: malloc
g3n0lite:read_eeprom nokiX: eeprom_read
g3n0lite:write_eeprom nokiX: eeprom_write


this one not found yet:
calc_eeprom_chk

Maybe we don't need it?

NokDoc
14-08-2004, 08:25 PM
this one not found yet:
calc_eeprom_chk

Maybe we don't need it?

Hehe,

When U write to eeprom, U always need to recalc the eeprom check of the area affected.

Do note there are two different calc_eeprom functions, one for each area.

NokDoc

kraze1984
15-08-2004, 06:58 PM
Hehe,

When U write to eeprom, U always need to recalc the eeprom check of the area affected.

Do note there are two different calc_eeprom functions, one for each area.

NokDoc

But in the table of used nibbles and RAM on gsmfreeboard, there no locations in EEPROM reserved for Netgraph. Only RAM:


0x00 - ADDR_NETGRAPH NetGraph RAM addr
0x07 - ADDR_GRAPHCALC calc algo for y-pos of netgraph

NokDoc
15-08-2004, 07:54 PM
Hi,

Then probably it does not use the write eeprom function too.

Sorry for the confusion.

NokDoc

kraze1984
15-08-2004, 09:02 PM
Hi,

Then probably it does not use the write eeprom function too.

Sorry for the confusion.

NokDoc

Its nothing.

So, as Netgraph uses some RAM to store its values, i'll have to know whether this RAM address is clear in NokiX. I think its a question to yak? Otherwise i'll have to change those addresses...

ShadoW2004
15-08-2004, 09:21 PM
2 kraze1984

Check your mail!

kraze1984
18-08-2004, 05:51 PM
Ok, i've ported all the Nretgraph script to NokiX, even those hooks to task_0 (used native NokiX function) and to calc_net_strength. It took me 8 hours :) The files patched with g3n0lite and NokiX after patching seem to be identical in hooks and in the functions i added when compared with Hexedit and WinArm, except own_get_ram\own_set_ram functions of course.

To get it working with new ram functions i tried to change the MOV commands just before every call of own_get_ram\own_set_ram functions to the values i got after applying the create_ram_id.rx (i.e.: was MOV r0, #0 - one, MOV r0, #7 - other, became: MOV r0, #0, MOV r0,#1, as the ram ids in NokiX are applied dynamically during patching). But it doesn't work. The fone hangs on startup when i flash the new patched file. What have i done wrong? I can send the asm and the nrx files to the person who can understand this to correct me....

And i also got those 2 addresses that i don't know from where they are in the program:
0a0f1a00
0010FEC0


[EDIT] 20.08: Still stuck. but i must do it *kNOKing his head on the keyboard* hyhyujxsrth6uy

kraze1984
04-09-2004, 07:31 PM
I've posted the beta version of Netgraph script here:
http://nokiafree.org/forums/t67346/h/s.html

There still remain some problems:
It seems that NokiX incorrectly hooks to task_0 the function that checks the keypresses, or there's something wrong in RAM use of this function.
If the function and hook are uncommented, then the fone just shows the copyright notice everytime a key pressed or reboots everytime any key is pressed...

The own_idle_keycheck function:



push {r0, r1, r2, r3, r4, r5, r6, r7, LR}
mov r0, ADDR_NETGRAPH
bl @own_get_ram
mov r2, r0
cmp r2, #0
beq @2
ldrb r0, [r2, #2]
cmp r0, #0
beq @2
mov r0, #ff
strb r0, [r2, #2]
bl @own_get_keypress
cmp r0, #0
beq @2
mov r0, #ff
strb r0, [r2, #2]
bl @own_get_keypress @1
cmp r0, #1
beq @1
bl @clear_lcd_ram
mov r0, #21
ldr r1, @own_graph_credits
bl @display_msg
pop {r0, r1, r2, r3, r4, r5, r6, r7, LR} @2
-------------------------------------------
46c0 NOP


The task_0 hook in g3n0lite:


Push {LR}
bl @own_idle_keycheck
bl c1dd2
POP {PC}


The task_0 hook using hook_into_task_0.nrx (NokiX):


Push {LR}
bl c1dd2
bl @own_idle_keycheck
POP {PC}


The hooks are slightly different. Why?