Function at 0x5702180c
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe0
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 4], eax
lea eax, [ebp - 8]
push eax
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
call sym.madBasic_.bpl__Madres_GetIconGroupResourceW_qqsuipbusrp17Madres_TIconGroup
test eax, eax
je 0x57021a4c
mov cl, 1
mov dl, 1
mov eax, dword [ebp + 0x14]
call fcn.57020704
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
je 0x57021a4c
xor eax, eax
push ebp
push 0x57021a45
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 8]
movzx esi, word [eax + 4]
dec esi
test esi, esi
jl 0x5702188b
inc esi
xor ebx, ebx
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 8]
mov eax, dword [edx + eax*2 + 0xe]
add dword [ebp - 0x1c], eax
inc ebx
dec esi
jne 0x57021873
xor eax, eax
mov dword [ebp - 0x10], eax
xor eax, eax
mov dword [ebp - 0x14], eax
xor eax, eax
push ebp
push 0x57021a27
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
movzx eax, word [eax + 4]
shl eax, 4
add eax, 6
call sub.rtl120.bpl__System__GetMem_qqri
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__System__GetMem_qqri
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
mov ecx, 4
call sub.rtl120.bpl__System_Move_qqrpxvpvi
mov eax, dword [ebp - 0x10]
mov word [eax + 4], 0
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 8]
movzx esi, word [eax + 4]
dec esi
test esi, esi
jl 0x57021986
inc esi
xor ebx, ebx
mov eax, dword [ebp - 0x10]
movzx eax, word [eax + 4]
add eax, eax
mov edx, dword [ebp - 0x10]
lea edx, [edx + eax*8 + 6]
mov edi, ebx
add edi, edi
add edi, edi
add edi, edi
sub edi, ebx
mov eax, dword [ebp - 8]
lea eax, [eax + edi*2 + 6]
mov ecx, 0xe
call sub.rtl120.bpl__System_Move_qqrpxvpvi
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x20]
push eax
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp - 8]
movzx eax, word [eax + edi*2 + 0x12]
push eax
push 3
mov eax, dword [ebp + 8]
push eax
call sym.madBasic_.bpl__Madres_GetResourceW_qqsuipbt2usrpvrui
test eax, eax
je 0x5702197e
mov eax, dword [ebp - 0x10]
movzx eax, word [eax + 4]
add eax, eax
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
sub ecx, dword [ebp - 0x14]
mov dword [edx + eax*8 + 0x12], ecx
mov eax, dword [ebp - 8]
mov ecx, dword [eax + edi*2 + 0xe]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System_Move_qqrpxvpvi
mov eax, dword [ebp - 8]
mov eax, dword [eax + edi*2 + 0xe]
add dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x10]
inc word [eax + 4]
inc ebx
dec esi
jne 0x570218f5
mov eax, dword [ebp - 0x10]
movzx esi, word [eax + 4]
dec esi
test esi, esi
jl 0x570219b1
inc esi
xor ebx, ebx
mov eax, ebx
add eax, eax
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x10]
movzx ecx, word [ecx + 4]
shl ecx, 4
add ecx, 6
add dword [edx + eax*8 + 0x12], ecx
inc ebx
dec esi
jne 0x57021995
mov eax, dword [ebp - 0x10]
movzx ebx, word [eax + 4]
test bx, bx
jbe 0x570219fc
push 0
lea eax, [ebp - 0x1c]
push eax
movzx eax, bx
shl eax, 4
add eax, 6
push eax
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_WriteFile
test eax, eax
je 0x570219fc
push 0
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_WriteFile
test eax, eax
jne 0x57021a00
xor eax, eax
jmp 0x57021a02
mov al, 1
neg al
sbb eax, eax
mov dword [ebp - 4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x57021a2e
mov eax, dword [ebp - 0x10]
call sub.rtl120.bpl__System__FreeMem_qqrpv
mov eax, dword [ebp - 0x14]
call sub.rtl120.bpl__System__FreeMem_qqrpv
ret
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10