yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] 1230m:
EDIT: Sorry, after rereading some of the threads several times and reading some extras more, I think I understand. Seems that it is all good, not malicious (there was just a false scare, ya?).

Would anyone please explain this "malicious" thing? I downloaded Newflasherv3 from this thread (the front page page with instructions, etc.)?

I was preparing the files to flash, then I came back here to check I had things correct. Then, I saw a bunch of posts referring to potentially malicious programs in certain versions and to not use the latest and so on? I have been perusing through this thread, but I cannot seem to come across a full explanation (what program is it? what versions? am I safe to use Newflasher from this thread at all?).

I would appreciate it if someone could please post a quick sum up of the malicious issue? And am I safe using Newflasherv3 (xperifirm too?) from this thread's first page? Thanks!
[Sony Cross-Device General] munjeni:
Thats bulsh*t about malicious thing, you can look into my source code to believe -> http://github.com/munjeni/newflasher , always use latest version, and always from our thread! Latest version is v3. Don't believe what others says, put a trust on OP.
[Sony Cross-Device General] 1230m:
Youre good. I am sorry, my mistake, I was just perusing the older posts and saw some stuff about the possibility of malicious code and I got a little panicked and confused, so I wanted to ask, but should have just kept reading more.

I found the bits where someone was speculating you made a backdoor or something, but I read way more posts the second pass through the thread (lots of pages here, so I tried to skim around a little more than I probably should have at first) and it seemed like one of your versions just got falsely flagged when you uploaded it and there was a little bit of an emotional spat with some guy who was getting heated or something where you said some not true stuff just to get under his skin and then that confused people more? The posts also mentions you got temporarily suspended or something ... but given it looks like it was two months ago (per the post timestamps), you're back, and there are newer versions yet, it was all a big misunderstanding and there was never any backdoor or anything malicious.

Sorry for the long explanation, I just saw "malicious" earlier and it freaked me out a little so I wanted to ask. I also wanted to breakdown what I found and why it seems good (for anyone else wondering)... perhaps those posts about all the malicious stuff could be removed? I suppose it's nice not to touch posts and so on, but I think that bit of a conversation in this thread may just confuse people (like myself) and doesn't seem to serve too much benefit to the purpose of this thread, newflasher, etc.?
[Sony Cross-Device General] munjeni:
That old story is resolved and explained, accepted...whatever, important post is one from the first page, the first post, everything further is just development stuff
[Sony Cross-Device General] 1230m:
Okay, my flash is complete. Seemed to work. Thank you very much! I appreciate the help and your time on the flasher program.

Although I am not totally sure what to look for in the logs. Should I do anything with my logs? Thanks!
[Sony Cross-Device General] munjeni:
Just see if you can see some errors, if not all is ok!
[Sony Cross-Device General] dennis46419:
one question I want to debrand my xz1 Compact should I flash all files I downloaded with Xperiafirm or must I remove ta etc?

big thx
[Sony Cross-Device General] munjeni:
Flash all, recommended!
[Sony Cross-Device General] dennis46419:
thank you

works fine for me :)
[Sony Cross-Device General] the_brad:
I'm finally able to give some feedback!

I received an exchange unit from amazon.de (my last XZ Premium had some water under the camera lens after I cleaned it in the sink) and it had some strange customization flashed, which did not give me option for VoLTE and other stuff. Oh, and it had that stupid 4G indicator instead of LTE...

So, as I already had to reinstall everything from scratch, I flashed the latest available CUST DE firmware and this time, I left all the .ta-files inside and flashed them, too (the last time, I used newflasher, one or more of those files caused a factory reset, which I did not like).

So, everything went fine, V3 is even a looooot faster than V2! Great work [MENTION=4120742]munjeni[/MENTION]
[Sony Cross-Device General] pbarrette:
Hi munjeni,

I'm responding to you in this thread instead of over here because it seems like a more appropriate location.

You probably didn't get the TA dump log from newflasher users because it isn't very obvious how to do it, or that you're asking for it. I didn't even realize that you were asking for this because:

