Function at 0x521870
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x5ae3d2
push eax
mov eax, 0x1418
mov dword fs:[0], esp
call fcn.0058da10
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov eax, dword [esi + 0xc]
test eax, eax
jne 0x5218a3
xor eax, eax
jmp 0x521c50
lea ecx, [esp + 0x78]
call fcn.00522360
mov ecx, dword [esi + 0xc]
mov dword [esp + 0x1430], 0
mov eax, dword [ecx]
call dword [eax + 0x5c]
test eax, eax
je 0x5218cd
push eax
lea ecx, [esp + 0x7c]
call fcn.00522500
mov ebx, dword [sym.imp.KERNEL32.dll_GetProfileStringA]
lea ecx, [esp + 0x234]
push 0x1f4
push ecx
push 0x8693a8
push 0x8693a0
push 0x869398
call ebx
lea edx, [esp + 0x234]
push 0x869394
push edx
call fcn.0058e47e
add esp, 8
mov dword [esp + 0x20], eax
lea eax, [esp + 0x428]
push 0x1000
push eax
push 0x88b928
push 0
push 0x86938c
call ebx
mov ecx, dword [0x87a428]
or eax, 0xffffffff
lea esi, [esp + 0x428]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], ecx
lea ecx, [esp + 0x28]
mov byte [esp + 0x1430], 1
call fcn.0059d6e6
lea ecx, [esp + 0x50]
mov byte [esp + 0x1430], 2
call fcn.0059d6e6
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1430], 3
call fcn.0059d6e6
mov byte [esp + 0x1430], 4
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x24], ecx
je 0x521a6e
lea edx, [esp + 0xd8]
push 0xc8
push edx
push 0x8693a8
push esi
push 0x86938c
call ebx
lea eax, [esp + 0xd8]
push 0x869394
push eax
call fcn.0058e47e
mov edi, eax
add esp, 8
test edi, edi
je 0x521a5b
push 0x869394
push 0
call fcn.0058e47e
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x521a5b
push 0x869384
push ebp
call fcn.0058f090
add esp, 8
test eax, eax
je 0x521a5b
mov eax, dword [esp + 0x30]
push esi
push eax
lea ecx, [esp + 0x30]
mov ebx, eax
call fcn.0059d8c2
mov ecx, dword [esp + 0x58]
push edi
push ecx
lea ecx, [esp + 0x58]
call fcn.0059d8c2
mov edx, dword [esp + 0x44]
push ebp
push edx
lea ecx, [esp + 0x44]
call fcn.0059d8c2
mov eax, dword [esp + 0x20]
test eax, eax
je 0x521a3b
push eax
push esi
call fcn.0058f090
add esp, 8
test eax, eax
jne 0x521a3b
mov dword [esp + 0x18], ebx
mov eax, dword [esp + 0xb4]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x521a5b
push eax
push esi
call fcn.0058f090
add esp, 8
test eax, eax
jne 0x521a5b
mov dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x24]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProfileStringA]
lea esi, [esi + eax + 1]
jmp 0x52197c
mov ebx, dword [esp + 0x1c]
cmp ebx, 0xffffffff
jne 0x521a84
mov eax, dword [esp + 0x18]
mov ebx, eax
inc ebx
neg ebx
sbb ebx, ebx
and ebx, eax
mov ecx, dword [esp + 0x30]
dec ecx
cmp ebx, ecx
jle 0x521aec
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1430], 3
call fcn.0059d719
lea ecx, [esp + 0x50]
mov byte [esp + 0x1430], 2
call fcn.0059d719
lea ecx, [esp + 0x28]
mov byte [esp + 0x1430], 1
call fcn.0059d719
lea ecx, [esp + 0x10]
mov byte [esp + 0x1430], 0
call fcn.0059e7d2
lea ecx, [esp + 0x78]
mov dword [esp + 0x1430], 0xffffffff
call fcn.005223e0
xor eax, eax
jmp 0x521c50
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x10]
lea eax, [edx + ebx*4]
push eax
call fcn.0059e90b
mov edx, dword [esp + 0x10]
xor esi, esi
lea ecx, [esp + 0x14]
push esi
push ecx
push edx
call sub.WINSPOOL.DRV_OpenPrinterA
cmp eax, 1
jne 0x521bf6
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push esi
lea eax, [esp + 0x1a4]
push esi
push eax
push ecx
push edx
push esi
call sub.WINSPOOL.DRV_DocumentPropertiesA
lea ecx, [esp + 0x64]
mov edi, eax
call fcn.004f7780
push edi
lea ecx, [esp + 0x68]
mov byte [esp + 0x1434], 5
call fcn.004f77a0
mov ebp, eax
mov eax, dword [esp + 0xc8]
cmp eax, edi
jne 0x521b7f
mov esi, dword [esp + 0xc0]
mov ecx, edi
neg eax
sbb eax, eax
mov edi, ebp
and eax, esi
mov esi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x521b9d
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push 2
push 0
push ebp
push ecx
push edx
push 0
call sub.WINSPOOL.DRV_DocumentPropertiesA
mov eax, dword [ebp + 0x28]
or al, 3
mov dword [ebp + 0x28], eax
mov ax, word [esp + 0xcc]
push ebp
mov word [ebp + 0x2e], ax
mov cx, word [esp + 0xd2]
mov word [ebp + 0x2c], cx
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x58]
mov eax, dword [edx + ebx*4]
mov edx, dword [esp + 0x14]
mov ebx, dword [ecx + ebx*4]
push eax
push edx
push ebx
call dword [sym.imp.GDI32.dll_CreateDCA]
mov esi, eax
mov eax, dword [esp + 0x14]
push eax
call sub.WINSPOOL.DRV_ClosePrinter
lea ecx, [esp + 0x64]
mov byte [esp + 0x1430], 4
mov dword [esp + 0x64], 0x83b840
call fcn.004f7980
lea ecx, [esp + 0x3c]
mov byte [esp + 0x1430], 3
call fcn.0059d719
lea ecx, [esp + 0x50]
mov byte [esp + 0x1430], 2
call fcn.0059d719
lea ecx, [esp + 0x28]
mov byte [esp + 0x1430], 1
call fcn.0059d719
lea ecx, [esp + 0x10]
mov byte [esp + 0x1430], 0
call fcn.0059e7d2
lea ecx, [esp + 0x78]
mov dword [esp + 0x1430], 0xffffffff
call fcn.005223e0
mov eax, esi
mov ecx, dword [esp + 0x1428]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x1424
ret