mujarino / CS2_DMA_Radar

Python DMA/external Radar
132 stars 14 forks source link

help #24

Closed ConnorMAD closed 7 months ago

ConnorMAD commented 8 months ago

Can you leave the radar fixed? no stretching when the screen enlarges

therewillwhile commented 8 months ago

I'm not quite sure I understood you correctly. my English is bad. so can you rephrase your request

matheusbranhan commented 8 months ago

I'm not quite sure I understood you correctly. my English is bad. so can you rephrase your request

My English is also bad, haha, can you add me on discord braia100? I would like to talk to you if possible. But I will rephrase my question again: When I turn the radar window to full screen, the radar stretches, leaving the screen flat and strange.I asked if there was a way to leave the radar fixed, without changing the size, even on full screen.

therewillwhile commented 8 months ago

it was made for stretch image on any size, so it can use on all types of screens

u can make models bigger in config

Suspectxyzz commented 8 months ago

I'm not quite sure I understood you correctly. my English is bad. so can you rephrase your request

I think that's what he's referring to image image

ConnorMAD commented 8 months ago

yes

ConnorMAD commented 8 months ago

image

i change a little

therewillwhile commented 8 months ago

image

i change a little

can you please share the way you reading guns/inventory? it looks very cool

ConnorMAD commented 8 months ago
def get_weapon_name(weapon_id):
    # Dicionário mapeando IDs de armas para seus nomes
    weapon_names = {
        59: "T knife",
        42: "CT knife",
        1: "deagle",
        2: "elite",
        3: "fiveseven",
        4: "glock",
        64: "revolver",
        32: "p2000",
        36: "p250",
        #61: "usp-s",
        262205: "usp-s",
        30: "tec9",
        63: "cz75a",
        17: "mac10",
        24: "ump45",
        26: "bizon",
        33: "mp7",
        34: "mp9",
        19: "p90",
        13: "galil",
        10: "famas",
        60: "m4a1_silencer",
        16: "m4a4",
        8: "aug",
        39: "sg556",
        7: "ak47",
        11: "g3sg1",
        38: "scar20",
        9: "awp",
        40: "ssg08",
        25: "xm1014",
        29: "sawedoff",
        27: "mag7",
        35: "nova",
        28: "negev",
        14: "m249",
        31: "zeus",
        43: "flashbang",
        44: "hegrenade",
        45: "smokegrenade",
        46: "molotov",
        47: "decoy",
        48: "incgrenade",
        49: "c4"
    }

    return weapon_names.get(weapon_id, "Unknown weapon")

def get_weapon(procd, ptr):
    try:
        b1 = read_inta_memory(procd, ptr + 0x1308)
        b2 = read_int_memory(procd, b1 + 0x1BA + 0x50 + 0x1098)
        weapon_id = get_weapon_name(b2)
    except:
        return None
    return weapon_id
therewillwhile commented 8 months ago

def get_weapon_name(weapon_id):

    # Dicionário mapeando IDs de armas para seus nomes

    weapon_names = {

        59: "T knife",

        42: "CT knife",

        1: "deagle",

        2: "elite",

        3: "fiveseven",

        4: "glock",

        64: "revolver",

        32: "p2000",

        36: "p250",

        #61: "usp-s",

        262205: "usp-s",

        30: "tec9",

        63: "cz75a",

        17: "mac10",

        24: "ump45",

        26: "bizon",

        33: "mp7",

        34: "mp9",

        19: "p90",

        13: "galil",

        10: "famas",

        60: "m4a1_silencer",

        16: "m4a4",

        8: "aug",

        39: "sg556",

        7: "ak47",

        11: "g3sg1",

        38: "scar20",

        9: "awp",

        40: "ssg08",

        25: "xm1014",

        29: "sawedoff",

        27: "mag7",

        35: "nova",

        28: "negev",

        14: "m249",

        31: "zeus",

        43: "flashbang",

        44: "hegrenade",

        45: "smokegrenade",

        46: "molotov",

        47: "decoy",

        48: "incgrenade",

        49: "c4"

    }

    return weapon_names.get(weapon_id, "Unknown weapon")