1] The request scrolls by before I can read it, and

2] There's no immediately obvious way to type Y when you finally notice it asking.

Your code appears to be using "scanf" to get a single character from stdin to determine whether to extract the GordonGate drivers, then using another "scanf" to get the next character to answer the experimental TA dump question. But since the input buffer wasn't cleared in between reads, the next character is probably going to be the CR from when the user pressed the [Enter] key at the GordonGate question.

I had to do "ECHO NY | newflasher.exe >Logfile.txt" to get the TA dump to work.

Attached is the experimental TA dump log.

I've sent you a PM with the password, since the TA dump includes details like serial number and IMEI.
[Sony Cross-Device General] munjeni:
New version is out, - version v4 (21.10.2017)

Updated trim area dumper, now it stores log to the trimarea.log but dump is now in .ta format and writen to the 01.ta and 02.ta
[Sony Cross-Device General] pbarrette:
Hi munjeni,

I only got 01.ta dumped due to the same error I got last time:

- Error read! Need nBytes: 0x106f but done: 0x106
nBytes[0x106]:

00000000 78 9C ED 96 BD 0A C2 30 14 85 4F 2C 05 B1 A2 A0 x......0..O,....
00000010 E0 E8 EE EC 2C F8 08 3A 38 EA 23 F8 10 0E E2 E8 ....,..:8.#.....
00000020 E4 EC EC 7B 08 4E 0E FE 41 7D 07 C1 51 41 8C B7 ...{.N..A}..QA..
00000030 0A EA CD 90 1A FF E8 70 3F 38 85 9B 34 37 E7 84 .......p?8..47..
00000040 52 02 64 30 87 D6 7A 0B 8D EC 79 48 CF 56 07 D1 R.d0..z...yH.V..
00000050 80 C6 9B EC 63 E6 17 80 52 58 5F F7 88 F0 8F 6D ....c...RX_....m
00000060 C0 A7 4D 0B A4 32 29 32 20 08 AF B2 E1 65 48 DF ..M..2)2 ....eH.
00000070 B0 7E C2 4B 41 B1 17 C6 79 A0 81 1E 1B EB 62 FC .~.KA...y.....b.
00000080 81 83 D5 F7 3E E6 6A 09 98 E1 A1 09 69 E4 6C 27 ....>.j.....i.l'
00000090 62 50 24 27 DF B0 33 54 37 F5 49 75 52 4E C5 AF bP$'..3T7.IuRN..
000000A0 7B 66 79 3F 9D F4 94 EC 84 A4 1D 49 91 95 80 54 {fy?.......I...T
000000B0 21 D5 48 CD 17 AD 99 7F A6 B3 B6 CF BB F6 4B B9 !.H...........K.
000000C0 2D FF 3B 92 9F D7 92 DF 3E EF DA 4F F2 27 1B C9 -.;.....>..O.'..
000000D0 CF 6B C9 6F 9F 77 ED 97 F4 FC 9E 51 9B B7 91 83 .k.o.w.....Q....
000000E0 91 E7 14 73 1E 81 51 9B F9 1D 6F 3B 3F 47 F2 73 ...s..Q...o;?G.s
000000F0 24 3F 47 F2 F3 5A F2 DB FB 49 7E 8E E4 B7 F7 4F $?G..Z...I~....O
00000100 12 17 0B FB B2 2A .....*

- Error reply! DATA reply size: 0x0 is not as expected: 0x106f !
Raw input[0x0]:

ERROR: TIMEOUT: failed with error code 997 as follows:
Overlapped I/O operation is in progress.
- Error write! Need nBytes: 0xf but done: 0x0
nBytes[0x0]:

Maybe you could log the error and pick back up at the block after the error?

Files attached. Password is the same as last time.

Also, I took a different route to enable the dump this time.

I answered "ny[Enter]" to the GordonGate question. It works, but not very obvious to others.
[Sony Cross-Device General] munjeni:
Thanks man a lot! V5 is out, hope trim area dumper is working now!
[Sony Cross-Device General] munjeni:
V5 reuploaded after fix y-n prompt, thanks [MENTION=4782500]pbarrette[/MENTION] !
[Sony Cross-Device General] pbarrette:
Hi munjeni,

Something went wrong at the first section.

I ran it twice. The first errored out reading 1:1 and the second errored while reading 1:0.

Log attached. Unencrypted, since there's no real data in it.

Though, it does now parse the user's Y/N input correctly.
[Sony Cross-Device General] munjeni:
Thanks man! I'm identified isue finaly! Problem for v3 and v4 was not aneought variable storage size, it was 4096 bytes lenght only so tool failed because didn't had enought that. V5 failed since I modified funcfion diferent way. V6 hope will work!
[Sony Cross-Device General] munjeni:
v6 is out! :fingers-crossed:
[Sony Cross-Device General] pbarrette:
Hi munjeni,

The output (and error on unit 0x70E3) are exactly the same as from this post.

Well, almost exactly the same. The new version puts a "\n" after every unit line. Probably because of this:

fprintf(dump, "%08X %04lX", j, get_reply_len);
for (k=0; k < get_reply_len; ++k)
fprintf(dump, " %02X", tmp_reply[k] & 0xff);
[COLOR="Red"]fprintf(dump, "\n\n");[/COLOR]

The issue with the pull seems to be related to the expected vs received bytes:

Error read! Need nBytes: 0x106f but done: 0x106

Of note, unit 0x70E3 does get pulled with Macs1209's TA dumper and is 0x106 (262) bytes in length.

So either it's reporting additional bytes that it's not providing, or it's mis-reporting bytes that don't exist.

It seems to be more than coincidental that you're expecting 0x106F bytes but only 0x106 exist.
[Sony Cross-Device General] munjeni:
If this one didn't fixed isue more verbose loging must be enabled inside transver_bulk_asinc! I don't own device so its hard for me fixing isue without device. It would be easy for me to fix isue in case I have device to test. Tommorow I will write new version with verbose loging so we will be able to identify isue
[Sony Cross-Device General] munjeni:
This is where it fail https://github.com/munjeni/newflasher/blob/master/newflasher.c#L963

On line 926 it receives sucesfully 0x106f bytes but from some unknown reason when I disabled waitdataokey result was this https://xdaforums.com/showpost.php?p=74253728&postcount=529 because next packet (OKAY) we skipt.
[Sony Cross-Device General] munjeni:
From the line 963 to the line 993 newflasher must be redesigned, its not much clear to me why I wrote it that way :)

