MaxTyutyunnikov / grub4dos-chenall

Automatically exported from code.google.com/p/grub4dos-chenall
0 stars 0 forks source link

write (md)0xaddress value does not work if address starts with 0 byte #141

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
See 
http://reboot.pro/topic/18584-changing-screen-resolution-with-hotkeys/#entry1730
02

read 0x44000
write 0x44000 0x76767676
#write 0x44000 0x00
read 0x44000
write (md)0x220+1 \x53\x53\x53\x53
read 0x44000

Works, but if you uncomment the 3rd line the write (md)0x220+1 does not work.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
0.4.5c latest

Please provide any additional information below.

Original issue reported on code.google.com by Steve6375 on 1 Jun 2013 at 10:53

GoogleCodeExporter commented 9 years ago
This issue seems to be dependant on whatever the memory contents happen to be!

For instance:
write 0x44000 0x00
write 0x44004 \x20
read 0x44000
read 0x44004
cat --hex --length=32 (md)0x220+1
write (md)0x220+1 \x82

The last two commands do not execute and do not return any error message!

Original comment by Steve6375 on 1 Jun 2013 at 3:08

GoogleCodeExporter commented 9 years ago
Seems that the above can sometimes work depending on memory contents after 5th 
byte!

This seems repeatable:

echo fffffffffffffffffffffffff > (md)0x220+1
write 0x44000 0x00
write 0x44004 0x6c617620
cat --hex --length=32 (md)0x220+1
write (md)0x220+1 \x82

neither the cat or the write (md)0220+1  work!

Original comment by Steve6375 on 1 Jun 2013 at 3:23

GoogleCodeExporter commented 9 years ago
tinybit has joined the discussion. I think that a write to a non-file should 
automatically turn off the compression bit at 82a4 during the operation.

Also, cat --hex  should automatically list the uncompressed contents if it 
fails to decompress the contents.

Original comment by Steve6375 on 1 Jun 2013 at 4:11

GoogleCodeExporter commented 9 years ago
so dd, cat --hex and write all are unreliable if writing to (md) or (rd) 
because of the added 'check for compressed header'.
Overall, I think it would be better to remove or disable this call for 'check 
for compressed file header' so that dd, cat and write will work as expected 
when writing to (rd) or (md). That way code will be reliable and predictable!
If a coder has written code to load a compressed file into memory and then 
tries to modify the code directly using (md) or (rd), then he will soon 
discover that it does not work during development and he will figure out why!

Original comment by Steve6375 on 2 Jun 2013 at 9:03

GoogleCodeExporter commented 9 years ago
See  
http://reboot.pro/topic/20000-boot-windows-iso-without-bootfixbin-press-any-key-
prompt/page-3#entry186783

for suggested fix

Original comment by Steve6375 on 29 Aug 2014 at 10:30

GoogleCodeExporter commented 9 years ago
This is fixed now in latest version.

Original comment by Steve6375 on 7 Sep 2014 at 11:12

GoogleCodeExporter commented 9 years ago
Thanks.

Original comment by chenall.cn on 8 Sep 2014 at 2:12