def get_weapon(procd, ptr):

    try:

        b1 = read_inta_memory(procd, ptr + 0x1308)

        b2 = read_int_memory(procd, b1 + 0x1BA + 0x50 + 0x1098)

        weapon_id = get_weapon_name(b2)

    except:

        return None

    return weapon_id

ptr is player pawn path here?

ConnorMAD commented 8 months ago

yeap

matheusbranhan commented 8 months ago

Procd is process

Suspectxyzz commented 8 months ago
def get_weapon_name(weapon_id):
    # Dicionário mapeando IDs de armas para seus nomes
    weapon_names = {
        59: "T knife",
        42: "CT knife",
        1: "deagle",
        2: "elite",
        3: "fiveseven",
        4: "glock",
        64: "revolver",
        32: "p2000",
        36: "p250",
        #61: "usp-s",
        262205: "usp-s",
        30: "tec9",
        63: "cz75a",
        17: "mac10",
        24: "ump45",
        26: "bizon",
        33: "mp7",
        34: "mp9",
        19: "p90",
        13: "galil",
        10: "famas",
        60: "m4a1_silencer",
        16: "m4a4",
        8: "aug",
        39: "sg556",
        7: "ak47",
        11: "g3sg1",
        38: "scar20",
        9: "awp",
        40: "ssg08",
        25: "xm1014",
        29: "sawedoff",
        27: "mag7",
        35: "nova",
        28: "negev",
        14: "m249",
        31: "zeus",
        43: "flashbang",
        44: "hegrenade",
        45: "smokegrenade",
        46: "molotov",
        47: "decoy",
        48: "incgrenade",
        49: "c4"
    }

    return weapon_names.get(weapon_id, "Unknown weapon")

def get_weapon(procd, ptr):
    try:
        b1 = read_inta_memory(procd, ptr + 0x1308)
        b2 = read_int_memory(procd, b1 + 0x1BA + 0x50 + 0x1098)
        weapon_id = get_weapon_name(b2)
    except:
        return None
    return weapon_id

it doesn't work for me can you give me all source? I don't get any error either https://img.meowless.club/mstsc_tf6nDrK04M.png

ConnorMAD commented 8 months ago
def get_weapon_name(weapon_id):
    # Dicionário mapeando IDs de armas para seus nomes
    weapon_names = {
        59: "T knife",
        42: "CT knife",
        1: "deagle",
        2: "elite",
        3: "fiveseven",
        4: "glock",
        64: "revolver",
        32: "p2000",
        36: "p250",
        #61: "usp-s",
        262205: "usp-s",
        30: "tec9",
        63: "cz75a",
        17: "mac10",
        24: "ump45",
        26: "bizon",
        33: "mp7",
        34: "mp9",
        19: "p90",
        13: "galil",
        10: "famas",
        60: "m4a1_silencer",
        16: "m4a4",
        8: "aug",
        39: "sg556",
        7: "ak47",
        11: "g3sg1",
        38: "scar20",
        9: "awp",
        40: "ssg08",
        25: "xm1014",
        29: "sawedoff",
        27: "mag7",
        35: "nova",
        28: "negev",
        14: "m249",
        31: "zeus",
        43: "flashbang",
        44: "hegrenade",
        45: "smokegrenade",
        46: "molotov",
        47: "decoy",
        48: "incgrenade",
        49: "c4"
    }

    return weapon_names.get(weapon_id, "Unknown weapon")

def get_weapon(procd, ptr):
    try:
        b1 = read_inta_memory(procd, ptr + 0x1308)
        b2 = read_int_memory(procd, b1 + 0x1BA + 0x50 + 0x1098)
        weapon_id = get_weapon_name(b2)
    except:
        return None
    return weapon_id

