Function at 0x401790
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x51c
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x42c]
xor esi, esi
push 0x100
mov ebx, 1
push eax
push esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x2c]
push esi
push ecx
push esi
lea edx, [esp + 0x438]
push esi
push edx
call fcn.00401e84
lea eax, [esp + 0x40]
push eax
call fcn.00401de6
lea ecx, [esp + 0x44]
push ecx
push str._s_Version_1.0_08_20_2002__n
push 0x4072e0
call fcn.00401c2f
push 0x407298
push 0x4072e0
call fcn.00401c2f
mov ebp, dword [esp + 0x55c]
add esp, 0x2c
cmp ebp, ebx
jg 0x401862
lea edx, [esp + 0x2c]
push edx
push str._tUsage:__s.EXE__filename.ext__n
push 0x407300
call fcn.00401c2f
lea eax, [esp + 0x38]
push eax
push str._t____or__s.EXE__filename.ext____LINECODE__n
push 0x407300
call fcn.00401c2f
lea ecx, [esp + 0x44]
push ecx
push str._t____or__s.EXE___LINECODE__n
push 0x407300
call fcn.00401c2f
add esp, 0x24
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x51c
ret
mov edx, dword [esp + 0x534]
add edx, 4
cmp ebx, 3
jg 0x4018f7
jge 0x4018eb
mov edi, dword [edx]
mov al, byte [edi]
cmp al, 0x2f
je 0x401883
cmp al, 0x2d
jne 0x4018b5
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea esi, [esp + 0x32c]
sub edi, ecx
mov eax, ecx
mov dword [esp + 0x10], esi
mov esi, edi
mov edi, dword [esp + 0x10]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov dword [esp + 0x14], 1
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [edx]
mov al, byte [edi]
cmp al, 0x2f
je 0x4018eb
cmp al, 0x2d
je 0x4018eb
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea esi, [esp + 0x12c]
sub edi, ecx
mov eax, ecx
mov dword [esp + 0x10], esi
mov esi, edi
mov edi, dword [esp + 0x10]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
inc ebx
add edx, 4
cmp ebx, ebp
jl 0x40186c
lea ecx, [esp + 0x22c]
push ecx
call fcn.00401320
add esp, 4
test eax, eax
jne 0x40192b
push str._tPrinter_is_not_ready__n
push 0x407300
call fcn.00401c2f
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x51c
ret
mov eax, dword [esp + 0x14]
test eax, eax
je 0x401943
lea edx, [esp + 0x32c]
push edx
call fcn.00401470
add esp, 4
push 0
push 0x80
push 3
push 0
push 0
lea eax, [esp + 0x140]
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401991
lea ecx, [esp + 0x12c]
push ecx
push str._tFile_open_error...__s_
push 0x407300
call fcn.00401c2f
add esp, 0xc
or eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x51c
ret
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0x407d00
mov dword [esp + 0x14], eax
call fcn.004013b0
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
mov dword [esp + 0x14], ebx
jne 0x4019e1
push 0x407d00
push str.Open_port__s_error._n
push 0x407300
call fcn.00401c2f
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
or eax, ebx
pop ebp
pop ebx
add esp, 0x51c
ret
push 0x1000
push 0x2040
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
lea edx, [esp + 0x22c]
mov edi, eax
push edx
push str.Printing_to__s_n
push 0x4072e0
call fcn.00401c2f
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0xc
mov eax, dword [esp + 0x18]
test eax, eax
je 0x401ae2
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0x80
push 3
push 0
push 0
lea eax, [esp + 0x140]
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
lea ecx, [esp + 0x1c]
push 0
push ecx
push 0x1000
push edi
push esi
call ebp
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x401aaa
push ecx
push edi
push ebx
call fcn.00401420
mov ecx, dword [esp + 0x28]
add esp, 0xc
cmp eax, ecx
jne 0x401ac8
mov edx, dword [esp + 0x10]
mov ebx, dword [esp + 0x20]
push edx
push ebx
push str.Printing....__d__d__r
push 0x4072e0
call fcn.00401c2f
mov eax, dword [esp + 0x2c]
add esp, 0x10
add ebx, eax
mov dword [esp + 0x20], ebx
mov ebx, dword [esp + 0x14]
jmp 0x401a53
test eax, eax
jne 0x401ad0
lea eax, [esp + 0x12c]
push eax
push str._tError_reading_file..__s__n
push 0x407300
call fcn.00401c2f
add esp, 0xc
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x24]
inc eax
cmp eax, 1
mov dword [esp + 0x24], eax
jle 0x401a1e
push 0x407298
push 0x4072e0
call fcn.00401c2f
add esp, 8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
mov esi, dword [esp + 0x28]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x401b26
push str.Printing_complete...__n
push 0x4072e0
jmp 0x401b30
push str.Printer_Error..._
push 0x407300
call fcn.00401c2f
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x51c
ret