CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Jan 2007
    Posts
    152

    Extract From .exe

    Hey guys,
    I well with the last problem i got fixed.
    BUT
    now all my graphics are inside my .exe file.
    I like that, now no one can edit my graphics, but yet i cant even use them =/
    i beilve i need to use the get command

    Code:
    Open sFile For Binary Access Read As #ifreefile
    Get #ifreefile, , sBuf

    but how do i use this?
    im new to all this lol, and cant find it on internet i dont knw what i need to search for.

    Thanks for all the helps guys

  2. #2
    Join Date
    Jan 2007
    Posts
    152

    Re: Extract From .exe

    Hey im gonna wirte down all my code sorry i dident put in last post but here it is

    This is on server side to say that they are patching and what files
    Code:
        Case "CHR(PATCH)"
            SendPatch "Patch\game.exe", "game.exe", pintWinsockNo
            SendPatch "Patch\toolbar6.jpg", "\Graphics\toolbar6.jpg", pintWinsockNo
            SendPatch "Patch\desktop.jpg", "\Graphics\desktop.jpg", pintWinsockNo
            SendPatch "Patch\dropdown1.jpg", "\Graphics\dropdown.jpg", pintWinsockNo
            SendPatch "Patch\lloginscreen.jpg", "\Graphics\lloginscreen.jpg", pintWinsockNo
            SendPatch "Patch\messenger.jpg", "\Graphics\messenger.jpg", pintWinsockNo

    Code:
    Public Sub SendPatch(sFile As String, sSaveAs As String, intwinsock As Integer)
    On Error GoTo ErrHandler
        Dim sSend As String, sBuf As String
        Dim ifreefile As Integer
        Dim lRead As Long, lLen As Long, lThisRead As Long, lLastRead As Long
        
        ifreefile = FreeFile
        
        ' Open file for binary access:
        Open sFile For Binary Access Read As #ifreefile
        lLen = LOF(ifreefile)
        
        ' Loop through the file, loading it up in chunks of 64k:
        Do While lRead < lLen
            lThisRead = 65536
            If lThisRead + lRead > lLen Then
                lThisRead = lLen - lRead
            End If
            If Not lThisRead = lLastRead Then
                sBuf = Space$(lThisRead)
            End If
            Get #ifreefile, , sBuf
            lRead = lRead + lThisRead
            sSend = sSend & sBuf
        Loop
        lTotal = lLen
        Close ifreefile
        bSendingFile = True
        '// Send the file notification
        frmServer.wskServer(intwinsock).SendData "FILE" & sSaveAs
        DoEvents
        '// Send the file
        frmServer.wskServer(intwinsock).SendData sSend
        DoEvents
        '// Finished
        frmServer.wskServer(intwinsock).SendData "FILEEND"
        bSendingFile = False
        Exit Sub
    ErrHandler:
        MsgBox "Err " & Err & " : " & Error

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Extract From .exe

    What are you trying to do? You are creating new files.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Jan 2007
    Posts
    152

    Re: Extract From .exe

    well at first i was trying to extract the files to the users computer. in a folder called Graphics,
    but then it made my .exe file bigger and i found out all the pictures i tryed to send over is now in my .exe file, now i need to extract them and put it i guess as a temp file. so when i close the client all the files get deleted.


    so basicly

    Open client, then it extracts the pictures to \graphics then after client unloads to deletes all the graphics

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Extract From .exe

    What do you mean the jpg's are 'in the .exe' ???
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Apr 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    1,792

    Re: Extract From .exe

    Imagelist?
    Be nice to Harley riders...

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Extract From .exe

    You don't replace them like that. You could use a Resource File, but you'd have to replace the exe, which you're doing
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Extract From .exe

    It looks a little as if you send secretely an executable to the other computer which is connected to your game...
    What is this going to be?

  9. #9
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Extract From .exe

    If your images are CURRENTLY stored in the exe like you said in your first post, then you already know how to extract them as you said. The code that you posted to replace an exe has little to do with the question or problem.

    Hope you aren't playing with us here.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  10. #10
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Extract From .exe

    That's what I was starting to wonder...

  11. #11
    Join Date
    Jan 2007
    Posts
    152

    Re: Extract From .exe

    Im not playing with you guys,
    i am being honest i really dont knw how to extract them out,
    i have tryed using other code to extract it but its not working,

    Like at first when i set the .exe threw winsock.
    it was 1.25 mb big
    then i sent 5 pictures that were suppose to save to

    /graphics

    but it never did so i moved the .exe file to my patch folder were the patches come form and then the .exe file was
    3.25 mb big, not 1.25 mb big
    and when i tryed to extract the the pictures from the .exe nothing comes out, so i dont knw if its in the .exe as
    /graphics
    or
    game.exe/graphics

    i really have no clue i wouldent be wasting your guys time if i knew how to do this,

  12. #12
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Extract From .exe

    Do you have an ImageList that is in a Resource File that is compiled into your EXE so that Images don't have to be stored on disk separately?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  13. #13
    Join Date
    Jan 2007
    Posts
    152

    Re: Extract From .exe

    so i could just use the images off my .exe? insted of extracting them off??

  14. #14
    Join Date
    Jan 2007
    Posts
    152

    Re: Extract From .exe

    ohhh kk sorry no i dont have a image list,
    in my game i just added one and saw what it did.
    but the problem is that it use to all be seperated untill i send the .exe with the graphics at the same time, it has everything todo with the code thats the problem, they have methods of extracting stuff out of .exe file

    same way as world of warcraft is
    inside the wow.exe
    it has all the images and data so ppl cant edit them, so when they do patches it just edits the .exe file nothing else

  15. #15
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Extract From .exe

    Now read this part again...
    Do you have an ImageList that is in a Resource File that is compiled into your EXE so that Images don't have to be stored on disk separately?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured