Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[asm] problem with opening a file

Featured Replies

Posted

i want to open a .exe file using ZwOpenFile. No i dont want to use OpenFile or other winapi's, just ZwOpenFile.


 


I created a simple project based upon the link down, but when i try to open calc.exe nt-status error = C0000008 == STATUS_INVALID_HANDLE.


my code is almost the same as



http://www.asmcommunity.net/forums/topic/?id=15345

Edited by Yoshi

Your variable names are really really confusing!


mov oa.ObjectName,offset ntpath 

This doesn't look right. I believe it should be "offset dospath".


 


See also http://eretik.omegahg.com/art/04.html (Google Translate, if you don't read Russian). ;)

  • Author

thank you for the reply.


 


not only my variable names are confusing, also the RtlDosPathNameToNtPathName_U structure. The link you gave, the link beneath this line, and some other links are defining the structure of this api all different.



http://assarbad.net/stuff/!export/apis_revealed.txt

Edited by Yoshi

  • Author

the initialization of the OBJECT_ATTRIBUTES strc is done right after the ntpath


Edited by Yoshi

After these 2 small fixes, it seems to work for me:



xor eax, eax ; provide null ptr, not dospath here!
mov oa.RootDirectory,eax  
mov oa.ObjectName,offset dospath  ; already mentioned in my post #2

Edited by kao

  • Author

You are da hero kao!  :thanks:


 


So the file can be openend without any problem. However, this was just an demo project. Now i should open the file itself, thus base.exe. but a acces_denied error pops up


Edited by Yoshi

Catch working project. password is the same.


 


Attachment was removed at topic author's request.


Edited by huntingspace

  • Author

huntingspace, you are incredible! it seems to work, so     :worthy:   thank you, i knew you could fix it :)


 


also kao very greatfull for your help :thumbs:


 


you guys are amazing


which pass

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.