Need to reanalise sniff log again, much paid atention was to sending packets since it was only important, now when we use newflasher for diferent needs I need to redesign aplication a bit. Waitdataokey variable is implemented for only one purpose, to get_root_key_hash and now for trim area dump, today when I analysed that part of code found it realy confused and funny.
[Sony Cross-Device General] iArvee:
I can't seem to flash Oreo on the XZP using this version. Is oreo supported yet?

Anyways, here is the log:

Product: G8142
Version: 0.4-SONY-0.1
Bootloader version: 1306-5035_X_Boot_MSM8998_LA1.1_N_59-G
Baseband version: 1306-8501_45.0.A.7.137
Serialno: CB512ENUCC
Secure: yes
Loader version: XFL-MSM8998-N-36
Phone ID: 0000:35700808319728,0000:35700808319729
Device ID: EC08A452
Platform ID: 2005E0E1
Max download size: 104857600
Sector size: 4096
Rooting status: ROOTABLE
Ufs info: TOSHIBA,THGAF4G9N4LBAIRB,0100
Emmc info: FAILEmmc-info not supported
Default security: ON
Keystore counter: 1
Security state: BA1894F07A55612C78DAADBA68D953CB4B3D2133
Sake root: D159
S1 root: S1_Root_e69c
Root key hash: C30DEC2471CEA311E6918657367B51068A39583BBF89FD68B379BCD5A709AB1B

Device is put now in flash mode.

Repartitioning...

Processing partition-image-LUN0_X-FLASH-ALL-42E5.sin
- setting up infflate...
- infflating, please wait...

