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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x370
mov eax, dword [0x42f060]
xor eax, ebp
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x360], ecx
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x130], 0
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1c], eax
cmp dword [ebp + 0xc], 0xffffffff
jne 0x40a646
mov ecx, dword [ebp + 8]
push ecx
mov ecx, dword [ebp - 0x360]
call fcn.00409ff0
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 8]
push eax
push str.KCPROFKXP::LoadProfileRegValue__s___s_n
call fcn.00413880
add esp, 0xc
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
push str.KXP__04d__s
lea eax, [ebp - 0x128]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
mov ecx, dword [ebp - 0x360]
movzx edx, byte [ecx + 0x218]
test edx, edx
je 0x40a813
cmp dword [ebp - 0x1c], 0
je 0x40a813
lea eax, [ebp - 0x128]
push eax
mov ecx, dword [ebp - 0x360]
add ecx, 0xa36
push ecx
mov edx, dword [ebp - 0x360]
add edx, 0xf4a
push edx
push str._s_s__s
lea eax, [ebp - 0x340]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea ecx, [ebp - 0x340]
push ecx
mov ecx, dword [ebp - 0x360]
call fcn.0040c7c0
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
lea edx, [ebp - 0x340]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x134], eax
cmp dword [ebp - 0x134], 0xffffffff
je 0x40a80b
push 0
mov eax, dword [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jbe 0x40a7dc
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x34c], eax
mov edx, dword [ebp - 0x34c]
mov dword [ebp - 0x344], edx
mov dword [ebp - 0x348], 0
push 0
lea eax, [ebp - 0x348]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
mov edx, dword [ebp - 0x344]
push edx
mov eax, dword [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp + 0x14], 0
je 0x40a7bf
mov ecx, dword [ebp - 0x10]
push ecx
mov edx, dword [ebp - 0x344]
push edx
mov eax, dword [ebp + 0x14]
push eax
call fcn.00416200
add esp, 0xc
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x10]
mov dword [ecx], edx
mov eax, dword [ebp + 0x1c]
mov dword [eax], 3
mov ecx, dword [ebp - 0x348]
push ecx
lea edx, [ebp - 0x340]
push edx
push str.KCPROFKXP::LoadProfileRegValue_nFile____s___ld_bytes_read_n
call fcn.00413880
add esp, 0xc
mov eax, dword [ebp - 0x344]
mov dword [ebp - 0x350], eax
mov ecx, dword [ebp - 0x350]
push ecx
call fcn.00415ab7
add esp, 4
jmp 0x40a7f8
lea edx, [ebp - 0x128]
push edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
push str.LoadProfileRegValue___Size____s___ld___s_n
call fcn.00413880
add esp, 0x10
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x14]
jmp 0x40abf7
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x12c], 0
mov byte [ebp - 5], 0
mov ecx, dword [ebp - 0x360]
cmp dword [ecx + 0x220], 0xffffffff
je 0x40a856
mov edx, dword [ebp - 0x360]
mov eax, dword [edx + 0x220]
mov dword [ebp - 4], eax
mov dword [ebp - 0x12c], 1
mov byte [ebp - 5], 1
jmp 0x40a8a4
mov ecx, dword [ebp - 0x360]
movzx edx, byte [ecx + 0x218]
test edx, edx
je 0x40a887
push 0
lea eax, [ebp - 4]
push eax
mov ecx, dword [ebp - 0x360]
add ecx, 0xa36
push ecx
call sub.WINSPOOL.DRV_OpenPrinterA
mov dword [ebp - 0x12c], eax
jmp 0x40a8a4
push 0
lea edx, [ebp - 4]
push edx
mov eax, dword [ebp - 0x360]
add eax, 0x226
push eax
call sub.WINSPOOL.DRV_OpenPrinterW
mov dword [ebp - 0x12c], eax
cmp dword [ebp - 0x12c], 0
jne 0x40a905
mov ecx, dword [ebp - 0x360]
cmp dword [ecx + 0x107c], 0
je 0x40a905
mov edx, dword [ebp - 0x360]
mov eax, dword [edx + 0x107c]
mov ecx, dword [ebp - 0x360]
mov ecx, dword [ecx + 0x107c]
mov edx, dword [eax]
mov eax, dword [edx + 0x20]
call eax
mov dword [ebp - 0x364], eax
mov ecx, dword [ebp - 0x364]
mov edx, dword [ecx]
mov ecx, dword [ebp - 0x364]
mov eax, dword [edx + 0x1c]
call eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x12c], 1
mov byte [ebp - 5], 1
cmp dword [ebp - 0x12c], 0
jne 0x40a916
mov eax, dword [ebp - 0x14]
jmp 0x40abf7
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp - 0x360]
cmp dword [ecx + 0x107c], 0
je 0x40aa03
mov edx, dword [ebp - 0x360]
mov eax, dword [edx + 0x107c]
mov ecx, dword [ebp - 0x360]
mov ecx, dword [ecx + 0x107c]
mov edx, dword [eax]
mov eax, dword [edx + 0x20]
call eax
mov dword [ebp - 0x368], eax
mov ecx, dword [ebp - 0x368]
mov edx, dword [ecx]
mov ecx, dword [ebp - 0x368]
mov eax, dword [edx + 0xd0]
call eax
movzx ecx, al
test ecx, ecx
je 0x40aa03
mov edx, dword [ebp - 0x360]
movzx eax, byte [edx + 0x105e]
test eax, eax
jne 0x40aa03
lea ecx, [ebp - 0x128]
push ecx
mov ecx, dword [ebp - 0x360]
call fcn.0040c930
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 0x10]
push edx
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x354], eax
mov eax, dword [ebp - 0x354]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x10], 0
jne 0x40a9d3
mov ecx, dword [ebp - 0x130]
push ecx
push str.Error__ld_n
call fcn.00413880
add esp, 8
jmp 0x40a9fe
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x18]
push eax
lea ecx, [ebp - 0x128]
push ecx
mov ecx, dword [ebp - 0x360]
call fcn.0040c8f0
movzx edx, al
test edx, edx
je 0x40a9fe
mov dword [ebp - 0x130], 0
jmp 0x40ab56
mov eax, dword [ebp - 0x360]
cmp dword [eax + 0x107c], 0
je 0x40aa6c
mov ecx, dword [ebp - 0x360]
mov edx, dword [ecx + 0x107c]
mov eax, dword [ebp - 0x360]
mov ecx, dword [eax + 0x107c]
mov edx, dword [edx]
mov eax, dword [edx + 0x20]
call eax
mov dword [ebp - 0x36c], eax
lea ecx, [ebp - 0x10]
push ecx
push 0
lea edx, [ebp - 0x128]
push edx
mov eax, dword [ebp - 0x36c]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x36c]
mov eax, dword [edx + 0x8c]
call eax
movzx ecx, al
neg ecx
sbb ecx, ecx
add ecx, 1
mov dword [ebp - 0x130], ecx
jmp 0x40aa90
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x10]
push eax
push 0
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 0x128]
push edx
mov eax, dword [ebp - 4]
push eax
call sub.WINSPOOL.DRV_GetPrinterDataA
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x10], 0
jne 0x40aaaa
mov ecx, dword [ebp - 0x130]
push ecx
push str.Error__ld_n
call fcn.00413880
add esp, 8
mov edx, dword [ebp - 0x10]
push edx
call fcn.00415b79
add esp, 4
mov dword [ebp - 0x358], eax
mov eax, dword [ebp - 0x358]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x360]
cmp dword [ecx + 0x107c], 0
je 0x40ab30
mov edx, dword [ebp - 0x360]
mov eax, dword [edx + 0x107c]
mov ecx, dword [ebp - 0x360]
mov ecx, dword [ecx + 0x107c]
mov edx, dword [eax]
mov eax, dword [edx + 0x20]
call eax
mov dword [ebp - 0x370], eax
lea ecx, [ebp - 0x10]
push ecx
mov edx, dword [ebp - 0x18]
push edx
lea eax, [ebp - 0x128]
push eax
mov ecx, dword [ebp - 0x370]
mov edx, dword [ecx]
mov ecx, dword [ebp - 0x370]
mov eax, dword [edx + 0x8c]
call eax
movzx ecx, al
neg ecx
sbb ecx, ecx
add ecx, 1
mov dword [ebp - 0x130], ecx
jmp 0x40ab56
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
lea edx, [ebp - 0xc]
push edx
lea eax, [ebp - 0x128]
push eax
mov ecx, dword [ebp - 4]
push ecx
call sub.WINSPOOL.DRV_GetPrinterDataA
mov dword [ebp - 0x130], eax
cmp dword [ebp - 0x130], 0
jne 0x40abcb
cmp dword [ebp + 0x14], 0
je 0x40aba9
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.00416200
add esp, 0xc
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp - 0x10]
mov dword [edx], eax
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ebp - 0xc]
mov dword [ecx], edx
lea eax, [ebp - 0x128]
push eax
mov ecx, dword [ebp + 0x18]
mov edx, dword [ecx]
push edx
mov eax, dword [ebp + 0x10]
push eax
push str.LoadProfileRegValue____s___ld___s_n
call fcn.00413880
add esp, 0x10
jmp 0x40abc5
lea ecx, [ebp - 0x128]
push ecx
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp + 0x10]
push eax
push str.LoadProfileRegValue___Size____s___ld___s_n
call fcn.00413880
add esp, 0x10
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x35c], edx
mov eax, dword [ebp - 0x35c]
push eax
call fcn.00415ab7
add esp, 4
movzx ecx, byte [ebp - 5]
test ecx, ecx
jne 0x40abf4
mov edx, dword [ebp - 4]
push edx
call sub.WINSPOOL.DRV_ClosePrinter
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.00415aa8
mov esp, ebp
pop ebp
ret 0x18