Function at 0x465240
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x5c
cmp dword [esp + 0x60], 0
push edi
je 0x465287
mov edi, dword [esp + 0x68]
test edi, edi
je 0x465287
mov eax, dword [edi]
mov ecx, dword [eax + 8]
mov edx, dword [eax + 4]
push ecx
push edx
push 0
push 0
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x46528e
push eax
lea ecx, [esp + 0x2c]
push ecx
mov edx, ecx
push edx
call dword [sym.imp.USER32.dll_IntersectRect]
test eax, eax
jne 0x46528e
xor eax, eax
pop edi
add esp, 0x5c
ret
push ebx
mov ebx, dword [esp + 0x38]
sub ebx, dword [esp + 0x30]
push ebp
mov ebp, dword [esp + 0x38]
sub ebp, dword [esp + 0x30]
push esi
push edi
call fcn.00464e30
movzx ecx, ax
mov eax, dword [edi]
movzx esi, word [eax + 0xe]
movzx eax, si
imul eax, ebp
add eax, 0x1f
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
imul eax, ebx
add ecx, ecx
add ecx, ecx
mov edx, 0x4d42
mov dword [esp + 0x1c], ecx
add eax, eax
mov word [esp + 0x28], dx
xor edx, edx
add eax, eax
add ecx, 0x36
mov word [esp + 0x2e], dx
mov word [esp + 0x30], dx
mov dword [esp + 0x32], ecx
add ecx, eax
mov word [esp + 0x56], si
xor esi, esi
mov edx, 1
push edi
mov dword [esp + 0x2e], ecx
mov dword [esp + 0x4c], 0x28
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], ebx
mov word [esp + 0x58], dx
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], esi
call fcn.00464e30
add esp, 8
movzx eax, ax
push ecx
push 0x42
mov dword [esp + 0x70], eax
mov dword [esp + 0x6c], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [esp + 0x14], eax
cmp eax, esi
je 0x4653e2
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov dword [eax], ecx
mov ecx, dword [esp + 0x2c]
mov dword [eax + 4], edx
mov dx, word [esp + 0x30]
mov dword [eax + 8], ecx
mov word [eax + 0xc], dx
add eax, 0xe
mov edi, eax
mov ecx, 0xa
lea esi, [esp + 0x44]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x74]
add eax, 0x28
mov dword [esp + 0x10], eax
test edi, edi
jbe 0x4653aa
push eax
mov eax, dword [esp + 0x6c]
push eax
push 0
push esi
call fcn.00464fb0
add esp, 0x10
add dword [esp + 0x10], edi
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x34]
dec ecx
push ecx
push edx
push esi
call fcn.0041b870
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x4653ec
mov edi, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push edi
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop esi
pop ebp
pop ebx
xor eax, eax
pop edi
add esp, 0x5c
ret
mov eax, dword [esi + 0xc]
mov dword [esp + 0x1c], eax
movzx eax, word [esp + 0x52]
imul eax, ebp
lea esi, [eax + 0x1f]
shr esi, 5
add esi, esi
add esi, esi
test ebx, ebx
jle 0x465438
cdq
and edx, 7
add eax, edx
mov ebp, eax
sar ebp, 3
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x10]
push ebp
push edi
push ebx
call fcn.004f37d0
add edi, dword [esp + 0x28]
add ebx, esi
add esp, 0xc
sub dword [esp + 0x18], 1
mov dword [esp + 0x10], ebx
jne 0x465418
mov ecx, dword [esp + 0x70]
push 0
push 0x8000080
push 2
push 0
push 0
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, dword [esp + 0x14]
mov esi, eax
cmp esi, 0xffffffff
je 0x4653c8
mov ebx, dword [esp + 0x26]
push 0
lea edx, [esp + 0x24]
push edx
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
cmp dword [esp + 0x24], ebx
jae 0x46548a
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4653c8
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push edi
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop esi
pop ebp
pop ebx
mov eax, 1
pop edi
add esp, 0x5c
ret