diff --git a/kernel/ps4_map_mm.pas b/kernel/ps4_map_mm.pas index 2588c07f..8d247688 100644 --- a/kernel/ps4_map_mm.pas +++ b/kernel/ps4_map_mm.pas @@ -806,7 +806,7 @@ begin if (Result=0) then begin - Result:=DirectManager.mmap_addr(offset,len,addr); + Result:=DirectManager.mmap_addr(offset,len,res); end; end; @@ -863,7 +863,7 @@ begin if (Result=0) then begin - Result:=DirectManager.mmap_addr(physicalAddr,length,addr,mtype); + Result:=DirectManager.mmap_addr(physicalAddr,length,res,mtype); end; end; @@ -1633,7 +1633,10 @@ end; Procedure _mem_print; begin VirtualManager.Print; + Writeln('---'); NamedManager.Print; + Writeln('---'); + DirectManager.Print; end; initialization diff --git a/ps4_elf.pas b/ps4_elf.pas index de5f1d1b..0d06be45 100644 --- a/ps4_elf.pas +++ b/ps4_elf.pas @@ -1070,7 +1070,7 @@ begin _md.Import:=False; Writeln('DT_SCE_MODULE_INFO:',_md.strName,':',HexStr(mu.id,4)); //current module name _set_mod(mu.id,_md); - StrPLCopy(@ModuleInfo.name,_md.strName,SCE_DBG_MAX_NAME_LENGTH); + ModuleInfo.name:=_md.strName+'.prx'; end; DT_SCE_NEEDED_MODULE: begin @@ -1179,7 +1179,11 @@ procedure _add_seg(MI:pSceKernelModuleInfo;adr:Pointer;size:DWORD;prot:Integer); var i:DWORD; begin - if (MI^.segmentCount>=SCE_DBG_MAX_SEGMENTS) then Exit; + if (MI^.segmentCount>=SCE_DBG_MAX_SEGMENTS) then + begin + Assert(False,'segmentCount'); + Exit; + end; i:=MI^.segmentCount; MI^.segmentInfo[i].address:=adr; MI^.segmentInfo[i].size:=size; @@ -1608,7 +1612,7 @@ begin STT_FILE :; STT_COMMON :; STT_SCE :; - STT_TLS :Writeln(__sType(Info.sType)); + STT_TLS :; else Writeln(__sType(Info.sType)); end; @@ -1646,7 +1650,7 @@ begin STT_FILE :; STT_COMMON :; STT_SCE :; - STT_TLS :Writeln(__sType(Info.sType)); + STT_TLS :; else Writeln(__sType(Info.sType)); end; @@ -1689,10 +1693,10 @@ begin STT_NOTYPE :; STT_OBJECT :; STT_FUN :; - //STT_SECTION:; - //STT_FILE :; - STT_COMMON :; - STT_TLS :; + STT_SECTION:Writeln(__sType(Info.sType)); + STT_FILE :Writeln(__sType(Info.sType)); + STT_COMMON :Writeln(__sType(Info.sType)); + STT_TLS :Writeln(__sType(Info.sType)); STT_SCE :; else Writeln(__sType(Info.sType)); @@ -1844,7 +1848,8 @@ Procedure OnLoadRelaExport(elf:Telf_file;Info:PRelaInfo;data:Pointer); _do_set(nSymVal); - val:=elf.mMap.pAddr+Info^.value; + val:=nSymVal; + //val:=elf.mMap.pAddr+Info^.value; IInfo.lib^.set_proc(IInfo.nid,val); @@ -1853,12 +1858,12 @@ Procedure OnLoadRelaExport(elf:Telf_file;Info:PRelaInfo;data:Pointer); begin case Info^.rType of - R_X86_64_NONE :Writeln('R_X86_64_NONE '); - R_X86_64_PC32 :Writeln('R_X86_64_PC32 '); - R_X86_64_COPY :Writeln('R_X86_64_COPY '); - - R_X86_64_TPOFF32 :Writeln('R_X86_64_TPOFF32 '); - R_X86_64_DTPOFF32:Writeln('R_X86_64_DTPOFF32'); + //R_X86_64_NONE :Writeln('R_X86_64_NONE '); + //R_X86_64_PC32 :Writeln('R_X86_64_PC32 '); + //R_X86_64_COPY :Writeln('R_X86_64_COPY '); + // + //R_X86_64_TPOFF32 :Writeln('R_X86_64_TPOFF32 '); + //R_X86_64_DTPOFF32:Writeln('R_X86_64_DTPOFF32'); R_X86_64_RELATIVE: begin @@ -2093,12 +2098,12 @@ const begin case Info^.rType of - R_X86_64_NONE :FWriteln('R_X86_64_NONE'); - R_X86_64_PC32 :FWriteln('R_X86_64_PC32'); - R_X86_64_COPY :FWriteln('R_X86_64_COPY'); - - R_X86_64_TPOFF32 :FWriteln('R_X86_64_TPOFF32'); - R_X86_64_DTPOFF32:FWriteln('R_X86_64_DTPOFF32'); + //R_X86_64_NONE :FWriteln('R_X86_64_NONE'); + //R_X86_64_PC32 :FWriteln('R_X86_64_PC32'); + //R_X86_64_COPY :FWriteln('R_X86_64_COPY'); + // + //R_X86_64_TPOFF32 :FWriteln('R_X86_64_TPOFF32'); + //R_X86_64_DTPOFF32:FWriteln('R_X86_64_DTPOFF32'); R_X86_64_RELATIVE: begin diff --git a/src/ps4_libscenpwebapi.pas b/src/ps4_libscenpwebapi.pas index ddad3fa5..51df2c3c 100644 --- a/src/ps4_libscenpwebapi.pas +++ b/src/ps4_libscenpwebapi.pas @@ -95,11 +95,11 @@ end; type pSceNpWebApiResponseInformationOption=^SceNpWebApiResponseInformationOption; SceNpWebApiResponseInformationOption=packed record - httpStatus:Integer; + httpStatus:Integer; //out _align:Integer; - pErrorObject:Pchar; - errorObjectSize:size_t; - responseDataSize:size_t; + pErrorObject:Pchar; //in + errorObjectSize:size_t; //in + responseDataSize:size_t; //out end; function ps4_sceNpWebApiSendRequest2(requestId:Int64; @@ -111,6 +111,7 @@ begin if (pRespInfoOption<>nil) then begin pRespInfoOption^.httpStatus:=404; + pRespInfoOption^.responseDataSize:=0; end; Result:=0; end; diff --git a/sys/sys_types.pas b/sys/sys_types.pas index bc447231..94f816cd 100644 --- a/sys/sys_types.pas +++ b/sys/sys_types.pas @@ -330,7 +330,7 @@ type pSceKernelModuleInfo=^SceKernelModuleInfo; SceKernelModuleInfo=packed record size:QWORD; //Size of this structure - name:array[0..SCE_DBG_MAX_NAME_LENGTH-1] of AnsiChar; //module name + name:array[0..SCE_DBG_MAX_NAME_LENGTH-1] of AnsiChar; //name.prx segmentInfo:array[0..SCE_DBG_MAX_SEGMENTS-1] of SceKernelModuleSegmentInfo; segmentCount:DWORD; fingerprint:array[0..SCE_DBG_NUM_FINGERPRINT-1] of Byte; @@ -339,7 +339,7 @@ type pSceKernelModuleInfoEx=^SceKernelModuleInfoEx; SceKernelModuleInfoEx=packed record st_size:QWORD; //424 - name:array[0..SCE_DBG_MAX_NAME_LENGTH-1] of AnsiChar; + name:array[0..SCE_DBG_MAX_NAME_LENGTH-1] of AnsiChar; //name.prx id :Integer; tls_index :DWORD; tls_init_addr :Pointer; @@ -363,7 +363,7 @@ type pSceModuleInfoForUnwind=^SceModuleInfoForUnwind; SceModuleInfoForUnwind=packed record st_size:qword; //304 - name:array[0..SCE_DBG_MAX_NAME_LENGTH-1] of AnsiChar; + name:array[0..SCE_DBG_MAX_NAME_LENGTH-1] of AnsiChar; //name.prx eh_frame_hdr_addr:Pointer; eh_frame_addr:Pointer; eh_frame_size:qword;