Function at 0x451540
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dd4e8
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x540c80]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
cmp byte [edi + 0x40], 0
je 0x4515b0
call fcn.004518d0
test al, al
jne 0x4515b0
mov ecx, dword [0x545d90]
mov eax, ecx
imul eax, ecx
cdq
mov esi, 0x12
idiv esi
cmp edx, 8
jne 0x4518b4
inc ecx
mov dword [0x545d90], ecx
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x60]
cmp eax, dword [edi + 0x64]
lea ebx, [edi + 0x60]
jne 0x4516a3
lea eax, [edi + 0x70]
mov dword [ebp - 0x1c], eax
lea esi, [eax + 4]
push esi
mov dword [ebp - 0x18], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
cmp dword [edi + 0x9c], 0
jne 0x45165d
mov esi, dword [0x545d90]
mov eax, esi
imul eax, esi
imul eax, esi
and eax, reloc.OLEAUT32.dll_VariantInit
jns 0x4515fc
dec eax
or eax, 0xfffffff8
inc eax
cmp eax, 2
jne 0x451639
mov eax, 0x51eb851f
imul esi
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
imul ecx, ecx, 0x64
sub esi, ecx
xor ecx, ecx
lea eax, [esi + 0x63]
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004aed89
push eax
call fcn.004afe1b
add esp, 8
mov dword [ebp - 4], 0xffffffff
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x34]
push eax
lea ecx, [edi + 0x8c]
call fcn.0042dbb0
mov edx, eax
mov eax, dword [edx]
test eax, eax
je 0x451676
mov eax, dword [eax]
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [edx + 8]
mov eax, dword [eax + ecx*4]
add eax, 4
push eax
mov ecx, ebx
call fcn.00429a40
mov dword [edi + 0x6c], 0
mov dword [ebp - 4], 0xffffffff
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebx + 4]
sub ecx, dword [ebx]
lea eax, [edi + 0x44]
push eax
lea eax, [ebp - 0x14]
push eax
mov eax, dword [edi + 0x6c]
add eax, dword [ebx]
push ecx
push eax
push dword [edi + 0x5c]
mov dword [ebp - 0x14], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x45171b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
je 0x451819
cmp eax, 0x3e5
je 0x451717
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x18], str.Channel_write_failure
call fcn.004b2892
mov dword [ebp - 4], 3
mov dword [ebp - 0x34], 0x5289d8
mov dword [ebp - 4], 0xffffffff
push 0x52adb4
lea eax, [ebp - 0x34]
push eax
call fcn.004b74bb
mov byte [edi + 0x40], 1
cmp byte [edi + 0x40], 0
jne 0x451852
mov eax, dword [ebp - 0x14]
add dword [edi + 0x6c], eax
mov esi, dword [0x545d90]
mov eax, esi
imul eax, esi
cdq
mov ecx, 0xf
idiv ecx
mov byte [ebp - 0xd], 1
cmp edx, 0xd
jne 0x4517aa
mov eax, 0x38e38e39
imul esi
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
xor ebx, ebx
lea ecx, [eax + eax*8]
shl ecx, 4
mov eax, esi
sub eax, ecx
cmp eax, 0x3e
je 0x4517a1
lea esp, [esp]
mov eax, esi
or eax, 0xffffff98
add esi, eax
mov eax, esi
imul eax, esi
inc ebx
cmp ebx, eax
jg 0x4517a1
mov eax, 0x38e38e39
imul esi
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax + eax*8]
shl ecx, 4
mov eax, esi
sub eax, ecx
cmp eax, 0x3e
jne 0x451770
mov dword [0x545d90], ebx
lea ebx, [edi + 0x60]
mov eax, dword [ebx + 4]
sub eax, dword [ebx]
cmp dword [edi + 0x6c], eax
jne 0x4517fb
lea eax, [edi + 0x70]
mov dword [ebp - 0x1c], eax
lea esi, [eax + 4]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 4
lea ecx, [edi + 0x8c]
call fcn.00451cc0
mov eax, dword [ebx]
mov dword [ebx + 4], eax
cmp dword [edi + 0x9c], 0
mov dword [edi + 0x6c], 0
setne byte [ebp - 0xd]
mov dword [ebp - 4], 0xffffffff
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [edi + 0x58]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x28]
call fcn.004b28f5
mov dword [ebp - 4], 1
mov dword [ebp - 0x28], 0x5289d8
mov dword [ebp - 4], 2
mov dword [ebp - 0x28], 0x528a38
mov dword [ebp - 4], 0xffffffff
push 0x52ad88
lea eax, [ebp - 0x28]
push eax
call fcn.004b74bb
mov ecx, dword [0x545d90]
mov edi, 0x17
lea eax, [ecx + 1]
lea esi, [ecx + 2]
imul esi, eax
imul esi, ecx
mov eax, esi
cdq
idiv edi
cmp edx, 0x13
jne 0x4518b4
mov eax, esi
cdq
mov esi, 0xf
idiv esi
cmp edx, 0xe
jne 0x451883
dec ecx
mov eax, ecx
sub eax, 0
je 0x4518aa
dec eax
jne 0x451595
mov dword [0x545d90], eax
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [0x545d90], 2
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret