Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7556211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:48:32+00:00 2026-05-30T11:48:32+00:00

I need your help :/ I have a register that points to one memory

  • 0

I need your help :/

I have a register that points to one memory address, like this:

MOV ESI,DWORD PTR SS:[00123456]

And, this address(00123456), contains a RANDOM string, like: “Hello, this is a string”.

I need to get the length/size of the string and compare, if the string length are most than 10, the string need to be cleaned.

Can anyone help me?

NOTE: I’m writing this asm code direct in executable using OllyDbg, so, procedures in MASM, TASM, NASM, etc, will not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:48:33+00:00Added an answer on May 30, 2026 at 11:48 am

    you can use REPNE SCAS, this is what intrinsic strlen uses. else you can use a simple function like this (assumes the input is in EAX):

    strlen:     /$LEA EDX,DWORD PTR DS:[EAX+1]
    loop:       |/>MOV CL,BYTE PTR DS:[EAX]
                ||INC EAX
                ||TEST CL,CL
                |\JNZ SHORT loop
                |SUB EAX,EDX
                \RETN
    

    But it would be wise to check if the binary you are modifying doesn’t already have a strlen function.

    When thats done, you can do the size checks and possible zero’ing, so you’d probably end with something looking like:

    PUSHAD ;save all registers
    MOV EAX,ESI ;setup the call for strlen (as defined above)
    CALL strlen ;get the length of the string, strlen would be the address of the func above
    MOV ECX,EAX 
    CMP ECX,0A ;check if the string needs to be cleared
    JL L1
    MOV EDI,ESI ;set the dest register to the string
    REP STOS BYTE PTR [EDI] ;clear the string, alternatively MOV BYTE PTR [ESI],0
    L1:
    POPAD ;restore all registers
     //continue
    

    (depending where you hook you may also need to preserve the EFLAGS as well)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need your help in access db i have a table like this ID
Need your help with my PHP/MYSQL array. I have a php script that selects
I need your help to understand this better. This is my case. I have
I need your help in this case: I have: 1 11 111 Cat1 a,b,c
I am a bit confused and need your help. I have a database that
I need your help - I have this CSS and HTML; I need the
I need your help with a RegEx in PHP I have something like: vacation.jpg
I need your help, For example I have a decimal type variable and I
I've some questions .. and I really need your help. I have an application.
I really need your help for this. I am relatively new to programming and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.