Function at 0xffd3d59
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
and dword [ebp - 8], 0
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 0x10]
cmp di, 0xc
jne 0xffd3d94
cmp dword [esi], 0x462b5441
jne 0xffd3d94
cmp dword [esi + 4], 0x53414c43
jne 0xffd3d94
cmp word [esi + 8], 0x3d53
jne 0xffd3d94
mov dword [ebp - 8], 1
mov ebx, dword [ebp + 8]
lea eax, [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0x28]
xor ecx, ecx
cmp dword [ebx + 0x24], eax
mov dword [ebp - 4], edi
sete cl
mov dword [ebp - 0x10], ecx
mov cx, word [ebx + 0x2c]
cmp di, cx
jb 0xffd3dbe
mov dword [ebp - 4], ecx
movzx ecx, word [ebx + 0x34]
sub ecx, eax
mov eax, dword [ebx + 0x30]
add eax, ecx
movzx ecx, word [ebp - 4]
cmp ecx, eax
mov dword [ebp - 0xc], ecx
mov dword [ebp + 0x10], ecx
jl 0xffd3dda
mov dword [ebp + 0x10], eax
movzx eax, word [ebp + 0x10]
mov edi, dword [ebx + 0x28]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp + 0x10]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
movzx edi, word [ebx + 0x34]
add dword [ebx + 0x28], eax
mov ecx, dword [ebx + 0x30]
mov esi, dword [ebx + 0x28]
sub word [ebx + 0x2c], dx
add edi, ecx
cmp esi, edi
mov dword [ebp + 8], edx
jb 0xffd3e11
mov dword [ebx + 0x28], ecx
cmp dx, word [ebp - 4]
jae 0xffd3e55
mov ecx, dword [ebp - 0xc]
sub ecx, eax
movzx eax, word [ebx + 0x2c]
cmp ecx, eax
mov dword [ebp + 0x10], ecx
jl 0xffd3e2a
mov dword [ebp + 0x10], eax
movzx eax, word [ebp + 0x10]
movzx esi, word [ebp + 8]
add esi, dword [ebp + 0xc]
mov edi, dword [ebx + 0x28]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x10]
sub word [ebx + 0x2c], cx
add dword [ebx + 0x28], eax
add dword [ebp + 8], ecx
xor edi, edi
cmp dword [ebp - 0x10], edi
je 0xffd3ef7
cmp word [ebp + 8], di
je 0xffd3ef7
mov edx, dword [ebx + 0x24]
mov ecx, dword [ebx + 0x28]
cmp edx, ecx
jae 0xffd3e7a
mov eax, ecx
sub eax, edx
jmp 0xffd3e83
movzx eax, word [ebx + 0x34]
sub eax, edx
add eax, dword [ebx + 0x30]
mov esi, 0x400
cmp eax, esi
jle 0xffd3e90
mov eax, esi
jmp 0xffd3ea3
cmp edx, ecx
jae 0xffd3e9a
sub ecx, edx
mov eax, ecx
jmp 0xffd3ea3
movzx eax, word [ebx + 0x34]
sub eax, edx
add eax, dword [ebx + 0x30]
lea ecx, [ebx + 0x40]
push ecx
mov word [ebx + 0x2e], ax
lea ecx, [ebx + 0x58]
push ecx
movzx eax, ax
push eax
push edx
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0xffd3ed6
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
cmp eax, 0x3e5
setne cl
mov dword [ebx + 0x54], ecx
jmp 0xffd3edd
mov dword [ebx + 0x54], 1
lea eax, [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 8], edi
jne 0xffd3f06
push dword [ebx + 0x3c]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0xffd3f1a
lea eax, [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 8], edi
je 0xffd3f1a
push dword [ebx + 0x3c]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ax, word [ebp + 8]
pop edi
pop esi
pop ebx
leave
ret 0xc