Author Topic: [ASM] Edit Registry Problem  (Read 868 times)

0 Members and 1 Guest are viewing this topic.

Offline R4k0Z

  • /dev/null
  • *
  • Posts: 7
  • Cookies: 1
    • View Profile
[ASM] Edit Registry Problem
« on: April 28, 2015, 01:14:22 am »
Hi everyone,


Today's menu is: RegOpenKeyExA, we'll call it ROK for simplicity


So, i want to execute X file on startup. I'm actually trying to add it to the HKLM-Run register, and in the process ROK wont cooperate and keeps throwing Access Violation Errors


This is the part that matters:


Code: [Select]

kHandle dd 0
kDir db "SOFTWARE\Microsoft\Windows\CurrentVersion\Run",0


lea edx, [ebp+kHandle] ;ebp is the delta offset, here im getting the pointer to my keyhandler
push edx ;pass the handler
push 0x00000010 ;Ask for reading rights (so i dont get permissions errors)
xor edx, edx
push edx ;push NULL (reserved)
lea edx, [ebp+kDir]
push edx ;subkey string pointer
push 0x80000002 ;HKEY_LOCAL_MACHINE
call 0x75334887 ;Call ROK (i can get it dynamically, but i hardcoded the address to
;reduce error vectors)



Thanks in advance :)
« Last Edit: April 28, 2015, 01:17:41 am by R4k0Z »
Being an idiot isnt against the rules its just frowned upon.

Offline R4k0Z

  • /dev/null
  • *
  • Posts: 7
  • Cookies: 1
    • View Profile
Re: [ASM] Edit Registry Problem
« Reply #1 on: April 28, 2015, 04:32:31 am »
after an enormous amount of searching i solved it :)

i have win7 64 bits, which redirects 32bits register calls to another subkey, i think that was the mayor problem. Its solved with the KEY_WOW64_64KEY flag

plus i found a bug wich led to a call to nul

<3 OllyDbg <3
« Last Edit: April 28, 2015, 04:33:51 am by R4k0Z »
Being an idiot isnt against the rules its just frowned upon.