Function at 0x405270
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
xor ecx, ecx
mov eax, 0xc0
mov dword [ebp - 4], eax
mov edx, 2
mul edx
seto cl
push ebx
push esi
neg ecx
or ecx, eax
push ecx
call fcn.0044d31e
mov ebx, eax
xor eax, eax
push 0xc0
lea esi, [edi + 0x2ef0]
push ebx
lea ecx, [ebp - 4]
mov dword [ebp - 8], ebx
mov dword [ebx], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
call fcn.004020e0
add esp, 0xc
test eax, eax
jne 0x405323
cmp word [ebp - 4], 1
jb 0x405323
movzx eax, word [ebx]
mov ecx, 0x2710
cmp ax, cx
jbe 0x405323
mov ebx, eax
movzx ecx, bx
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0xc], ebx
cmp eax, 0x2a
jne 0x4054b4
mov eax, ecx
cdq
mov ebx, 0x64
idiv ebx
mov ebx, dword [ebp - 0xc]
test edx, edx
jle 0x4054b4
mov edx, 0xa430
cmp bx, dx
jae 0x4054b4
mov dword [ebp - 0x10], 1
mov ebx, dword [ebp - 8]
push ebx
lea ecx, [ebp - 4]
mov dword [ebp - 4], 0xc0
call fcn.004021f0
add esp, 4
test eax, eax
jne 0x4056ea
movzx esi, word [ebp - 4]
mov eax, 0x2aaaaaab
imul esi
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 8], eax
cmp eax, dword [edi + 0xab0]
jle 0x4053a6
mov eax, dword [edi + 0xaa8]
test eax, eax
je 0x40536e
push eax
call fcn.0044d2c4
add esp, 4
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0044d31e
lea ecx, [esi + esi]
push ecx
push 0
push eax
mov dword [edi + 0xaa8], eax
call fcn.0044e830
mov edx, dword [ebp - 8]
add esp, 0x10
mov dword [edi + 0xab0], edx
mov eax, edx
xor ecx, ecx
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], 0x2711
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0xc], ecx
cmp eax, ecx
jle 0x4055a9
lea eax, [ebx + 4]
jmp 0x4053d0
movzx esi, word [eax + 6]
mov edx, 0x3e9
cmp si, dx
je 0x405499
mov edx, 0x1f7
cmp si, dx
je 0x405499
movzx edx, word [eax - 4]
cmp dx, 4
jne 0x40541b
cmp word [eax - 2], 3
jne 0x40541b
cmp word [eax], 0xa
jne 0x40541b
cmp word [eax + 2], 1
jne 0x40541b
cmp word [eax + 4], 0
jne 0x40541b
cmp si, 1
je 0x405499
cmp dx, 5
jne 0x405442
cmp word [eax - 2], 6
jne 0x405442
cmp word [eax], 2
jne 0x405442
cmp word [eax + 2], 0xffff
jne 0x405442
cmp word [eax + 4], 0
jne 0x405442
cmp si, 7
je 0x405499
cmp dword [ebp - 0x10], 1
jne 0x40544e
cmp si, 8
jne 0x405499
cmp dword [ebp - 0x14], 1
jne 0x40553b
movzx edx, word [eax]
cmp dx, 0xb
jne 0x405475
cmp si, 1
je 0x40553b
cmp si, 9
je 0x40553b
cmp dx, 0xa
jne 0x405485
cmp si, 9
je 0x40553b
cmp dx, 0xb
jne 0x405499
mov edx, 0x455
cmp si, dx
je 0x40553b
mov edx, dword [ebp - 0xc]
inc edx
add ecx, 6
add eax, 0xc
mov dword [ebp - 0xc], edx
cmp edx, dword [ebp - 8]
jl 0x4053d0
jmp 0x4055a9
mov eax, 0xabe7
cmp bx, ax
je 0x405320
mov edx, 0x9c4a
cmp bx, dx
jne 0x4054d8
mov dword [ebp - 0x14], 1
jmp 0x405320
cmp word [ebp - 4], 1
jne 0x4054fe
cmp dword [edi + 0xaa0], ecx
jne 0x4054f0
cmp dword [edi + 0xaa4], 0
jbe 0x405527
mov dword [edi + 0xaa4], 0
xor eax, eax
jmp 0x40551b
mov eax, dword [ebp - 8]
movzx eax, word [eax + 2]
cmp dword [edi + 0xaa0], ecx
jne 0x405515
cmp dword [edi + 0xaa4], eax
je 0x405527
mov dword [edi + 0xaa4], eax
push edi
mov dword [edi + 0xaa0], ecx
call fcn.004050e0
mov eax, dword [ebp - 8]
push eax
call fcn.0044d2c4
add esp, 4
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
movsx eax, word [ebx + ecx*2 + 0xa]
mov edx, dword [edi + 0xaa8]
mov dword [ebp - 4], eax
movzx eax, word [ebx + ecx*2]
mov word [edx], ax
movzx eax, word [ebx + ecx*2 + 2]
mov edx, dword [edi + 0xaa8]
mov word [edx + 2], ax
movzx eax, word [ebx + ecx*2 + 4]
mov edx, dword [edi + 0xaa8]
mov word [edx + 4], ax
movzx eax, word [ebx + ecx*2 + 6]
mov edx, dword [edi + 0xaa8]
mov word [edx + 6], ax
movzx eax, word [ebx + ecx*2 + 8]
mov edx, dword [edi + 0xaa8]
mov word [edx + 8], ax
movzx eax, word [ebx + ecx*2 + 0xa]
mov edx, dword [edi + 0xaa8]
mov dword [ebp - 0x1c], 0
mov word [edx + 0xa], ax
mov dword [ebp - 0x18], 1
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 0x18]
mov dword [edi + 0xab0], ecx
cmp dword [edi + 0xaa0], edx
jne 0x4055f3
mov eax, dword [edi + 0xaac]
mov edx, dword [edi + 0xaa8]
mov ecx, 0xc
sub edx, eax
mov esi, dword [eax + edx]
cmp esi, dword [eax]
jne 0x4055f3
sub ecx, 4
add eax, 4
cmp ecx, 4
jae 0x4055d0
push ebx
call fcn.0044d2c4
add esp, 4
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x1c], 0
mov eax, dword [ebp - 4]
mov ecx, dword [edi + 0xaac]
mov dword [edi + 0xaa0], eax
je 0x4056bc
xor eax, eax
mov dword [ecx], eax
push 0x80
mov dword [ecx + 4], eax
push 1
mov dword [ecx + 8], eax
call fcn.0044d510
push 0x2711
mov esi, eax
push str._PJL_USTATUS_DEVICE_r_nCODE_05d_r_n_f
lea ecx, [esi + 0xc]
push 0x5e
push ecx
mov dword [esi], 3
mov dword [esi + 8], 0x22
call fcn.0044d4f2
add esp, 0x18
cmp eax, 0xffffffff
je 0x405656
mov eax, dword [esi + 8]
add eax, 0x10
jmp 0x405659
mov eax, dword [ebp - 0x1c]
push 0
lea edx, [ebp - 0x1c]
push edx
push eax
mov eax, dword [edi + 0xa98]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4056a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
call fcn.0044ca3f
mov ecx, dword [edi + 8]
add esp, 4
push 0
push 0
push 0x10
push ecx
call dword [sym.imp.USER32.dll_PostMessageW]
push ebx
call fcn.0044d2c4
add esp, 4
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call fcn.0044ca3f
add esp, 4
push ebx
call fcn.0044d2c4
add esp, 4
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0xaa8]
mov edx, dword [eax]
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
mov eax, dword [eax + 8]
mov dword [ecx + 8], eax
mov ecx, edi
call fcn.00404c60
push ebx
call fcn.0044d2c4
add esp, 4
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0044d2c4
add esp, 4
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret