Author Topic: x86 Assembly help needed  (Read 7392 times)

0 Members and 1 Guest are viewing this topic.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
x86 Assembly help needed
« on: August 19, 2010, 03:59:39 pm »
I am trying to make a bootloader that deletes a file at startup. Any moderator or admin, feel free to delte this topic if I am breaking some rule by posting this because my intentions with the bootloader might not fit within the rules (< I don't think my school will like it, hint ^^) I take full responsibilty though. This is what I got so far:
Code: [Select]
model small
org 7c00h
.data
Name db 'C:\program files\netsupport manager\client32.ini'
.code
lea dx, Name
mov ax,0x7141
int 0x21
times 0x0200-2-($-$$) db 0
dw 0xAA55
Would this work, theaoretically I mean. I don't want to risk messing up my system because of this. Is their a way I could implent a safety measure? Note that I know very little about x86 asm and that this is just what I managed to come up with after some reading on bootloaders and deleting files in asm.
« Last Edit: August 19, 2010, 04:00:40 pm by matthias1992 »
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline qazz42

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1130
  • Rating: +30/-12
  • hiiiiiiiii
    • View Profile
Re: x86 Assembly help needed
« Reply #1 on: August 19, 2010, 04:03:04 pm »
What do want to delete, a block?

if so, then I dont now ;)

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: x86 Assembly help needed
« Reply #2 on: August 19, 2010, 04:11:52 pm »
No the file Client32.ini
Without that file a certain piece of monitoring software will fail to run, allowing me to visit the net freely instead of getting those annoying webblocks (which you can't surpass with proxies)
« Last Edit: August 19, 2010, 04:13:01 pm by matthias1992 »
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: x86 Assembly help needed
« Reply #3 on: August 19, 2010, 04:27:42 pm »
This looks more or less like Windows assembly than true x86 assembly.
Windows assembly is just accessing the Windows functions via assembly. Quite a few demoscenes and such use this for the nice speed.
x86 assembly, on the other hand, has direct access to hardware.

This to me doesn't look like working bootloader code.
True x86 assembly isn't that simple. You need to set up lots of stuff: IRQs, ACPI, HDD access, protected mode, etc.
And you need code to read NTFS, which this thing doesn't look like.

My suggestion: don't try to write a bootloader unless you really know what you are doing.
If you are writing a bootloader:
  - Borrow code from others! GRUB is a FOSS bootloader. It can chainload to other bootloaders, which is something you want to do.
    It might recognize NTFS as well, but I'm not sure.
    Heck, you could even just write a GRUB conf file that deletes the file for you, and then chainloads! ;) (Not sure if it's possible tho)
If you don't want to go insane from x86 assembly:
  - Use Linux/DOS to remove the file(s). DOS can possibly chainload, but not Linux. (You need to reboot into Windows) DOS is harder to
    implement, Linux is easier. FreeDOS is a good starting point if you use DOS. Barebones Ubuntu (or others) is a good place to start if
    you use Linux.
« Last Edit: August 19, 2010, 04:45:56 pm by alberthrocks »
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Empyreal

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 18
  • Rating: +5/-0
    • View Profile
Re: x86 Assembly help needed
« Reply #4 on: August 27, 2010, 05:20:18 pm »
As near as I can tell, this is DOS assembly.  INT 0x21 is a software interrupt.  You won't be able to use it if the operating system isn't loaded.  And there's no way Windows is going to allow a real mode application to delete a protected file.
Since your goal seems to be to just delete the file, I have to ask...  If you can install a bootloader on your school computers, then you are also most likely capable of loading different operating system as well.  Right?  It'd be a lot easier to delete the file from there.  That said, I find it a little odd that the school's computers would allow either course of action (the installation of a bootloader or booting into a different operating system).  Are you sure this is the case?

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: x86 Assembly help needed
« Reply #5 on: August 27, 2010, 11:17:00 pm »
I think the easiest way is to boot into Puppy Linux, delete the file, and reboot. Simple, and a lot more fun doing it. ;)
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)