Function at 0x47d180
Capabilities:
Check for time delay via gettickcount

Disassembly:
sub esp, 0x420
mov eax, dword [0x4e3f80]
xor eax, esp
mov dword [esp + 0x41c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x42c]
push esi
push edi
push str.COMMS_CONNECTED
mov eax, ebp
call fcn.00480b20
mov esi, eax
xor ebx, ebx
cmp esi, ebx
je 0x47d1cb
push esi
call fcn.0049e31d
add esp, 4
push esi
mov edi, eax
call fcn.0049081d
add esp, 4
cmp edi, ebx
jne 0x47d1df
mov eax, dword [ebp + 0x4c]
cmp eax, 1
je 0x47d1df
cmp eax, 2
je 0x47d1df
mov dword [ebp + 0x4c], 1
mov eax, dword [ebp + 0x4c]
cmp eax, 7
je 0x47d1f5
cmp eax, 8
je 0x47d1f5
cmp eax, 1
jne 0x47d2e3
cmp dword [ebp + 0x18c], ebx
je 0x47d278
mov eax, dword [ebp + 0x188]
push eax
lea esi, [esp + 0x14]
call fcn.0047ab10
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x32
mov esi, eax
call ebx
push esi
mov esi, dword [esp + 0x14]
lea edi, [ebp + 0x140]
push esi
call fcn.00479de0
test eax, eax
jne 0x47d235
mov eax, edi
call fcn.00479a00
push 0x32
call ebx
xor ecx, ecx
cmp dword [ebp + 0x188], ecx
lea edx, [esp + 0x18]
sete cl
push ecx
push 0x4c3af0
call fcn.0040a1c0
add esp, 8
push 1
lea edx, [esp + 0x1c]
push edx
mov eax, str.PRINTINGOFF
mov ecx, ebp
call fcn.004808f0
mov dword [ebp + 0x18c], 0
jmp 0x47d5a0
cmp eax, 1
jne 0x47d2e3
push ebx
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0047a8b0
mov esi, dword [esp + 0x10]
push eax
lea edi, [ebp + 0x140]
push esi
call fcn.00479de0
test eax, eax
jne 0x47d2b3
mov eax, edi
call fcn.00479a00
mov dword [ebp + 0x4c], 2
jmp 0x47d5a0
cmp dword [ebp + 0x40], ebx
jne 0x47d2c9
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add eax, 0xbb8
mov dword [ebp + 0x130], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add eax, 0x2710
mov dword [ebp + 0x40], eax
mov dword [ebp + 0x4c], 2
jmp 0x47d5a0
cmp eax, 3
je 0x47d55f
push ebp
mov eax, str.READ_PRINTER_SETTINGS
call fcn.00480bc0
test eax, eax
jne 0x47d55f
mov eax, dword [ebp + 0x4c]
cmp eax, 5
jne 0x47d33e
push 0x12
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0047a8b0
mov esi, dword [esp + 0x10]
push eax
lea edi, [ebp + 0x140]
push esi
call fcn.00479de0
test eax, eax
jne 0x47d332
mov eax, edi
call fcn.00479a00
mov dword [ebp + 0x4c], 6
jmp 0x47d5a0
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, 8
jne 0x47d38b
call esi
cmp dword [ebp + 0x48], eax
jae 0x47d38b
push 0xc
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0047a8b0
mov ebx, dword [esp + 0x10]
push eax
lea edi, [ebp + 0x140]
push ebx
call fcn.00479de0
test eax, eax
jne 0x47d37b
mov eax, edi
call fcn.00479a00
call esi
add eax, 0x3e8
mov dword [ebp + 0x48], eax
push ebx
jmp 0x47d5a1
mov eax, dword [ebp + 0x4c]
cmp eax, 8
je 0x47d39c
cmp eax, 7
jne 0x47d49a
cmp dword [ebp + 0x2c], ebx
je 0x47d438
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x64
call ebx
mov eax, dword [ebp + 0x30]
mov ecx, dword [ebp + 0x2c]
push eax
lea edi, [ebp + 0x140]
push ecx
call fcn.00479de0
test eax, eax
jne 0x47d3d4
mov eax, edi
call fcn.00479a00
xor esi, esi
mov dword [ebp + 0x28], esi
jmp 0x47d41d
push 0x64
call ebx
mov dword [ebp + 0x28], 1
call esi
add eax, 0x9c40
mov dword [ebp + 0x130], eax
call esi
add eax, 0x9c40
mov dword [ebp + 0x40], eax
call esi
add eax, 0xbb8
mov dword [ebp + 0x44], eax
call esi
add eax, 0xbb8
mov dword [ebp + 0x48], eax
call esi
add eax, 0xbb8
mov dword [ebp + 0x48], eax
mov dword [ebp + 0x4c], 8
xor esi, esi
mov eax, dword [ebp + 0x2c]
cmp eax, esi
je 0x47d430
push eax
call fcn.0049081d
add esp, 4
mov dword [ebp + 0x2c], esi
mov dword [ebp + 0x30], esi
jmp 0x47d5a9
cmp eax, 7
jne 0x47d49a
cmp dword [ebp + 0x170], ebx
jbe 0x47d49a
call esi
cmp dword [ebp + 0x44], eax
jae 0x47d49a
push 0xc
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0047a8b0
mov ebx, dword [esp + 0x10]
push eax
lea edi, [ebp + 0x140]
push ebx
call fcn.00479de0
test eax, eax
jne 0x47d477
mov eax, edi
call fcn.00479a00
call esi
add eax, 0x3e8
cmp dword [ebp + 0x170], 1
mov dword [ebp + 0x44], eax
jne 0x47d494
mov dword [ebp + 0x170], 0
push ebx
jmp 0x47d5a1
cmp dword [ebp + 0x4c], 7
jne 0x47d4f3
call esi
cmp dword [ebp + 0x44], eax
jae 0x47d4f3
push 1
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0047a8b0
mov ebx, dword [esp + 0x10]
push eax
lea edi, [ebp + 0x140]
push ebx
call fcn.00479de0
test eax, eax
jne 0x47d4d2
mov eax, edi
call fcn.00479a00
call esi
add eax, 0xbb8
mov dword [ebp + 0x44], eax
call esi
add eax, 0xbb8
mov dword [ebp + 0x48], eax
mov dword [ebp + 0x4c], 8
push ebx
jmp 0x47d5a1
cmp dword [ebp + 0x4c], 8
jne 0x47d509
cmp dword [ebp + 0x38], ebx
je 0x47d509
push ebp
call fcn.0047dfa0
jmp 0x47d5a9
lea eax, [ebp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebp + 0x1a0], ebx
jle 0x47d553
lea esi, [ebp + 0x194]
lea ebx, [esp + 0x10]
call fcn.004814c0
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
push edx
lea edi, [ebp + 0x140]
push esi
call fcn.00479de0
test eax, eax
jne 0x47d54a
mov eax, edi
call fcn.00479a00
push esi
call fcn.0049081d
add esp, 4
lea eax, [ebp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x47d5a9
push 3
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.0047a8b0
mov esi, dword [esp + 0x10]
push eax
lea edi, [ebp + 0x140]
push esi
call fcn.00479de0
test eax, eax
jne 0x47d58a
mov eax, edi
call fcn.00479a00
push 1
push ebx
push str.READ_PRINTER_SETTINGS
mov ecx, ebp
mov dword [ebp + 0x4c], 4
call fcn.004809b0
push esi
call fcn.0049081d
add esp, 4
mov eax, dword [ebp + 0x148]
cmp eax, dword [ebp + 0x144]
lea ebx, [ebp + 0x140]
jne 0x47d624
xor edi, edi
cmp dword [ebp + 0x4c], 6
jne 0x47d5df
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp + 0x154]
cmp eax, 0x1f4
jbe 0x47d5df
mov dword [ebp + 0x4c], 8
cmp edi, 4
jne 0x47d6ef
cmp byte [esp + 0x28], 2
jne 0x47d6de
movzx esi, byte [esp + 0x29]
movzx ecx, byte [esp + 0x2a]
movzx edx, byte [esp + 0x2b]
shl esi, 8
add esi, ecx
shl esi, 8
add esi, edx
cmp esi, edi
mov dword [esp + 0x10], esi
jle 0x47d6b0
mov eax, dword [ebx + 8]
cmp eax, dword [ebx + 4]
jne 0x47d66b
xor eax, eax
jmp 0x47d67e
push 4
lea esi, [esp + 0x2c]
mov ecx, ebx
call fcn.00488b70
mov edi, eax
lea ecx, [edi - 1]
cmp ecx, 2
ja 0x47d5bf
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebx + 8]
cmp edx, dword [ebx + 4]
jne 0x47d651
xor eax, eax
add edi, eax
jmp 0x47d5df
mov eax, 4
sub eax, edi
push eax
lea esi, [esp + edi + 0x2c]
mov ecx, ebx
call fcn.00488b70
add edi, eax
jmp 0x47d5df
add esi, 0xfffffffc
push esi
lea esi, [esp + 0x30]
mov ecx, ebx
call fcn.00488b70
mov esi, dword [esp + 0x10]
lea edi, [eax + 4]
cmp edi, esi
je 0x47d6c5
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebx + 8]
cmp ecx, dword [ebx + 4]
jne 0x47d69c
xor eax, eax
jmp 0x47d6ae
sub esi, edi
push esi
lea esi, [esp + edi + 0x2c]
mov ecx, ebx
call fcn.00488b70
mov esi, dword [esp + 0x10]
add edi, eax
cmp edi, esi
je 0x47d6c5
push str.Received_short_message_r_n
call fcn.00477b80
add esp, 4
xor eax, eax
jmp 0x47d711
mov edx, dword [ebp]
mov edx, dword [edx + 0x1c]
push edi
lea eax, [esp + 0x2c]
push eax
mov ecx, ebp
call edx
cmp eax, 0xffffffff
jne 0x47d70c
xor eax, eax
jmp 0x47d711
push str.first_byte_wasnt_STX_r_n
call fcn.00477b80
add esp, 4
xor eax, eax
jmp 0x47d711
test edi, edi
jle 0x47d704
push str.Received_short_header_r_n
call fcn.00477b80
add esp, 4
xor eax, eax
jmp 0x47d711
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, 1
mov ecx, dword [esp + 0x42c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0049dc2a
add esp, 0x420
ret 4