- infflate returned: 0
- gzpipe: ok.
- gunziped ok.
- Extracting from partition-image-LUN0_X-FLASH-ALL-42E5.sin
- Extracting signature partition/partitionimage_0.cms
- Uploading signature partition/partitionimage_0.cms
signature:0000053e
OKAY.
- Extracting sparse chunk partition/partitionimage_0.000
- Uploading sparse chunk partition/partitionimage_0.000
download:00006000
OKAY.
Repartition:partitionimage_0
Error, didn't got Repartition OKAY reply! Got reply: FAILCommand not authenticated

EDIT: Tried newflasher v3 and v6, same error.
[Sony Cross-Device General] lancewicz:
The same error with me. I have G8142 but flashed with G8141 but getting the same error as you bellow.

best regards,

Piotr
[Sony Cross-Device General] RJASSI21:
Im also getting this error with G8141. What could be the issue?
[Sony Cross-Device General] munjeni:
Can you send me partition zip? Nougat flashing ok?
[Sony Cross-Device General] iArvee:
I flashed the last version (45.0.A.7.137) Nougat using Newflasher v3 and it worked fine.

Attached is the partition.zip as requested.
[Sony Cross-Device General] munjeni:
Ok guys, identified isue! Sony changed partition image name from partition/0.cms to partition/partitionimage_0.cms and from partition/0.000 to partition/partitionimage_0.cms
[Sony Cross-Device General] iArvee:
Great news! I'm hoping it will be an easy fix. :fingers-crossed:
[Sony Cross-Device General] munjeni:
V7 is out! Updated trim area dumper, newflasher redesigned a bit, fix new partitioning for Oreo. Need full log to check if all is ok if possible!
[Sony Cross-Device General] iArvee:
Testing it now. :)

EDIT:

Unfortunately, another error occurred. [MENTION=4120742]munjeni[/MENTION]

- Error reply! Device didn't replied with OKAY or DATA or FAIL
Replied with [0x20]:

00000000 C3 0D EC 24 71 CE A3 11 E6 91 86 57 36 7B 51 06 ...$q......W6{Q.
00000010 8A 39 58 3B BF 89 FD 68 B3 79 BC D5 A7 09 AB 1B .9X;...h.y......

When attempting to dump trim area:

Error retrieving unit data on partition: 1, unit: 0x0 !
[Sony Cross-Device General] GFTB:
Same prob from iArvee
[Sony Cross-Device General] munjeni:
Thanks but I can't identify isue that way, need full log, and for trim area dump need booth tadump.log and log from newflasher :)
[Sony Cross-Device General] GFTB:
[IMG="error"]https://xdaforums.com/attachment.php?attachmentid=4311954&stc=1&d=1508784981[/IMG]

Check check check :rolleyes:
[Sony Cross-Device General] munjeni:
Ok, I'm believing the same error happen in trim area dumper?
[Sony Cross-Device General] iArvee:
Log from newflasher and tadump.log attached.
[Sony Cross-Device General] GFTB:
So I'm trying to flash first XZP Oreo firmware with your newflasher_v3 again, this time without partition "folder", and it is running, hopefully it will complete without any error. :fingers-crossed:

Feeewww, so it took a minute or so to flash all, first boot came with decryption issue even if i got my PIN right -> Reset all -> Factory reset. I'm fine!!! Hooray!
[Sony Cross-Device General] munjeni:
V7 is fixed and reuploaded! :fingers-crossed:
[Sony Cross-Device General] munjeni:
Read our thread some pages back to understand what will hapen with your device in case sony change partition layout and you didn't flash all recommended files! ;)
[Sony Cross-Device General] GFTB:
am I too hurry you say? :crying:
[Sony Cross-Device General] munjeni:
Many thanks! So redesign is succed, tommorow I will better check trim area dumper, hope v8 get fully working :)
[Sony Cross-Device General] iArvee:
Looking forward to v8. I'll be available to test it once it's released. Thanks again!
[Sony Cross-Device General] vpkb:
I'm flashing the Malayia Oreo firmware right now - is there anything different from CE1?