it doesn't work for me can you give me all source? I don't get any error either https://img.meowless.club/mstsc_tf6nDrK04M.png

Are you getting the name of the weapons?

therewillwhile commented 8 months ago

def get_weapon_name(weapon_id):

    # Dicionário mapeando IDs de armas para seus nomes

    weapon_names = {

        59: "T knife",

        42: "CT knife",

        1: "deagle",

        2: "elite",

        3: "fiveseven",

        4: "glock",

        64: "revolver",

        32: "p2000",

        36: "p250",

        #61: "usp-s",

        262205: "usp-s",

        30: "tec9",

        63: "cz75a",

        17: "mac10",

        24: "ump45",

        26: "bizon",

        33: "mp7",

        34: "mp9",

        19: "p90",

        13: "galil",

        10: "famas",

        60: "m4a1_silencer",

        16: "m4a4",

        8: "aug",

        39: "sg556",

        7: "ak47",

        11: "g3sg1",

        38: "scar20",

        9: "awp",

        40: "ssg08",

        25: "xm1014",

        29: "sawedoff",

        27: "mag7",

        35: "nova",

        28: "negev",

        14: "m249",

        31: "zeus",

        43: "flashbang",

        44: "hegrenade",

        45: "smokegrenade",

        46: "molotov",

        47: "decoy",

        48: "incgrenade",

        49: "c4"

    }

    return weapon_names.get(weapon_id, "Unknown weapon")

def get_weapon(procd, ptr):

    try:

        b1 = read_inta_memory(procd, ptr + 0x1308)

        b2 = read_int_memory(procd, b1 + 0x1BA + 0x50 + 0x1098)

        weapon_id = get_weapon_name(b2)

    except:

        return None

    return weapon_id

it doesn't work for me can you give me all source? I don't get any error either

https://img.meowless.club/mstsc_tf6nDrK04M.png

cuz it is in try except block. try my method of memory reading with his values or wait. i'll do it today

ConnorMAD commented 8 months ago
def read_inta_memory(process, address):
    return struct.unpack("<Q", process.memory.read(address, 8))[0]

and

 def read_int_memory(process, address):
    return struct.unpack("<I", process.memory.read(address, 4))[0]
Suspectxyzz commented 8 months ago

def read_inta_memory(process, address): return struct.unpack("<Q", process.memory.read(address, 8))[0]

and

 def read_int_memory(process, address):
    return struct.unpack("<I", process.memory.read(address, 4))[0]

same ...

image

therewillwhile commented 8 months ago

def read_inta_memory(process, address):

    return struct.unpack("<Q", process.memory.read(address, 8))[0]

and


 def read_int_memory(process, address):

    return struct.unpack("<I", process.memory.read(address, 4))[0]

memprocfs.FLAG_NOCACHE use this flag in memprocfs to increase speed of reading like >10 times

therewillwhile commented 8 months ago

def read_inta_memory(process, address): return struct.unpack("<Q", process.memory.read(address, 8))[0]

and


 def read_int_memory(process, address):

    return struct.unpack("<I", process.memory.read(address, 4))[0]

same ...

image

u need to change half of code to work with his way to reading.

or u can use analogy to my memory reading using his memory addresses

ConnorMAD commented 8 months ago

def read_inta_memory(process, address): return struct.unpack("<Q", process.memory.read(address, 8))[0]

and

def read_int_memory(process, address):

return struct.unpack("<I", process.memory.read(address, 4))[0]

same ... image

u need to change half of code to work with his way to reading.

or u can use analogy to my memory reading using his memory addresses

I changed a lot of things, but it's interesting to know that if you use memprocfs.FLAG_NOCACHE, memory reading will increase.

Could you tell me how to get the value of roundsxrounds and the time value of the current round?

therewillwhile commented 8 months ago

idk, if you will learn it, let me know too

