Function at 0x403db0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x114
mov eax, dword [0x587770]
xor eax, esp
mov dword [esp + 0x110], eax
push ebp
mov ebp, dword [esp + 0x11c]
push esi
mov esi, ecx
mov eax, 0x564528
push edi
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], 0
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x403de4
sub eax, ecx
xor ecx, ecx
cmp ecx, 0x564528
je 0x403e37
test eax, eax
jle 0x403e37
mov ecx, dword [0x5893c4]
cmp ecx, 0xffffffff
je 0x403e37
push 0
lea edx, [esp + 0x14]
push edx
push eax
push 0x564528
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x403e37
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Write_buffer_____Error:__ld
mov edi, 0x59e710
call fcn.0040b3d0
add esp, 8
mov edx, dword [esi]
push 3
lea eax, [esp + 0x14]
push eax
push 0x7f
lea ecx, [esp + 0x24]
push ecx
push edx
mov eax, 0x1388
call fcn.0040af10
lea edi, [esp + 0x98]
mov esi, 0x564528
call fcn.00403730
lea edi, [esp + 0x18]
mov esi, edi
call fcn.00403730
lea eax, [esp + 0x98]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403e78
sub eax, edx
push eax
lea eax, [esp + 0x9c]
push eax
lea ecx, [esp + 0x20]
push ecx
call fcn.0050abb0
add esp, 0xc
test eax, eax
je 0x403eb5
push str.no_answer_on_Read_Part_Id_n
mov edi, 0x59e710
call fcn.0040b3d0
add esp, 4
or eax, 0xffffffff
jmp 0x40406a
push 4
lea edx, [esp + 0x1c]
push str.J_n0_n
push edx
call fcn.0050abb0
add esp, 0xc
test eax, eax
lea eax, [esp + 0x1c]
je 0x403ed5
lea eax, [esp + 0x18]
push 0xa
lea ecx, [esp + 0x10]
push ecx
push eax
call fcn.0050af09
mov edx, dword [esp + 0x18]
mov dword [ebx], eax
mov dword [ebp], 0
mov byte [edx], 0
mov edx, dword [ebx]
add esp, 0xc
mov ecx, 0xbd
mov eax, 0x1d38
cmp dword [eax + 0x58f200], edx
je 0x403f2c
cmp dword [eax + 0x58f1d8], edx
je 0x403f26
cmp dword [eax + 0x58f1b0], edx
je 0x403f29
sub eax, 0x78
sub ecx, 3
cmp eax, 0xffffffb0
jg 0x403f01
jmp 0x403f2c
dec ecx
jmp 0x403f2c
sub ecx, 2
mov edi, dword [esp + 0x14]
lea eax, [ecx + ecx*4]
mov dword [edi + 0xc], ecx
cmp dword [eax*8 + 0x58f1b8], 0
je 0x404019
mov ecx, dword [esp + 0xc]
mov byte [ecx], 0xa
mov esi, dword [esp + 0xc]
inc esi
mov dword [esp + 0xc], esi
cmp byte [esi], 0
je 0x403f70
mov eax, esi
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403f60
sub eax, edx
cmp byte [eax + esi - 1], 0xa
je 0x403f93
mov ecx, dword [edi]
push 1
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x9f]
sub eax, esi
push eax
push esi
push ecx
mov eax, 0x64
call fcn.0040af10
mov esi, dword [esp + 0xc]
mov edi, esi
call fcn.00403730
mov eax, dword [esp + 0xc]
mov cl, byte [eax]
test cl, cl
je 0x404031
cmp cl, 0xa
je 0x404031
push 0xa
lea edx, [esp + 0x10]
push edx
push eax
call fcn.0050af09
mov dword [ebx], eax
mov eax, dword [esp + 0x18]
mov byte [eax], 0
movzx edx, byte [ebp]
mov esi, dword [ebx]
add esp, 0xc
mov ecx, 0xbd
mov eax, 0x590f3c
lea ebx, [ebx]
cmp dword [eax - 4], esi
jne 0x403fe9
cmp dword [eax], edx
je 0x404012
cmp dword [eax - 0x2c], esi
jne 0x403ff3
cmp dword [eax - 0x28], edx
je 0x40400c
cmp dword [eax - 0x54], esi
jne 0x403ffd
cmp dword [eax - 0x50], edx
je 0x40400f
sub eax, 0x78
sub ecx, 3
cmp eax, 0x58f1b4
jg 0x403fe0
jmp 0x404012
dec ecx
jmp 0x404012
sub ecx, 2
mov edx, dword [esp + 0x14]
mov dword [edx + 0xc], ecx
mov edi, 0x59e710
test ecx, ecx
jne 0x40403b
push str.unknown_part_id
call fcn.0040b3d0
add esp, 4
jmp 0x404068
push str.incomplete_answer_on_Read_Part_Id__second_configuration_word_missing__n
jmp 0x403ea0
lea eax, [ecx + ecx*4]
add eax, eax
add eax, eax
mov ecx, dword [eax + eax + 0x58f1c4]
mov edx, dword [eax + eax + 0x58f1c0]
add eax, eax
mov eax, dword [eax + 0x58f1bc]
push ecx
push edx
push eax
push str.LPC_s___d_kiB_FLASH____d_kiB_SRAM
call fcn.0040b3d0
add esp, 0x10
xor eax, eax
mov ecx, dword [esp + 0x11c]
pop edi
pop esi
pop ebp
xor ecx, esp
call fcn.0050a0dc
add esp, 0x114
ret 4