---------- Post added at 01:48 PM ---------- Previous post was at 12:51 PM ----------

NVM, flashing failed. Will wait for OTA.
[Sony Cross-Device General] munjeni:
Can you write some words about what is failed?
[Sony Cross-Device General] lancewicz:
I flashed XZP(G8142) with G8141_Commercial and Journalists_1309-9931_47.1.A.3.254_R1B.

Everything sims working besides LTE. I have GSM/EDGE/HDSPA+ but no LTE at all.

What could be a issue?
[Sony Cross-Device General] ch3mn3y:
I believe that C&J firmware is not meant to be used by everyone and missing LTE could be one of the things that confirm it. It's internal/marketing firmware, not official one (branded or unbranded).
[Sony Cross-Device General] dyepnoodle:
How can i use this on xzp without using xperifirm? I have an ftf for 254 oreo, can someone guide me on how to use the new flasher
[Sony Cross-Device General] lancewicz:
Regarding LTE after reboot it start to work even with LTE+ with 160mbit+ speed. so it's look fine.
[Sony Cross-Device General] vpkb:
Sorry, did not take a log.
[Sony Cross-Device General] vpkb:
OK, after a few failed flashes, I was able to reflash CE1 (scary). Then, I tried flashing the Malaysia OREO again and it failed when opting to write the dump. I opted not to write the dump and it flashed successfully on the second attempt.

Here's the error message from the first attempt.

View attachment 4312205

Here's all the files I flashed, I omitted all the TA files.
[Sony Cross-Device General] ch3mn3y:
[MENTION=3273492]dyepnoodle[/MENTION]

Unpack it, than check if all files are .xmls, .sins or .tas (not .sinb or .tab). Unpack partition.zip and than it may be flashed using this tool.

However what for this ftf was made? Flashtool doesn't support XZp/XZ1, so it's generic one, meaning "nonworking"...
[Sony Cross-Device General] munjeni:
In case he want use ftf, after extracting ftg he must rename all .sinb files to .sin and the same for .tas to .ta, nut in my cas better idea is downloading right firmware with xperifirm
[Sony Cross-Device General] munjeni:
V8 is out, hope trim area dumper ok now! And also hope somebody give me trim area dump log
[Sony Cross-Device General] Lazaros_K:
Hello! I'm a complete noob, but I am considering flashing my XZP G8141 from Customized IT to Customized GR. With flashing , does it cause any problems? Like the camera not working ? Also , if need to send my phone for a repair, can i just flash back the orignal firmware and everything would be fine ?

And if I manage to flash the phone can i use the Xperia Companion to perform a software update or a software repair?