therewillwhile commented 8 months ago

@ConnorMAD how do u read player name? is there simple way? cuz i made it with crazy irrational way. how do u read it?

ConnorMAD commented 8 months ago

b = read_string_memory(procd, ptr + Offsets.m_iszPlayerName)

def read_string_memory(process, address):
    data = b""
    try:
        while True:
            byte = process.memory.read(address, 1)
            if byte == b'\0':
                break
            data += byte
            address += 1
        decoded_data = data.decode('utf-8')
        return decoded_data
    except UnicodeDecodeError:
        return data

money:

money2 = read_inta_memory(cs2, controller_ptr + Offsets.m_pInGameMoneyServices)
money = read_int_memory(cs2, money2 + Offsets.m_iAccount)
matheusbranhan commented 7 months ago

Did you manage to find the problem when someone quits and stops reading? I thought I had solved it, but the problem persists when someone leave

therewillwhile commented 7 months ago

Did you manage to find the problem when someone quits and stops reading? I thought I had solved it, but the problem persists when someone leave

fixed in latest version

ConnorMAD commented 7 months ago

Can you tell me here what has changed to resolve it? no need to detail, If you do not want

therewillwhile commented 7 months ago

deleted pawnhandler. now it reads dynamically playerpawn = struct.unpack("<Q", cs2.memory.read(client_base + dwLocalPlayerPawn, 8, memprocfs.FLAG_NOCACHE))[0] playerTeam = struct.unpack("<I", cs2.memory.read(playerpawn + m_iTeamNum, 4, memprocfs.FLAG_NOCACHE))[0] EntityPawnListEntry = struct.unpack("<Q", cs2.memory.read(client_base + dwEntityList, 8, memprocfs.FLAG_NOCACHE))[0] for i in range(maxclients): try: EntityAddress = struct.unpack("<Q", cs2.memory.read(EntityList + (i + 1) * 0x78, 8, memprocfs.FLAG_NOCACHE))[0] Pawn = struct.unpack("<Q", cs2.memory.read(EntityAddress + m_hPlayerPawn, 8, memprocfs.FLAG_NOCACHE))[0] newEntityPawnListEntry = struct.unpack("<Q", cs2.memory.read(EntityPawnListEntry + 0x10 + 8 * ((Pawn & 0x7FFF) >> 9), 8, memprocfs.FLAG_NOCACHE))[0] entity_id = struct.unpack("<Q", cs2.memory.read(newEntityPawnListEntry + 0x78 * (Pawn & 0x1FF), 8, memprocfs.FLAG_NOCACHE))[0] Hp = struct.unpack("<I", cs2.memory.read(entity_id + m_iHealth, 4, memprocfs.FLAG_NOCACHE))[0]

ConnorMAD commented 7 months ago

oh, i see, you read now from maximum players

therewillwhile commented 7 months ago

cuz if u use 64 players u will have low read per frame and low frame time on radar

ConnorMAD commented 7 months ago

cuz if u use 64 players u will have low read per frame and low frame time on radar

I'm working now to get the weapons/grenades/c4 items across the entire radar.

therewillwhile commented 7 months ago

if u can somehow read number of players connected to server let me know pls. whis is important

therewillwhile commented 7 months ago

cuz if u use 64 players u will have low read per frame and low frame time on radar

I'm working now to get the weapons/grenades/c4 items across the entire radar.

it can work with another gui window, where will be name, guns(and color i think)

ConnorMAD commented 7 months ago

for i in range(maxclients

I didn't find this loop in the available code, it's still for i in range(0, 64)

ConnorMAD commented 7 months ago

Another thing, I would like to include de_train, how to download offsetfinder, what to put in the description?

therewillwhile commented 7 months ago

Another thing, I would like to include de_train, how to download offsetfinder, what to put in the description?

https://github.com/meanwhiletothestars/CS2_DMA_Radar/blob/main/testing/offset_manipulator.py