Any tip to avoid bricking my phone?
[Sony Cross-Device General] munjeni:
Just flash all files per instruction and everything will work, use v8 version for it! When you want to get back to old firmware just reflash it and you're done. :) And ofcourse you no need to unock bootloader and you can use sony pc companion.
[Sony Cross-Device General] munjeni:
Guys can I get trim area log? Or at least somebody confirm that it is working now.
[Sony Cross-Device General] ishemes:
I don't need to flash my phone, so I don't want to flash my phone just to get you the trim area log. But if you make me a tool to only do the trim area log I'll run it for you.
[Sony Cross-Device General] munjeni:
You no need to flash anything, just run newflasher and confirm with Y when it ask you about dump trim area, in that case newflasher will not flash anything
[Sony Cross-Device General] ishemes:
Aight! I didn't know that! I'll try it later today or tomorrow morning.
[Sony Cross-Device General] munjeni:
My brain is full, seems tool no go this day :( In the morning I will look detaily into code, line by line... Thank you a lot for your time testing our tool!!!
[Sony Cross-Device General] munjeni:
New vers is out, I am not sure where mem leak happen, only which I see is its after "get reaply", probably in section malloc, now I have add hex output for debug in that section and added memset which null variable before variable gets filled with info, I am hope mem leak is solved finaly, but let see
[Sony Cross-Device General] munjeni:
Hmm seems strlen function fail somehow, don't know if it is mingw32 bug but I have removed completelly strlen use from tool, might be ok now. Curently have implemented simulation for sin files, you can put an sin file e.g. cache.sin in the same dir with newflasher, tool will not flash but will simulate something :) , its not fully finished simulation because need to implement many more things but at least lets see how it looks :) New version is out!
[Sony Cross-Device General] thrash001:
i start the exe in the dir with the full firmware
[Sony Cross-Device General] munjeni:
That will take up 10 to 15 minutes, maybe try without system.sin just to save some time?
[Sony Cross-Device General] munjeni:
Can you post full log please, need to see if memleak is solved
[Sony Cross-Device General] thrash001:
Yes but the process is still running ..
[Sony Cross-Device General] munjeni:
New version is out :)
[Sony Cross-Device General] munjeni:
From some unknown reason get-root-key-hach goes into variable "sync" and it sends 0x20 bytes command instead of command "sync", how the hell... :( Need to solve mem leak first! Can you move exe out of sin files, need to solve that mem leak first please! Sin files is ok which is good thing, so no need by now log about sin :)
[Sony Cross-Device General] thrash001:
--------------------------------------------------------
newflasher.exe by Munjeni @ 2017
--------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_b00b#5&448f588&0&1#{a5dcbf10-6530-11d2-901f-00
c04fb951ed}
Class Description: USB-Controller
Device Instance Id: USB\VID_0FCE&PID_B00B\5&448F588&0&1

DATA:20

Max download size: 10485760
Product: G814
Version: 0.4-SONY-0.
Bootloader version: 1306-5035_X_Boot_MSM8998_LA1.1_N_59-
Baseband version: 1306-8499_45.0.A.1.22
Serialno: CB512EADT
Secure: ye
Sector size: 409
Loader version: XFL-MSM8998-N-3
Phone ID: 0000:3578380805909
Device ID: A6D4C46
Platform ID: 2005E0E
Rooting status: ROOTABL
Ufs info: TOSHIBA,THGAF4G9N4LBAIRB,010
Emmc info: FAILEmmc-info not supporte
Default security: O
Keystore counter: 0
Security state: BA1894F07A55612C78DAADBA68D953CB4B3D213
Sake root: D15
S1 root: S1_Root_e69
Root key hash: C30DEC2471CEA311E6918657367B51068A39583BBF89FD68B379BCD5A709AB1B

Using existing folder flash_session

No .sin files in current dir!
ERROR: TIMEOUT: failed with error code 997 as follows:
▄berlappender E/A-Vorgang wird verarbeitet.
- Error write! Need nBytes: 0x4 but done: 0x20
nBytes[0x20]:

00000000 53 79 6E 63 00 CE A3 11 E6 91 86 57 36 7B 51 06 Sync.......W6{Q.
00000010 8A 39 58 3B BF 89 FD 68 B3 79 BC D5 A7 09 AB 1B .9X;...h.y......

- Error writing command Sync!
Drücken Sie eine beliebige Taste . . .
[Sony Cross-Device General] munjeni:
The most strange thing is:

Device Instance Id: USB\VID_0FCE&PID_B00B\5&448F588&0&1

[COLOR="Red"]DATA:20[/COLOR]

That have definitelly no order there, unbelievable how the hell that string is printed on that line, imposible, unbelievable ohhhhh

An banal thing cause whole program to not work corectly, unbelievable. Added some memsets which nulls variable, lets hope all is ok now, new version is out
[Sony Cross-Device General] munjeni:
My function is:

[COLOR="Blue"]memset(tmp, 0, sizeof(tmp));[/COLOR]
snprintf(tmp, sizeof(tmp), "Sync");
if (transfer_bulk_async(dev, EP_OUT, tmp, strlen(tmp), USB_TIMEOUT, 1) < 1) {
printf(" - Error writing command %s!\n", tmp);

Most stupid (which definitelly is not need if snprintf is used) is blue. But still it sends 20 bytes as a write reguest, WTH :(